@ulrik.ek/wgs84 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Ulrik Ekedahl
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # @uek/wgs84
2
+
3
+ ## Introduction
4
+
5
+ A tiny library fully implemented in Typescript to handle WGS84 coordinates in GeoJson and "small" distances between them with very high accuracy (~1 cm), based on a local, flat earth approximation.
6
+
7
+ - Parses and gives output in GeoJson using the [Point definition](https://en.wikipedia.org/wiki/GeoJSON). If you already have imported the typescript definition for Point in the geojson package you can use that (that is what I do in unit testing). Otherwise you can import `Point` from this package.
8
+ - No dependencies to other NPM modules.
9
+ - The math is based on [Aviation Formulary V1.47 by Ed Williams](https://edwilliams.org/avform147.htm#flat).
10
+ - Functions will throw `Error` if fed impossible values, e.g. incorrectly formatted GeoJSON or lat >= 90 degrees (math will not work!). Make sure to handle that!
11
+
12
+ ## Getting Started
13
+
14
+ Include in your project as any other NPM package
15
+
16
+ > npm install @uek/wgs84
17
+
18
+ ## Usage
19
+
20
+ ```typescript
21
+ import {
22
+ bearing,
23
+ distance,
24
+ distanceEast,
25
+ distanceNorth,
26
+ distanceUp,
27
+ point,
28
+ Point,
29
+ pointEast,
30
+ pointNorth,
31
+ pointUp
32
+ } from '@UEk/wgs84';
33
+
34
+ // helper function to construct a GeoJSON Point
35
+ const lat = 15;
36
+ const lon = 25;
37
+ const p: Point = point(lat, lon);
38
+
39
+ // Getting a new point 100m north and 200m east of the first point
40
+ const p1: Point = pointEastOf(pointNorth(p, 100), 200);
41
+ const newLat = p1.coordinates[1]; // GeoJSON uses [lon, lat] order!
42
+ const newLon = p1.coordinates[0];
43
+
44
+ // get the distance along north between the 2 points
45
+ assert(distanceNorth(p, p1) === 100);
46
+ assert(distanceNorth(p1, p) === -100);
47
+ ```
48
+
49
+ ## Documention
50
+
51
+ [Typedoc](doc\)
52
+
53
+ # Build and Test
54
+
55
+ All functions are unit tested.
@@ -0,0 +1,15 @@
1
+ export interface Point {
2
+ type: 'Point';
3
+ coordinates: number[];
4
+ }
5
+ export declare function point(lat: number, lon: number, height?: number): Point;
6
+ export declare function R1(position: Point): number;
7
+ export declare function R2(position: Point): number;
8
+ export declare function distanceNorth(origin: Point, target: Point): number;
9
+ export declare function distanceEast(origin: Point, target: Point): number;
10
+ export declare function distanceUp(origin: Point, target: Point): number;
11
+ export declare function distance(origin: Point, target: Point): number;
12
+ export declare function bearing(origin: Point, target: Point): number;
13
+ export declare function pointNorthOf(origin: Point, dN: number): Point;
14
+ export declare function pointEastOf(origin: Point, dE: number): Point;
15
+ export declare function pointAbove(origin: Point, dH: number): Point;
package/dist/index.js ADDED
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pointAbove = exports.pointEastOf = exports.pointNorthOf = exports.bearing = exports.distance = exports.distanceUp = exports.distanceEast = exports.distanceNorth = exports.R2 = exports.R1 = exports.point = void 0;
4
+ function point(lat, lon, height) {
5
+ const result = height
6
+ ? { coordinates: [lon, lat, height], type: 'Point' }
7
+ : { coordinates: [lon, lat], type: 'Point' };
8
+ validCoord(result);
9
+ return result;
10
+ }
11
+ exports.point = point;
12
+ const R = 6378.137 * 1000;
13
+ const f = 1 / 298.257223563;
14
+ const eSquared = f * (2 - f);
15
+ function R1(position) {
16
+ validCoord(position);
17
+ const lat = degToRad(position.coordinates[1]);
18
+ return (R * (1 - eSquared)) / Math.pow(1 - eSquared * Math.pow(Math.sin(lat), 2), 3 / 2);
19
+ }
20
+ exports.R1 = R1;
21
+ function R2(position) {
22
+ validCoord(position);
23
+ const lat = degToRad(position.coordinates[1]);
24
+ return R / Math.sqrt(1 - eSquared * Math.pow(Math.sin(lat), 2));
25
+ }
26
+ exports.R2 = R2;
27
+ function distanceNorth(origin, target) {
28
+ validCoord(origin);
29
+ validCoord(target);
30
+ const xLat = degToRad(origin.coordinates[1]);
31
+ const yLat = degToRad(target.coordinates[1]);
32
+ return R1(origin) * (yLat - xLat);
33
+ }
34
+ exports.distanceNorth = distanceNorth;
35
+ function distanceEast(origin, target) {
36
+ validCoord(origin);
37
+ validCoord(target);
38
+ const xLat = degToRad(origin.coordinates[1]);
39
+ const xLon = degToRad(origin.coordinates[0]);
40
+ const yLon = degToRad(target.coordinates[0]);
41
+ let deltaAngle;
42
+ if (yLon - xLon > Math.PI) {
43
+ deltaAngle = yLon - xLon - 2 * Math.PI;
44
+ }
45
+ else if (yLon - xLon < -Math.PI) {
46
+ deltaAngle = yLon - xLon + 2 * Math.PI;
47
+ }
48
+ else {
49
+ deltaAngle = yLon - xLon;
50
+ }
51
+ return R2(origin) * Math.cos(xLat) * deltaAngle;
52
+ }
53
+ exports.distanceEast = distanceEast;
54
+ function distanceUp(origin, target) {
55
+ if (origin.coordinates.length === 3 && target.coordinates.length === 3) {
56
+ return target.coordinates[2] - origin.coordinates[2];
57
+ }
58
+ else {
59
+ throw new Error('Input is not GeoJSON Point with height.');
60
+ }
61
+ }
62
+ exports.distanceUp = distanceUp;
63
+ function distance(origin, target) {
64
+ if (origin.coordinates.length === 2 || target.coordinates.length === 2) {
65
+ return Math.sqrt(distanceNorth(origin, target) ** 2 + distanceEast(origin, target) ** 2);
66
+ }
67
+ else if (origin.coordinates.length === 3 && target.coordinates.length === 3) {
68
+ return Math.sqrt(distanceNorth(origin, target) ** 2 +
69
+ distanceEast(origin, target) ** 2 +
70
+ distanceUp(origin, target) ** 2);
71
+ }
72
+ else {
73
+ throw new Error('Inputs are not GeoJSON Points.');
74
+ }
75
+ }
76
+ exports.distance = distance;
77
+ function bearing(origin, target) {
78
+ validCoord(origin);
79
+ validCoord(target);
80
+ return ((radToDeg(Math.atan2(distanceEast(origin, target), distanceNorth(origin, target))) + 360) %
81
+ 360);
82
+ }
83
+ exports.bearing = bearing;
84
+ function pointNorthOf(origin, dN) {
85
+ validCoord(origin);
86
+ const lon = origin.coordinates[0];
87
+ const lat = radToDeg(degToRad(origin.coordinates[1]) + dN / R1(origin));
88
+ let result;
89
+ if (origin.coordinates[2]) {
90
+ const h = origin.coordinates[2];
91
+ result = { coordinates: [lon, lat, h], type: 'Point' };
92
+ }
93
+ else {
94
+ result = { coordinates: [lon, lat], type: 'Point' };
95
+ }
96
+ validCoord(result);
97
+ return result;
98
+ }
99
+ exports.pointNorthOf = pointNorthOf;
100
+ function pointEastOf(origin, dE) {
101
+ validCoord(origin);
102
+ const lat = origin.coordinates[1];
103
+ let lon = radToDeg(degToRad(origin.coordinates[0]) + dE / (R2(origin) * Math.cos(degToRad(lat))));
104
+ if (lon > 180) {
105
+ lon -= 360;
106
+ }
107
+ else if (lon < -180) {
108
+ lon += 360;
109
+ }
110
+ if (origin.coordinates[2]) {
111
+ const h = origin.coordinates[2];
112
+ return { coordinates: [lon, lat, h], type: 'Point' };
113
+ }
114
+ else {
115
+ return { coordinates: [lon, lat], type: 'Point' };
116
+ }
117
+ }
118
+ exports.pointEastOf = pointEastOf;
119
+ function pointAbove(origin, dH) {
120
+ validCoord(origin);
121
+ return {
122
+ coordinates: [origin.coordinates[0], origin.coordinates[1], origin.coordinates[2] + dH],
123
+ type: 'Point'
124
+ };
125
+ }
126
+ exports.pointAbove = pointAbove;
127
+ function degToRad(deg) {
128
+ return (deg * Math.PI) / 180;
129
+ }
130
+ function radToDeg(rad) {
131
+ return (rad * 180) / Math.PI;
132
+ }
133
+ function validCoord(p) {
134
+ if (-90 <= p.coordinates[1] &&
135
+ p.coordinates[1] < 90 &&
136
+ -180 <= p.coordinates[0] &&
137
+ p.coordinates[0] <= 180) {
138
+ return true;
139
+ }
140
+ else {
141
+ throw new Error(`Lat=$(lat)) or lon=$(lon) out of range`);
142
+ }
143
+ }
144
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAiBA,SAAgB,KAAK,CAAC,GAAW,EAAE,GAAW,EAAE,MAAe;IAC3D,MAAM,MAAM,GAAU,MAAM;QACxB,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE;QACpD,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IACjD,UAAU,CAAC,MAAM,CAAC,CAAC;IACnB,OAAO,MAAM,CAAC;AAClB,CAAC;AAND,sBAMC;AAGD,MAAM,CAAC,GAAW,QAAQ,GAAG,IAAI,CAAC;AAElC,MAAM,CAAC,GAAW,CAAC,GAAG,aAAe,CAAC;AAEtC,MAAM,QAAQ,GAAW,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAQrC,SAAg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WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;KACrD;AACL,CAAC;AAjBD,kCAiBC;AASD,SAAgB,UAAU,CAAC,MAAa,EAAE,EAAU;IAChD,UAAU,CAAC,MAAM,CAAC,CAAC;IACnB,OAAO;QACH,WAAW,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;QACvF,IAAI,EAAE,OAAO;KAChB,CAAC;AACN,CAAC;AAND,gCAMC;AAED,SAAS,QAAQ,CAAC,GAAW;IACzB,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;AACjC,CAAC;AAED,SAAS,QAAQ,CAAC,GAAW;IACzB,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AACjC,CAAC;AAED,SAAS,UAAU,CAAC,CAAQ;IACxB,IACI,CAAC,EAAE,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;QACvB,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,EAAE;QACrB,CAAC,GAAG,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;QACxB,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,GAAG,EACzB;QACE,OAAO,IAAI,CAAC;KACf;SAAM;QACH,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;KAC7D;AACL,CAAC"}
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@ulrik.ek/wgs84",
3
+ "version": "1.0.0",
4
+ "description": "Basic library for computing small distances between WGS84 coordinates using a flat earth approximation.",
5
+ "author": "Ulrik E",
6
+ "license": "MIT",
7
+ "main": "dist/index.js",
8
+ "directories": {
9
+ "doc": "doc",
10
+ "test": "test"
11
+ },
12
+ "type": "commonjs",
13
+ "scripts": {
14
+ "audit": "npm audit --registry=https://registry.npmjs.org",
15
+ "lint": "npx eslint .",
16
+ "lint_fix": "npx eslint . --fix",
17
+ "style": "npx prettier --check \"./**/*.ts\" --check \"./**/*.json\" --check \"./**/*.md\"",
18
+ "style_fix": "npx prettier --write \"./**/*.ts\" --write \"./**/*.json\" --write \"./**/*.md\"",
19
+ "verify_and_install": "npm cache verify && npm install",
20
+ "clean": "npx shx rm -rf ./coverage/ ./report/ ./dist/",
21
+ "build": "tsc --build tsconfig.json",
22
+ "test": "npm run clean && npx jest --clearCache && jest --verbose --coverage --color --modulePathIgnorePatterns=./dist/ && npm run build",
23
+ "type_doc": "npx typedoc --plugin typedoc-plugin-markdown --out doc src/index.ts --excludeNotDocumented"
24
+ },
25
+ "devDependencies": {
26
+ "@types/geojson": "^7946.0.8",
27
+ "@types/jest": "^27.4.1",
28
+ "@types/node": "^17.0.23",
29
+ "@typescript-eslint/eslint-plugin": "^5.16.0",
30
+ "@typescript-eslint/parser": "^5.16.0",
31
+ "eslint": "^8.12.0",
32
+ "eslint-plugin-import": "^2.25.4",
33
+ "eslint-plugin-jest": "26.1.3",
34
+ "eslint-plugin-json": "^3.1.0",
35
+ "eslint-plugin-simple-import-sort": "^7.0.0",
36
+ "eslint-plugin-sort-class-members": "^1.14.1",
37
+ "eslint-plugin-sort-keys-fix": "^1.1.2",
38
+ "eslint-plugin-unicorn": "^41.0.1",
39
+ "eslint-plugin-yaml": "^0.5.0",
40
+ "jest": "^27.5.1",
41
+ "jest-junit": "^13.0.0",
42
+ "prettier": "^2.6.1",
43
+ "shx": "^0.3.4",
44
+ "ts-jest": "^27.1.4",
45
+ "ts-node": "^10.7.0",
46
+ "typedoc": "^0.22.13",
47
+ "typedoc-plugin-markdown": "^3.11.14",
48
+ "typescript": "^4.6.3"
49
+ },
50
+ "types": "./dist/index.d.ts",
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "git+https://github.com/UEk/wgs84.git"
54
+ },
55
+ "bugs": {
56
+ "url": "https://github.com/UEk/wgs84/issues"
57
+ },
58
+ "homepage": "https://github.com/UEk/wgs84#readme",
59
+ "keywords": ["wgs84", "geojson"]
60
+ }