@basemaps/shared 6.23.0 → 6.24.1
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [6.24.1](https://github.com/linz/basemaps/compare/v6.24.0...v6.24.1) (2022-04-07)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **shared:** Projection.tyryGet do not throw if no projection is defined ([#2145](https://github.com/linz/basemaps/issues/2145)) ([7592fe5](https://github.com/linz/basemaps/commit/7592fe53c023f341f916520a7014fd00436df245))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [6.23.0](https://github.com/linz/basemaps/compare/v6.22.1...v6.23.0) (2022-04-04)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EpsgCode } from '@basemaps/geo';
|
|
1
|
+
import { Epsg, EpsgCode } from '@basemaps/geo';
|
|
2
2
|
import { round } from '@basemaps/test/build/rounding.js';
|
|
3
3
|
import { bboxToPolygon } from '@linzjs/geojson';
|
|
4
4
|
import o from 'ospec';
|
|
@@ -16,6 +16,13 @@ o.spec('Projection', () => {
|
|
|
16
16
|
const reverse = nztmProj.fromWgs84(output);
|
|
17
17
|
o(round(reverse, 2)).deepEquals([1180000, 4758000]);
|
|
18
18
|
});
|
|
19
|
+
o('tryGet should not throw if epsg is defined but projection is not', () => {
|
|
20
|
+
const count = Epsg.Codes.size;
|
|
21
|
+
const epsg = new Epsg(Math.random());
|
|
22
|
+
o(Projection.tryGet(epsg)).equals(null);
|
|
23
|
+
Epsg.Codes.delete(epsg.code);
|
|
24
|
+
o(Epsg.Codes.size).equals(count);
|
|
25
|
+
});
|
|
19
26
|
o('toGeoJson', () => {
|
|
20
27
|
const geojson = googleProj.toGeoJson(qkToNamedBounds(['31', '33']));
|
|
21
28
|
const { features } = geojson;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../../src/proj/projection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC9F,OAAO,EACL,IAAI,EACJ,WAAW,EACX,qBAAqB,EAKtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAUnC,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAUD,qBAAa,UAAU;IACrB,IAAI,EAAE,IAAI,CAAC;IAEX,8CAA8C;IAC9C,OAAO,CAAC,UAAU,CAAkB;IAEpC;;OAEG;IACH,OAAO;IAaP,0DAA0D;IAC1D,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAM5C;;;;;;OAMG;IACH,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,aAAa,GAAG,UAAU;IAMjE;;;OAGG;IACH,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,aAAa,GAAG,UAAU,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../../src/proj/projection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC9F,OAAO,EACL,IAAI,EACJ,WAAW,EACX,qBAAqB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AE,WAAW,SAAI,GAAG,MAAM;IAU/E,yCAAyC;IACzC,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI;IAY5D;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,GAAG,MAAM;IAOjE;;;;;;;;;OASG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IA8BnD;;;;;OAKG;IACH,MAAM,CAAC,mBAAmB,CAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IAI/E;;;;;;SAMK;IACL,MAAM,CAAC,kBAAkB,CAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM;CAKtF"}
|
package/build/proj/projection.js
CHANGED
|
@@ -59,12 +59,18 @@ export class Projection {
|
|
|
59
59
|
const epsgCode = getEpsgCode(unk);
|
|
60
60
|
if (epsgCode == null)
|
|
61
61
|
return null;
|
|
62
|
+
// Existing projection logic, cache and reuse
|
|
62
63
|
let proj = CodeMap.get(epsgCode);
|
|
63
64
|
if (proj != null)
|
|
64
65
|
return proj;
|
|
66
|
+
// ensure the EPSG Code has been registered in basemaps
|
|
65
67
|
const epsg = Epsg.tryGet(epsgCode);
|
|
66
68
|
if (epsg == null)
|
|
67
69
|
return null;
|
|
70
|
+
// Ensure proj has a transform for this projection
|
|
71
|
+
const def = Proj.defs(epsg.toEpsgString());
|
|
72
|
+
if (def == null)
|
|
73
|
+
return null;
|
|
68
74
|
proj = new Projection(epsg);
|
|
69
75
|
CodeMap.set(epsgCode, proj);
|
|
70
76
|
return proj;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basemaps/shared",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.24.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"files": [
|
|
50
50
|
"build/"
|
|
51
51
|
],
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "034afcc7087bbe9041098d54e1529d757a70bb29"
|
|
53
53
|
}
|