1.6.1 • Published 3 years ago

@tsl-tuertscher/gis-helpers v1.6.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

example workflow example workflow example workflow

gis-helpers

Helper functions for geographic information system

Install

npm install @tsl-tuertscher/gis-helpers

Usage

import {
  getBearing,
  getBearing360,
  getDistance,
  getRadialCoordinates,
  getPointInPolygon,
  getBoundingRectangle,
  getPointInTriangle,
  getPointInBoundingRectangle,
  simplify
} from '@tsl-tuertscher/gis-helpers';
import { Vector } from '@tsl-tuertscher/gis-helpers/vector';
import {
  fromTileX,
  fromTileY,
  toTileX,
  toTileY,
  tile2lon,
  tile2lat,
  lon2tile,
  lat2tile
} from './slippy-tiles';
import { Matrix } from '@tsl-tuertscher/gis-helpers/matrix';

...

const distance = getDistance([9, 47.5], [13, 49.2]);
const bearing = getBearing([9, 47.5], [13, 49.2]);
const coordinate = getRadialCoordinates([9, 47.5], 45, 1000);

...

const vector = new Vector(1,2,3);
const newVector = vector.innerProduct(new Vector(4, 5, 6));

...

const x = fromTileX(269, 9);
const y = fromTileY(179, 9);

const lon = tile2lon(269, 9);
const lat = tile2lat(179, 9);

const tileX = lon2tile(9.34, 12, false);
const tileY = lat2tile(47.34, 12, false);

...

const mat = new Matrix();
mat.setRotationsMatrixY(Math.PI / 2);
const vec = mat.multiply(new Vector(1,2,3));
1.6.1

3 years ago

1.6.0

3 years ago

1.4.2

3 years ago

1.5.0

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago