Skip to content

Commit

Permalink
v2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisveness committed Nov 16, 2021
1 parent 70e7b15 commit 7cff490
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -2,7 +2,7 @@ language: node_js

node_js:
- "node"
- "14"
- "lts/*"

os:
- linux
Expand Down
6 changes: 4 additions & 2 deletions CHANGELOG.md
@@ -1,15 +1,17 @@
# Changelog

## Unreleased
## [2.3.0] - 2021-11-16

### Fixed

- Fix parsing of 'H' 500km squares (Scottish islands)
- Fix parsing of 'H' 500km squares (Scottish islands) [#96]
- Fix Dms.wrap90(), Dms.wrap180() to work for all -ve degrees
- LatLon_OsGridRef: Override super.convertDatum()

### Added

- LatLonEllipsoidal_Vincenty.intermediatePointTo()
- Extra type-checking (LatLonEllipsoidal_Vincenty.direct, LatLonNvectorSpherical.isEnclosedBy)

## [2.2.1] - 2020-04-22

Expand Down
25 changes: 19 additions & 6 deletions README.md
Expand Up @@ -96,7 +96,7 @@ The library can be used in the browser by taking a local copy, or loading it fro
```html
<!doctype html><title>geodesy example</title><meta charset="utf-8">
<script type="module">
import LatLon from 'https://cdn.jsdelivr.net/npm/geodesy@2.2.1/latlon-spherical.min.js';
import LatLon from 'https://cdn.jsdelivr.net/npm/geodesy@2.3.0/latlon-spherical.min.js';
const p1 = new LatLon(50.06632, -5.71475);
const p2 = new LatLon(58.64402, -3.07009);
Expand All @@ -112,13 +112,12 @@ The library can be used in the browser by taking a local copy, or loading it fro
### Usage in Node.js

The library can be loaded from [npm](https://www.npmjs.com/package/geodesy) to be used in a Node.js app
(in Node.js v13.2.0+, or using the [esm](https://www.npmjs.com/package/esm) package in
v8.0.0–v12.15.0<sup title="v12.16.0+ is not compatible with esm@3.2.25">*</sup>):
(in Node.js v13.2.0+, or Node.js v12.0.0+ using --experimental-modules, or v8.0.0–v12.15.0<sup title="v12.16.0+ is not compatible with esm@3.2.25">*</sup>) using the [esm](https://www.npmjs.com/package/esm) package:

```shell
$ npm install geodesy esm
$ node -r esm
> import LatLon from 'geodesy/latlon-spherical.js';
$ npm install geodesy
$ node
> const { default: LatLon } = await import('geodesy/latlon-spherical.js');
> const p1 = new LatLon(50.06632, -5.71475);
> const p2 = new LatLon(58.64402, -3.07009);
> const d = p1.distanceTo(p2);
Expand All @@ -127,6 +126,20 @@ $ node -r esm
> console.assert(mid.toString('dms') == '54° 21′ 44″ N, 004° 31′ 51″ W');
```
To some extent, mixins can be used to add methods of a class to a different class, e.g.:
import LatLon from 'geodesy/latlon-nvector-ellipsoidal.js';
import LatLonV from 'geodesy/latlon-ellipsoidal-vincenty.js';
for (const method of Object.getOwnPropertyNames(LatLonV.prototype)) {
LatLon.prototype[method] = LatLonV.prototype[method];
}
const d = new LatLon(51, 0).distanceTo(new LatLon(52, 1));
const δ = new LatLon(51, 0).deltaTo(new LatLon(52, 1));
More care is of course required if there are conflicting constructors or method names.
For TypeScript users, type definitions are available from DefinitelyTyped: [www.npmjs.com/package/@types/geodesy](https://www.npmjs.com/package/@types/geodesy).
### Other examples
Expand Down
15 changes: 7 additions & 8 deletions package.json
Expand Up @@ -6,11 +6,12 @@
"type": "git",
"url": "https://github.com/chrisveness/geodesy"
},
"keywords": [ "geodesy", "latitude", "longitude", "distance", "bearing", "destination", "haversine", "vincenty", "rhumb", "ellipsoid", "datum", "reference frame", "TRF", "wgs84", "utm", "mgrs" ],
"keywords": [ "geodesy", "latitude", "longitude", "distance", "bearing", "destination", "haversine", "vincenty", "rhumb", "ellipsoid", "datum", "reference-frame", "TRF", "vector", "n-vector", "wgs84", "utm", "mgrs" ],
"author": "Chris Veness",
"version": "2.2.1",
"version": "2.3.0",
"license": "MIT",
"type": "module",
"module": "./",
"engines": {
"node": ">=8.0.0"
},
Expand All @@ -24,11 +25,11 @@
},
"devDependencies": {
"c8": "^7.0.0",
"chai": "4.0.0",
"chai": "^4.0.0",
"coveralls": "^3.0.0",
"eslint": "^8.0.0",
"jsdoc": "^3.0.0",
"mocha": "^7.0.0"
"mocha": "^9.0.0"
},
"eslintConfig": {
"env": {
Expand All @@ -42,7 +43,6 @@
},
"extends": "eslint:recommended",
"globals": {
"chai": true,
"should": true
},
"rules": {
Expand All @@ -54,7 +54,7 @@
"key-spacing": [ "error", { "align": "value" } ],
"keyword-spacing": [ "error" ],
"no-case-declarations": "warn",
"no-console": [ "warn", { "allow": [ "error", "info", "debug" ] } ],
"no-console": [ "warn", { "allow": [ "error", "info", "debug", "assert" ] } ],
"no-irregular-whitespace": "warn",
"no-redeclare": "warn",
"no-shadow": "warn",
Expand All @@ -66,8 +66,7 @@
"require-await": "error",
"semi": [ "error", "always" ],
"space-before-blocks": [ "error", "always" ],
"space-in-parens": [ "error" ],
"strict": [ "error", "global" ]
"space-in-parens": [ "error" ]
}
},
"jsdoc": {
Expand Down

0 comments on commit 7cff490

Please sign in to comment.