0.8.0 • Published 1 year ago

as-geo-web-coordinate v0.8.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

as-geo-web-coordinate

An AssemblyScript implementation of converting GeoWebCoordinate to GPS coordinates. See the spec.

Install

npm install as-geo-web-coordinate

Usage

Convert GPS -> Geo Web Coordinate

import * as GeoWebCoordinate from "as-geo-web-coordinate";

const lon = 110.0;
const lat = 38.0;
const maxLat = (1 << 22) - 1;

const gwCoord: u64 = GeoWebCoordinate.from_gps(lon, lat, maxLat);

Convert Geo Web Coordinate -> GPS Bounding Box

import * as GeoWebCoordinate from "as-geo-web-coordinate";

const maxLat = (1 << 22) - 1;
const maxLon = (1 << 23) - 1;

const gpsCoords = GeoWebCoordinate.to_gps(gwCoord, maxLat, maxLon);

const bl_x = gpsCoords[0][0];
const bl_y = gpsCoords[0][1];

const br_x = gpsCoords[1][0];
const br_y = gpsCoords[1][1];

const tr_x = gpsCoords[2][0];
const tr_y = gpsCoords[2][1];

const tl_x = gpsCoords[3][0];
const tl_y = gpsCoords[3][1];

Tests

See tests for more usage.

npm test
0.8.0

1 year ago

0.7.0

2 years ago

0.6.0

3 years ago

0.5.8

3 years ago

0.5.7

3 years ago

0.5.6

3 years ago

0.5.5

3 years ago

0.5.4

4 years ago

0.5.3

4 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.3.1

4 years ago

0.1.2

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago