@basemaps/shared 6.9.1 → 6.16.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.
Files changed (70) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/build/__test__/api.path.test.js +57 -60
  3. package/build/__test__/api.test.js +29 -32
  4. package/build/__test__/env.test.js +9 -12
  5. package/build/__test__/util.test.js +36 -39
  6. package/build/__test__/vdom.parse.test.js +18 -21
  7. package/build/__test__/vdom.test.js +29 -32
  8. package/build/api.js +6 -10
  9. package/build/api.path.d.ts.map +1 -1
  10. package/build/api.path.js +15 -23
  11. package/build/aws/aws.dynamo.table.d.ts.map +1 -1
  12. package/build/aws/aws.dynamo.table.js +1 -2
  13. package/build/cli/__test__/git.tag.test.js +7 -10
  14. package/build/cli/api.key.js +4 -9
  15. package/build/cli/git.tag.js +4 -8
  16. package/build/composite.error.d.ts +1 -7
  17. package/build/composite.error.d.ts.map +1 -1
  18. package/build/composite.error.js +1 -13
  19. package/build/const.d.ts.map +1 -1
  20. package/build/const.js +3 -6
  21. package/build/file/__test__/file.local.test.js +33 -22
  22. package/build/file/__test__/file.operator.test.helper.d.ts.map +1 -1
  23. package/build/file/__test__/file.operator.test.helper.js +17 -21
  24. package/build/file/file.config.d.ts.map +1 -1
  25. package/build/file/file.config.js +2 -7
  26. package/build/file/index.d.ts +3 -3
  27. package/build/file/index.d.ts.map +1 -1
  28. package/build/file/index.js +19 -23
  29. package/build/index.d.ts +12 -14
  30. package/build/index.d.ts.map +1 -1
  31. package/build/index.js +18 -36
  32. package/build/log.d.ts +0 -3
  33. package/build/log.d.ts.map +1 -1
  34. package/build/log.js +6 -16
  35. package/build/logger.fatal.error.d.ts.map +1 -1
  36. package/build/logger.fatal.error.js +1 -5
  37. package/build/proj/__test__/projection.test.js +30 -33
  38. package/build/proj/__test__/projection.tile.matrix.set.test.js +115 -118
  39. package/build/proj/__test__/test.util.d.ts.map +1 -1
  40. package/build/proj/__test__/test.util.js +10 -17
  41. package/build/proj/citm2000.js +1 -4
  42. package/build/proj/nztm2000.js +1 -4
  43. package/build/proj/projection.d.ts +33 -33
  44. package/build/proj/projection.d.ts.map +1 -1
  45. package/build/proj/projection.js +47 -52
  46. package/build/proj/tile.set.name.d.ts.map +1 -1
  47. package/build/proj/tile.set.name.js +3 -7
  48. package/build/util.d.ts.map +1 -1
  49. package/build/util.js +5 -13
  50. package/build/vdom.d.ts.map +1 -1
  51. package/build/vdom.js +4 -11
  52. package/build/vdom.parse.d.ts +1 -1
  53. package/build/vdom.parse.d.ts.map +1 -1
  54. package/build/vdom.parse.js +5 -10
  55. package/package.json +12 -9
  56. package/build/__test__/aws.init.test.d.ts +0 -2
  57. package/build/__test__/aws.init.test.d.ts.map +0 -1
  58. package/build/__test__/aws.init.test.js +0 -9
  59. package/build/aws/api.key.table.d.ts +0 -29
  60. package/build/aws/api.key.table.d.ts.map +0 -1
  61. package/build/aws/api.key.table.js +0 -38
  62. package/build/aws/credentials.d.ts +0 -21
  63. package/build/aws/credentials.d.ts.map +0 -1
  64. package/build/aws/credentials.js +0 -42
  65. package/build/aws/index.d.ts +0 -16
  66. package/build/aws/index.d.ts.map +0 -1
  67. package/build/aws/index.js +0 -38
  68. package/build/aws/object.cache.d.ts +0 -6
  69. package/build/aws/object.cache.d.ts.map +0 -1
  70. package/build/aws/object.cache.js +0 -17
package/build/log.js CHANGED
@@ -1,33 +1,23 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LogConfig = void 0;
4
- const tslib_1 = require("tslib");
5
- const pino_1 = tslib_1.__importDefault(require("pino"));
1
+ import pino from 'pino';
2
+ import { PrettyTransform } from 'pretty-json-log';
6
3
  let currentLog;
4
+ const defaultOpts = { level: 'debug' };
7
5
  /**
8
6
  * Encapsulate the logger so that it can be swapped out
9
7
  */
10
- exports.LogConfig = {
8
+ export const LogConfig = {
11
9
  /** Get the currently configured logger */
12
10
  get() {
13
11
  if (currentLog == null) {
14
- currentLog = pino_1.default({ level: 'debug' });
12
+ currentLog = process.stdout.isTTY ? pino(defaultOpts, PrettyTransform.stream()) : pino(defaultOpts);
15
13
  }
16
14
  return currentLog;
17
15
  },
18
16
  set(log) {
19
17
  currentLog = log;
20
18
  },
21
- /** Overwrite the logger with a new logger that outputs to the provided stream*/
22
- setOutputStream(stream) {
23
- let level = 'debug';
24
- if (currentLog) {
25
- level = currentLog.level;
26
- }
27
- currentLog = pino_1.default({ level }, stream);
28
- },
29
19
  /** Disable the logger */
30
20
  disable() {
31
- exports.LogConfig.get().level = 'silent';
21
+ LogConfig.get().level = 'silent';
32
22
  },
33
23
  };
@@ -1 +1 @@
1
- {"version":3,"file":"logger.fatal.error.d.ts","sourceRoot":"","sources":["../src/logger.fatal.error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACvC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBACjB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM;CAIxD"}
1
+ {"version":3,"file":"logger.fatal.error.d.ts","sourceRoot":"","sources":["../src/logger.fatal.error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBACjB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM;CAItD"}
@@ -1,13 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LoggerFatalError = void 0;
4
1
  /**
5
2
  * Utility error to throw expecting that Logger will fatal log its contents
6
3
  */
7
- class LoggerFatalError extends Error {
4
+ export class LoggerFatalError extends Error {
8
5
  constructor(obj, msg) {
9
6
  super(msg);
10
7
  this.obj = obj;
11
8
  }
12
9
  }
13
- exports.LoggerFatalError = LoggerFatalError;
@@ -1,33 +1,30 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const geo_1 = require("@basemaps/geo");
5
- const rounding_1 = require("@basemaps/test/build/rounding");
6
- const geojson_1 = require("@linzjs/geojson");
7
- const ospec_1 = tslib_1.__importDefault(require("ospec"));
8
- const projection_1 = require("../projection");
9
- const test_util_1 = require("./test.util");
10
- ospec_1.default.spec('Projection', () => {
11
- const googleProj = projection_1.Projection.get(geo_1.EpsgCode.Google);
12
- const nztmProj = projection_1.Projection.get(geo_1.EpsgCode.Nztm2000);
13
- ospec_1.default('should convert to 2193', () => {
1
+ import { EpsgCode } from '@basemaps/geo';
2
+ import { round } from '@basemaps/test/build/rounding.js';
3
+ import { bboxToPolygon } from '@linzjs/geojson';
4
+ import o from 'ospec';
5
+ import { Projection } from '../projection.js';
6
+ import { qkToNamedBounds } from './test.util.js';
7
+ o.spec('Projection', () => {
8
+ const googleProj = Projection.get(EpsgCode.Google);
9
+ const nztmProj = Projection.get(EpsgCode.Nztm2000);
10
+ o('should convert to 2193', () => {
14
11
  if (nztmProj == null) {
15
12
  throw new Error('Failed to init proj:2193');
16
13
  }
17
14
  const output = nztmProj.toWgs84([1180000, 4758000]);
18
- ospec_1.default(rounding_1.round(output, 6)).deepEquals([167.454458, -47.197075]);
15
+ o(round(output, 6)).deepEquals([167.454458, -47.197075]);
19
16
  const reverse = nztmProj.fromWgs84(output);
20
- ospec_1.default(rounding_1.round(reverse, 2)).deepEquals([1180000, 4758000]);
17
+ o(round(reverse, 2)).deepEquals([1180000, 4758000]);
21
18
  });
22
- ospec_1.default('toGeoJson', () => {
23
- const geojson = googleProj.toGeoJson(test_util_1.qkToNamedBounds(['31', '33']));
19
+ o('toGeoJson', () => {
20
+ const geojson = googleProj.toGeoJson(qkToNamedBounds(['31', '33']));
24
21
  const { features } = geojson;
25
- ospec_1.default(features.length).equals(2);
26
- ospec_1.default(features[0].properties).deepEquals({ name: '2-3-2' });
27
- ospec_1.default(features[1].properties).deepEquals({ name: '2-3-3' });
22
+ o(features.length).equals(2);
23
+ o(features[0].properties).deepEquals({ name: '2-3-2' });
24
+ o(features[1].properties).deepEquals({ name: '2-3-3' });
28
25
  const { geometry } = features[0];
29
26
  const coords = geometry.type === 'Polygon' ? geometry.coordinates : null;
30
- ospec_1.default(rounding_1.round(coords[0], 8)).deepEquals([
27
+ o(round(coords[0], 8)).deepEquals([
31
28
  [90, -66.51326044],
32
29
  [90, 0],
33
30
  [180, 0],
@@ -35,15 +32,15 @@ ospec_1.default.spec('Projection', () => {
35
32
  [90, -66.51326044],
36
33
  ]);
37
34
  });
38
- ospec_1.default.spec('boundsToGeoJsonFeature', () => {
39
- ospec_1.default('simple', () => {
40
- const ans = rounding_1.round(googleProj.boundsToGeoJsonFeature({
35
+ o.spec('boundsToGeoJsonFeature', () => {
36
+ o('simple', () => {
37
+ const ans = round(googleProj.boundsToGeoJsonFeature({
41
38
  x: -19929885.00696367,
42
39
  y: 19871181.369240656,
43
40
  width: 48921.969810251147,
44
41
  height: 4891.969810251147,
45
42
  }, { name: '13-22-33' }));
46
- ospec_1.default(ans).deepEquals({
43
+ o(ans).deepEquals({
47
44
  type: 'Feature',
48
45
  geometry: {
49
46
  type: 'Polygon',
@@ -61,9 +58,9 @@ ospec_1.default.spec('Projection', () => {
61
58
  bbox: [-179.03320312, 84.92054529, -178.59372959, 84.92443459],
62
59
  });
63
60
  });
64
- ospec_1.default('crosses antimeridian', () => {
65
- const ans = rounding_1.round(nztmProj.boundsToGeoJsonFeature({ x: 1293760, y: 5412480, width: 1246880, height: 1146880 }, { name: '1-2-1' }), 4);
66
- ospec_1.default(ans).deepEquals({
61
+ o('crosses antimeridian', () => {
62
+ const ans = round(nztmProj.boundsToGeoJsonFeature({ x: 1293760, y: 5412480, width: 1246880, height: 1146880 }, { name: '1-2-1' }), 4);
63
+ o(ans).deepEquals({
67
64
  type: 'Feature',
68
65
  geometry: {
69
66
  type: 'MultiPolygon',
@@ -93,11 +90,11 @@ ospec_1.default.spec('Projection', () => {
93
90
  });
94
91
  });
95
92
  });
96
- ospec_1.default('projectMultipolygon', () => {
97
- const poly = [geojson_1.bboxToPolygon([18494091.86765497, -6051366.655280836, 19986142.659781612, -4016307.214216303])];
98
- ospec_1.default(googleProj.projectMultipolygon(poly, googleProj)).equals(poly);
99
- const ans = rounding_1.round(googleProj.projectMultipolygon(poly, nztmProj), 4);
100
- ospec_1.default(rounding_1.round(ans, 4)).deepEquals([
93
+ o('projectMultipolygon', () => {
94
+ const poly = [bboxToPolygon([18494091.86765497, -6051366.655280836, 19986142.659781612, -4016307.214216303])];
95
+ o(googleProj.projectMultipolygon(poly, googleProj)).equals(poly);
96
+ const ans = round(googleProj.projectMultipolygon(poly, nztmProj), 4);
97
+ o(round(ans, 4)).deepEquals([
101
98
  [
102
99
  [
103
100
  [1084733.8967, 4698018.9435],
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const geo_1 = require("@basemaps/geo");
5
- const test_1 = require("@basemaps/test");
6
- const rounding_1 = require("@basemaps/test/build/rounding");
7
- const ospec_1 = tslib_1.__importDefault(require("ospec"));
8
- const projection_1 = require("../projection");
1
+ import { Bounds, GoogleTms, Nztm2000QuadTms, Nztm2000Tms, QuadKey } from '@basemaps/geo';
2
+ import { Approx } from '@basemaps/test';
3
+ import { round } from '@basemaps/test/build/rounding.js';
4
+ import o from 'ospec';
5
+ import { Projection } from '../projection.js';
9
6
  const TileSize = 256;
10
7
  /**
11
8
  * Get the raster bounds for a WebMercator zoom level
@@ -14,130 +11,130 @@ const TileSize = 256;
14
11
  * @param zoom Web mercator zoom level
15
12
  */
16
13
  function getPixelsBoundsFromMeters(extent, zoom) {
17
- const upperLeftMeters = geo_1.GoogleTms.sourceToPixels(extent[0], extent[3], zoom);
18
- const lowerRightMeters = geo_1.GoogleTms.sourceToPixels(extent[2], extent[1], zoom);
19
- return geo_1.Bounds.fromUpperLeftLowerRight(upperLeftMeters, lowerRightMeters);
14
+ const upperLeftMeters = GoogleTms.sourceToPixels(extent[0], extent[3], zoom);
15
+ const lowerRightMeters = GoogleTms.sourceToPixels(extent[2], extent[1], zoom);
16
+ return Bounds.fromUpperLeftLowerRight(upperLeftMeters, lowerRightMeters);
20
17
  }
21
18
  /** Convert a XYZ tile into a screen bounding box */
22
19
  function getPixelsFromTile(x, y) {
23
- return new geo_1.Bounds(x * TileSize, y * TileSize, TileSize, TileSize);
20
+ return new Bounds(x * TileSize, y * TileSize, TileSize, TileSize);
24
21
  }
25
22
  function isValidLatLong(x) {
26
- ospec_1.default(x.lat <= 90).equals(true)(`lat: ${x.lat} <= 90`);
27
- ospec_1.default(x.lat >= -90).equals(true)(`lat: ${x.lat} >= -90`);
28
- ospec_1.default(x.lon <= 180).equals(true)(`lon: ${x.lon} <= 180`);
29
- ospec_1.default(x.lon >= -180).equals(true)(`lon: ${x.lon} >= -180`);
23
+ o(x.lat <= 90).equals(true)(`lat: ${x.lat} <= 90`);
24
+ o(x.lat >= -90).equals(true)(`lat: ${x.lat} >= -90`);
25
+ o(x.lon <= 180).equals(true)(`lon: ${x.lon} <= 180`);
26
+ o(x.lon >= -180).equals(true)(`lon: ${x.lon} >= -180`);
30
27
  }
31
- ospec_1.default.spec('ProjectionTileMatrixSet', () => {
32
- ospec_1.default('getTiffResZoom', () => {
33
- ospec_1.default(projection_1.Projection.getTiffResZoom(geo_1.GoogleTms, 10)).equals(14);
34
- ospec_1.default(projection_1.Projection.getTiffResZoom(geo_1.GoogleTms, 10, 2)).equals(13);
35
- ospec_1.default(projection_1.Projection.getTiffResZoom(geo_1.GoogleTms, 0.075)).equals(21);
36
- ospec_1.default(projection_1.Projection.getTiffResZoom(geo_1.Nztm2000Tms, 10)).equals(10);
37
- ospec_1.default(projection_1.Projection.getTiffResZoom(geo_1.Nztm2000Tms, 10, 2)).equals(9);
38
- ospec_1.default(projection_1.Projection.getTiffResZoom(geo_1.Nztm2000Tms, 0.075)).equals(16);
28
+ o.spec('ProjectionTileMatrixSet', () => {
29
+ o('getTiffResZoom', () => {
30
+ o(Projection.getTiffResZoom(GoogleTms, 10)).equals(14);
31
+ o(Projection.getTiffResZoom(GoogleTms, 10, 2)).equals(13);
32
+ o(Projection.getTiffResZoom(GoogleTms, 0.075)).equals(21);
33
+ o(Projection.getTiffResZoom(Nztm2000Tms, 10)).equals(10);
34
+ o(Projection.getTiffResZoom(Nztm2000Tms, 10, 2)).equals(9);
35
+ o(Projection.getTiffResZoom(Nztm2000Tms, 0.075)).equals(16);
39
36
  });
40
- ospec_1.default('getTileSize', async () => {
41
- ospec_1.default(projection_1.Projection.getImagePixelWidth(geo_1.GoogleTms, { x: 0, y: 0, z: 5 }, 10)).equals(16384);
42
- ospec_1.default(projection_1.Projection.getImagePixelWidth(geo_1.GoogleTms, { x: 0, y: 0, z: 13 }, 20)).equals(65536);
43
- ospec_1.default(projection_1.Projection.getImagePixelWidth(geo_1.Nztm2000Tms, { x: 0, y: 0, z: 5 }, 10)).equals(20480);
44
- ospec_1.default(projection_1.Projection.getImagePixelWidth(geo_1.Nztm2000Tms, { x: 0, y: 0, z: 13 }, 16)).equals(5120);
37
+ o('getTileSize', async () => {
38
+ o(Projection.getImagePixelWidth(GoogleTms, { x: 0, y: 0, z: 5 }, 10)).equals(16384);
39
+ o(Projection.getImagePixelWidth(GoogleTms, { x: 0, y: 0, z: 13 }, 20)).equals(65536);
40
+ o(Projection.getImagePixelWidth(Nztm2000Tms, { x: 0, y: 0, z: 5 }, 10)).equals(20480);
41
+ o(Projection.getImagePixelWidth(Nztm2000Tms, { x: 0, y: 0, z: 13 }, 16)).equals(5120);
45
42
  });
46
- ospec_1.default('findAlignmentLevels', () => {
47
- ospec_1.default(projection_1.Projection.findAlignmentLevels(geo_1.GoogleTms, { x: 2, y: 0, z: 5 }, 0.075)).equals(15);
48
- ospec_1.default(projection_1.Projection.findAlignmentLevels(geo_1.GoogleTms, { x: 2, y: 0, z: 5 }, 0.5)).equals(13);
49
- ospec_1.default(projection_1.Projection.findAlignmentLevels(geo_1.GoogleTms, { x: 2, y: 0, z: 3 }, 1)).equals(14);
50
- ospec_1.default(projection_1.Projection.findAlignmentLevels(geo_1.GoogleTms, { x: 2, y: 0, z: 8 }, 10)).equals(5);
51
- ospec_1.default(projection_1.Projection.findAlignmentLevels(geo_1.GoogleTms, { x: 2, y: 0, z: 14 }, 10)).equals(0);
52
- ospec_1.default(projection_1.Projection.findAlignmentLevels(geo_1.Nztm2000Tms, { x: 2, y: 0, z: 1 }, 0.075)).equals(14);
53
- ospec_1.default(projection_1.Projection.findAlignmentLevels(geo_1.Nztm2000Tms, { x: 2, y: 0, z: 5 }, 0.5)).equals(8);
54
- ospec_1.default(projection_1.Projection.findAlignmentLevels(geo_1.Nztm2000Tms, { x: 2, y: 0, z: 3 }, 7)).equals(6);
55
- ospec_1.default(projection_1.Projection.findAlignmentLevels(geo_1.Nztm2000Tms, { x: 2, y: 0, z: 8 }, 14)).equals(0);
43
+ o('findAlignmentLevels', () => {
44
+ o(Projection.findAlignmentLevels(GoogleTms, { x: 2, y: 0, z: 5 }, 0.075)).equals(15);
45
+ o(Projection.findAlignmentLevels(GoogleTms, { x: 2, y: 0, z: 5 }, 0.5)).equals(13);
46
+ o(Projection.findAlignmentLevels(GoogleTms, { x: 2, y: 0, z: 3 }, 1)).equals(14);
47
+ o(Projection.findAlignmentLevels(GoogleTms, { x: 2, y: 0, z: 8 }, 10)).equals(5);
48
+ o(Projection.findAlignmentLevels(GoogleTms, { x: 2, y: 0, z: 14 }, 10)).equals(0);
49
+ o(Projection.findAlignmentLevels(Nztm2000Tms, { x: 2, y: 0, z: 1 }, 0.075)).equals(14);
50
+ o(Projection.findAlignmentLevels(Nztm2000Tms, { x: 2, y: 0, z: 5 }, 0.5)).equals(8);
51
+ o(Projection.findAlignmentLevels(Nztm2000Tms, { x: 2, y: 0, z: 3 }, 7)).equals(6);
52
+ o(Projection.findAlignmentLevels(Nztm2000Tms, { x: 2, y: 0, z: 8 }, 14)).equals(0);
56
53
  });
57
- ospec_1.default.spec('tileCenterToLatLon', () => {
58
- ospec_1.default('should create centers for web mercator', () => {
59
- const center = projection_1.Projection.tileCenterToLatLon(geo_1.GoogleTms, geo_1.QuadKey.toTile('3120123'));
54
+ o.spec('tileCenterToLatLon', () => {
55
+ o('should create centers for web mercator', () => {
56
+ const center = Projection.tileCenterToLatLon(GoogleTms, QuadKey.toTile('3120123'));
60
57
  isValidLatLong(center);
61
- ospec_1.default(rounding_1.round(center, 8)).deepEquals({
58
+ o(round(center, 8)).deepEquals({
62
59
  lat: -47.98992167,
63
60
  lon: 105.46875,
64
61
  });
65
62
  });
66
- ospec_1.default('should create centers for NZTM', () => {
67
- const center = projection_1.Projection.tileCenterToLatLon(geo_1.Nztm2000Tms, { x: 2295, y: 5119, z: 10 });
63
+ o('should create centers for NZTM', () => {
64
+ const center = Projection.tileCenterToLatLon(Nztm2000Tms, { x: 2295, y: 5119, z: 10 });
68
65
  isValidLatLong(center);
69
- const centerB = projection_1.Projection.tileCenterToLatLon(geo_1.Nztm2000Tms, { x: 20, y: 20, z: 10 });
66
+ const centerB = Projection.tileCenterToLatLon(Nztm2000Tms, { x: 20, y: 20, z: 10 });
70
67
  isValidLatLong(centerB);
71
68
  });
72
- ospec_1.default('should create centers for NZTMQuad', () => {
73
- const center = projection_1.Projection.tileCenterToLatLon(geo_1.Nztm2000QuadTms, { x: 200, y: 500, z: 10 });
69
+ o('should create centers for NZTMQuad', () => {
70
+ const center = Projection.tileCenterToLatLon(Nztm2000QuadTms, { x: 200, y: 500, z: 10 });
74
71
  isValidLatLong(center);
75
- ospec_1.default(rounding_1.round(center, 8)).deepEquals({ lat: -35.79628765, lon: 141.39377624 });
76
- const centerB = projection_1.Projection.tileCenterToLatLon(geo_1.Nztm2000QuadTms, { x: 1000, y: 1000, z: 10 });
72
+ o(round(center, 8)).deepEquals({ lat: -35.79628765, lon: 141.39377624 });
73
+ const centerB = Projection.tileCenterToLatLon(Nztm2000QuadTms, { x: 1000, y: 1000, z: 10 });
77
74
  isValidLatLong(centerB);
78
75
  });
79
76
  });
80
- ospec_1.default.spec('wrapLatLon', () => {
81
- ospec_1.default('should wrap longitude', () => {
82
- ospec_1.default(projection_1.Projection.wrapLatLon(0, 1)).deepEquals({ lat: 0, lon: 1 });
83
- ospec_1.default(projection_1.Projection.wrapLatLon(0, 181)).deepEquals({ lat: 0, lon: -179 });
84
- ospec_1.default(projection_1.Projection.wrapLatLon(0, 271)).deepEquals({ lat: 0, lon: -89 });
85
- ospec_1.default(projection_1.Projection.wrapLatLon(0, 361)).deepEquals({ lat: 0, lon: 1 });
86
- ospec_1.default(projection_1.Projection.wrapLatLon(0, 631)).deepEquals({ lat: 0, lon: -89 });
87
- ospec_1.default(projection_1.Projection.wrapLatLon(0, 721)).deepEquals({ lat: 0, lon: 1 });
88
- ospec_1.default(projection_1.Projection.wrapLatLon(0, -1)).deepEquals({ lat: 0, lon: -1 });
89
- ospec_1.default(projection_1.Projection.wrapLatLon(0, -181)).deepEquals({ lat: 0, lon: 179 });
90
- ospec_1.default(projection_1.Projection.wrapLatLon(0, -271)).deepEquals({ lat: 0, lon: 89 });
91
- ospec_1.default(projection_1.Projection.wrapLatLon(0, -361)).deepEquals({ lat: 0, lon: -1 });
92
- ospec_1.default(projection_1.Projection.wrapLatLon(0, -631)).deepEquals({ lat: 0, lon: 89 });
93
- ospec_1.default(projection_1.Projection.wrapLatLon(0, -721)).deepEquals({ lat: 0, lon: -1 });
77
+ o.spec('wrapLatLon', () => {
78
+ o('should wrap longitude', () => {
79
+ o(Projection.wrapLatLon(0, 1)).deepEquals({ lat: 0, lon: 1 });
80
+ o(Projection.wrapLatLon(0, 181)).deepEquals({ lat: 0, lon: -179 });
81
+ o(Projection.wrapLatLon(0, 271)).deepEquals({ lat: 0, lon: -89 });
82
+ o(Projection.wrapLatLon(0, 361)).deepEquals({ lat: 0, lon: 1 });
83
+ o(Projection.wrapLatLon(0, 631)).deepEquals({ lat: 0, lon: -89 });
84
+ o(Projection.wrapLatLon(0, 721)).deepEquals({ lat: 0, lon: 1 });
85
+ o(Projection.wrapLatLon(0, -1)).deepEquals({ lat: 0, lon: -1 });
86
+ o(Projection.wrapLatLon(0, -181)).deepEquals({ lat: 0, lon: 179 });
87
+ o(Projection.wrapLatLon(0, -271)).deepEquals({ lat: 0, lon: 89 });
88
+ o(Projection.wrapLatLon(0, -361)).deepEquals({ lat: 0, lon: -1 });
89
+ o(Projection.wrapLatLon(0, -631)).deepEquals({ lat: 0, lon: 89 });
90
+ o(Projection.wrapLatLon(0, -721)).deepEquals({ lat: 0, lon: -1 });
94
91
  });
95
- ospec_1.default('should wrap latitude', () => {
96
- ospec_1.default(projection_1.Projection.wrapLatLon(1, 0)).deepEquals({ lat: 1, lon: 0 });
97
- ospec_1.default(projection_1.Projection.wrapLatLon(91, 0)).deepEquals({ lat: 89, lon: 180 });
98
- ospec_1.default(projection_1.Projection.wrapLatLon(181, 0)).deepEquals({ lat: -1, lon: 180 });
99
- ospec_1.default(projection_1.Projection.wrapLatLon(271, 0)).deepEquals({ lat: -89, lon: 0 });
100
- ospec_1.default(projection_1.Projection.wrapLatLon(361, 0)).deepEquals({ lat: 1, lon: 0 });
101
- ospec_1.default(projection_1.Projection.wrapLatLon(631, 0)).deepEquals({ lat: -89, lon: 0 });
102
- ospec_1.default(projection_1.Projection.wrapLatLon(721, 0)).deepEquals({ lat: 1, lon: 0 });
103
- ospec_1.default(projection_1.Projection.wrapLatLon(-1, 0)).deepEquals({ lat: -1, lon: 0 });
104
- ospec_1.default(projection_1.Projection.wrapLatLon(-91, 0)).deepEquals({ lat: -89, lon: 180 });
105
- ospec_1.default(projection_1.Projection.wrapLatLon(-181, 0)).deepEquals({ lat: 1, lon: 180 });
106
- ospec_1.default(projection_1.Projection.wrapLatLon(-271, 0)).deepEquals({ lat: 89, lon: 0 });
107
- ospec_1.default(projection_1.Projection.wrapLatLon(-361, 0)).deepEquals({ lat: -1, lon: 0 });
108
- ospec_1.default(projection_1.Projection.wrapLatLon(-631, 0)).deepEquals({ lat: 89, lon: 0 });
109
- ospec_1.default(projection_1.Projection.wrapLatLon(-721, 0)).deepEquals({ lat: -1, lon: 0 });
92
+ o('should wrap latitude', () => {
93
+ o(Projection.wrapLatLon(1, 0)).deepEquals({ lat: 1, lon: 0 });
94
+ o(Projection.wrapLatLon(91, 0)).deepEquals({ lat: 89, lon: 180 });
95
+ o(Projection.wrapLatLon(181, 0)).deepEquals({ lat: -1, lon: 180 });
96
+ o(Projection.wrapLatLon(271, 0)).deepEquals({ lat: -89, lon: 0 });
97
+ o(Projection.wrapLatLon(361, 0)).deepEquals({ lat: 1, lon: 0 });
98
+ o(Projection.wrapLatLon(631, 0)).deepEquals({ lat: -89, lon: 0 });
99
+ o(Projection.wrapLatLon(721, 0)).deepEquals({ lat: 1, lon: 0 });
100
+ o(Projection.wrapLatLon(-1, 0)).deepEquals({ lat: -1, lon: 0 });
101
+ o(Projection.wrapLatLon(-91, 0)).deepEquals({ lat: -89, lon: 180 });
102
+ o(Projection.wrapLatLon(-181, 0)).deepEquals({ lat: 1, lon: 180 });
103
+ o(Projection.wrapLatLon(-271, 0)).deepEquals({ lat: 89, lon: 0 });
104
+ o(Projection.wrapLatLon(-361, 0)).deepEquals({ lat: -1, lon: 0 });
105
+ o(Projection.wrapLatLon(-631, 0)).deepEquals({ lat: 89, lon: 0 });
106
+ o(Projection.wrapLatLon(-721, 0)).deepEquals({ lat: -1, lon: 0 });
110
107
  });
111
108
  });
112
- ospec_1.default.spec('tileToWgs84Bbox', () => {
113
- ospec_1.default('should handle antimeridian', () => {
114
- const pt = projection_1.Projection.tileToWgs84Bbox(geo_1.Nztm2000Tms, { x: 2, y: 1, z: 1 });
115
- ospec_1.default(rounding_1.round(pt)).deepEquals([170.05982382, -20.71836222, -179.34441046, -10.28396555]);
109
+ o.spec('tileToWgs84Bbox', () => {
110
+ o('should handle antimeridian', () => {
111
+ const pt = Projection.tileToWgs84Bbox(Nztm2000Tms, { x: 2, y: 1, z: 1 });
112
+ o(round(pt)).deepEquals([170.05982382, -20.71836222, -179.34441046, -10.28396555]);
116
113
  });
117
- ospec_1.default('should convert base tiles', () => {
118
- const pt = projection_1.Projection.tileToWgs84Bbox(geo_1.GoogleTms, { x: 0, y: 0, z: 0 });
119
- ospec_1.default(rounding_1.round(pt)).deepEquals([-180, -85.05112878, 180, 85.05112878]);
114
+ o('should convert base tiles', () => {
115
+ const pt = Projection.tileToWgs84Bbox(GoogleTms, { x: 0, y: 0, z: 0 });
116
+ o(round(pt)).deepEquals([-180, -85.05112878, 180, 85.05112878]);
120
117
  });
121
118
  });
122
- ospec_1.default.spec('TilingBounds', () => {
119
+ o.spec('TilingBounds', () => {
123
120
  // Approximate bounding box of new zealand
124
121
  const tifBoundingBox = [18494091.86765497, -6051366.655280836, 19986142.659781612, -4016307.214216303];
125
- const expectedBaseSize = geo_1.Bounds.fromJson({ width: 9.53125, height: 13, y: 153.65625, x: 246.14062500000006 });
126
- ospec_1.default('should tile 0,0,0', () => {
122
+ const expectedBaseSize = Bounds.fromJson({ width: 9.53125, height: 13, y: 153.65625, x: 246.14062500000006 });
123
+ o('should tile 0,0,0', () => {
127
124
  const bounds = getPixelsBoundsFromMeters(tifBoundingBox, 0);
128
- test_1.Approx.bounds(bounds, expectedBaseSize);
125
+ Approx.bounds(bounds, expectedBaseSize);
129
126
  const screenBounds = getPixelsFromTile(0, 0);
130
127
  const intersection = bounds.intersection(screenBounds);
131
- test_1.Approx.bounds(intersection, expectedBaseSize);
128
+ Approx.bounds(intersection, expectedBaseSize);
132
129
  });
133
- ospec_1.default('should tile 1,1,1', () => {
130
+ o('should tile 1,1,1', () => {
134
131
  const [x, y, z] = [1, 1, 1];
135
132
  const bounds = getPixelsBoundsFromMeters(tifBoundingBox, z);
136
133
  const expectedBaseSizeScaled = expectedBaseSize.scale(2, 2);
137
- test_1.Approx.bounds(bounds, expectedBaseSizeScaled);
134
+ Approx.bounds(bounds, expectedBaseSizeScaled);
138
135
  const screenBounds = getPixelsFromTile(x, y);
139
136
  const intersection = bounds.intersection(screenBounds);
140
- test_1.Approx.bounds(intersection, expectedBaseSizeScaled);
137
+ Approx.bounds(intersection, expectedBaseSizeScaled);
141
138
  });
142
139
  /**
143
140
  * XYZ tiles 15,9,4 & 15,10,4 provide a top/bottom tiles for this bounding box
@@ -149,15 +146,15 @@ ospec_1.default.spec('ProjectionTileMatrixSet', () => {
149
146
  * | XXX | 10
150
147
  * |-------|
151
148
  */
152
- ospec_1.default('should tile [15, 9, 4] & [15, 10, 4]', () => {
149
+ o('should tile [15, 9, 4] & [15, 10, 4]', () => {
153
150
  const [x, z] = [15, 4];
154
151
  const bounds = getPixelsBoundsFromMeters(tifBoundingBox, z);
155
152
  const expectedBaseSizeScaled = expectedBaseSize.scale(2 ** z, 2 ** z);
156
- test_1.Approx.bounds(bounds, expectedBaseSizeScaled);
153
+ Approx.bounds(bounds, expectedBaseSizeScaled);
157
154
  const screenBounds9 = getPixelsFromTile(x, 9);
158
155
  const screenBounds10 = getPixelsFromTile(x, 10);
159
- ospec_1.default(screenBounds9.toJson()).deepEquals({ width: 256, height: 256, y: 2304, x: 3840 });
160
- ospec_1.default(screenBounds10.toJson()).deepEquals({ width: 256, height: 256, y: 2560, x: 3840 });
156
+ o(screenBounds9.toJson()).deepEquals({ width: 256, height: 256, y: 2304, x: 3840 });
157
+ o(screenBounds10.toJson()).deepEquals({ width: 256, height: 256, y: 2560, x: 3840 });
161
158
  const intersection9 = bounds.intersection(screenBounds9);
162
159
  const intersection10 = bounds.intersection(screenBounds10);
163
160
  if (intersection9 == null || intersection10 == null) {
@@ -165,12 +162,12 @@ ospec_1.default.spec('ProjectionTileMatrixSet', () => {
165
162
  }
166
163
  // the image is split in two so the intersection should combine into the total height of the image
167
164
  const totalIntersectionHeight = intersection9.height + intersection10.height;
168
- ospec_1.default(totalIntersectionHeight).equals(bounds.height);
165
+ o(totalIntersectionHeight).equals(bounds.height);
169
166
  // The image is not split horizontally so the width should be the same for both intersections
170
- ospec_1.default(intersection9.width).equals(bounds.width);
171
- ospec_1.default(intersection10.width).equals(bounds.width);
172
- test_1.Approx.equal(intersection9.height, 101.5, 'height');
173
- test_1.Approx.equal(intersection10.height, 106.5, 'height');
167
+ o(intersection9.width).equals(bounds.width);
168
+ o(intersection10.width).equals(bounds.width);
169
+ Approx.equal(intersection9.height, 101.5, 'height');
170
+ Approx.equal(intersection10.height, 106.5, 'height');
174
171
  });
175
172
  /**
176
173
  * XYZ tiles [30, 19, 5], [31, 19, 5], [30, 20, 5], [31, 20, 5]
@@ -183,16 +180,16 @@ ospec_1.default.spec('ProjectionTileMatrixSet', () => {
183
180
  * | XXXXX|XXXX | 20
184
181
  * |-------|-------|
185
182
  */
186
- ospec_1.default('should tile [30, 19, 5], [31, 19, 5], [30, 20, 5], [31, 20, 5]', () => {
183
+ o('should tile [30, 19, 5], [31, 19, 5], [30, 20, 5], [31, 20, 5]', () => {
187
184
  const z = 5;
188
- const tileBounds = new geo_1.Bounds(30, 19, 1, 1);
185
+ const tileBounds = new Bounds(30, 19, 1, 1);
189
186
  const bounds = getPixelsBoundsFromMeters(tifBoundingBox, z);
190
187
  const expectedBaseSizeScaled = expectedBaseSize.scale(2 ** z, 2 ** z);
191
- test_1.Approx.bounds(bounds, expectedBaseSizeScaled);
188
+ Approx.bounds(bounds, expectedBaseSizeScaled);
192
189
  const screenTopLeft = getPixelsFromTile(tileBounds.x, tileBounds.y);
193
190
  const screenTopRight = getPixelsFromTile(tileBounds.right, tileBounds.y);
194
- ospec_1.default(screenTopLeft.toJson()).deepEquals({ width: 256, height: 256, y: 4864, x: 7680 });
195
- ospec_1.default(screenTopRight.toJson()).deepEquals({ width: 256, height: 256, y: 4864, x: 7936 });
191
+ o(screenTopLeft.toJson()).deepEquals({ width: 256, height: 256, y: 4864, x: 7680 });
192
+ o(screenTopRight.toJson()).deepEquals({ width: 256, height: 256, y: 4864, x: 7936 });
196
193
  const intersectionTopLeft = bounds.intersection(screenTopLeft);
197
194
  const intersectionTopRight = bounds.intersection(screenTopRight);
198
195
  if (intersectionTopLeft == null || intersectionTopRight == null) {
@@ -200,13 +197,13 @@ ospec_1.default.spec('ProjectionTileMatrixSet', () => {
200
197
  }
201
198
  // the image is split in two so the intersection should combine into the total width of the image
202
199
  const totalTopIntersectionWidth = intersectionTopLeft.width + intersectionTopRight.width;
203
- ospec_1.default(totalTopIntersectionWidth).equals(bounds.width);
204
- ospec_1.default(intersectionTopLeft.height).equals(203);
205
- ospec_1.default(intersectionTopRight.height).equals(203);
200
+ o(totalTopIntersectionWidth).equals(bounds.width);
201
+ o(intersectionTopLeft.height).equals(203);
202
+ o(intersectionTopRight.height).equals(203);
206
203
  const screenBottomLeft = getPixelsFromTile(tileBounds.x, tileBounds.bottom);
207
204
  const screenBottomRight = getPixelsFromTile(tileBounds.right, tileBounds.bottom);
208
- ospec_1.default(screenBottomLeft.toJson()).deepEquals({ width: 256, height: 256, y: 5120, x: 7680 });
209
- ospec_1.default(screenBottomRight.toJson()).deepEquals({ width: 256, height: 256, y: 5120, x: 7936 });
205
+ o(screenBottomLeft.toJson()).deepEquals({ width: 256, height: 256, y: 5120, x: 7680 });
206
+ o(screenBottomRight.toJson()).deepEquals({ width: 256, height: 256, y: 5120, x: 7936 });
210
207
  const intersectionBottomLeft = bounds.intersection(screenBottomLeft);
211
208
  const intersectionBottomRight = bounds.intersection(screenBottomRight);
212
209
  if (intersectionBottomLeft == null || intersectionBottomRight == null) {
@@ -214,13 +211,13 @@ ospec_1.default.spec('ProjectionTileMatrixSet', () => {
214
211
  }
215
212
  // the image is split in two so the intersection should combine into the total width of the image
216
213
  const totalBottomIntersectionWidth = intersectionBottomLeft.width + intersectionBottomRight.width;
217
- ospec_1.default(totalBottomIntersectionWidth).equals(bounds.width);
218
- test_1.Approx.equal(intersectionBottomLeft.height, 213, 'height');
219
- test_1.Approx.equal(intersectionBottomRight.height, 213, 'height');
214
+ o(totalBottomIntersectionWidth).equals(bounds.width);
215
+ Approx.equal(intersectionBottomLeft.height, 213, 'height');
216
+ Approx.equal(intersectionBottomRight.height, 213, 'height');
220
217
  const totalLeftIntersectionHeight = intersectionTopLeft.height + intersectionBottomLeft.height;
221
218
  const totalRightIntersectionHeight = intersectionTopRight.height + intersectionBottomRight.height;
222
- ospec_1.default(totalLeftIntersectionHeight).equals(bounds.height);
223
- ospec_1.default(totalRightIntersectionHeight).equals(bounds.height);
219
+ o(totalLeftIntersectionHeight).equals(bounds.height);
220
+ o(totalRightIntersectionHeight).equals(bounds.height);
224
221
  });
225
222
  });
226
223
  });
@@ -1 +1 @@
1
- {"version":3,"file":"test.util.d.ts","sourceRoot":"","sources":["../../../src/proj/__test__/test.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,IAAI,EAAkB,WAAW,EAAE,MAAM,eAAe,CAAC;AAEpG,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,CAGjE;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,gBAAsC,GAAG,WAAW,EAAE,CAEpH;AAED,wBAAgB,YAAY,CACxB,WAAW,EAAE,IAAI,EACjB,MAAM,EAAE,MAAM,EACd,MAAM,SAAI,EACV,GAAG,gBAAsC,GAC1C,WAAW,EAAE,CAef"}
1
+ {"version":3,"file":"test.util.d.ts","sourceRoot":"","sources":["../../../src/proj/__test__/test.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,IAAI,EAAkB,WAAW,EAAE,MAAM,eAAe,CAAC;AAEpG,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,CAGjE;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,gBAAsC,GAAG,WAAW,EAAE,CAEpH;AAED,wBAAgB,YAAY,CAC1B,WAAW,EAAE,IAAI,EACjB,MAAM,EAAE,MAAM,EACd,MAAM,SAAI,EACV,GAAG,gBAAsC,GACxC,WAAW,EAAE,CAef"}
@@ -1,21 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.genTileNames = exports.tileNamesToNamedBounds = exports.qkToNamedBounds = exports.qkToName = void 0;
4
- const geo_1 = require("@basemaps/geo");
5
- function qkToName(qk) {
6
- return geo_1.TileMatrixSet.tileToName(geo_1.QuadKey.toTile(qk));
1
+ import { EpsgCode, QuadKey, TileMatrixSet, TileMatrixSets } from '@basemaps/geo';
2
+ export function qkToName(qk) {
3
+ return TileMatrixSet.tileToName(QuadKey.toTile(qk));
7
4
  }
8
- exports.qkToName = qkToName;
9
- function qkToNamedBounds(quadKeys) {
10
- const tms = geo_1.TileMatrixSets.get(geo_1.EpsgCode.Google);
11
- return quadKeys.map((qk) => ({ name: qkToName(qk), ...tms.tileToSourceBounds(geo_1.QuadKey.toTile(qk)) }));
5
+ export function qkToNamedBounds(quadKeys) {
6
+ const tms = TileMatrixSets.get(EpsgCode.Google);
7
+ return quadKeys.map((qk) => ({ name: qkToName(qk), ...tms.tileToSourceBounds(QuadKey.toTile(qk)) }));
12
8
  }
13
- exports.qkToNamedBounds = qkToNamedBounds;
14
- function tileNamesToNamedBounds(tileNames, tms = geo_1.TileMatrixSets.get(geo_1.EpsgCode.Google)) {
15
- return tileNames.map((name) => ({ name, ...tms.tileToSourceBounds(geo_1.TileMatrixSet.nameToTile(name)) }));
9
+ export function tileNamesToNamedBounds(tileNames, tms = TileMatrixSets.get(EpsgCode.Google)) {
10
+ return tileNames.map((name) => ({ name, ...tms.tileToSourceBounds(TileMatrixSet.nameToTile(name)) }));
16
11
  }
17
- exports.tileNamesToNamedBounds = tileNamesToNamedBounds;
18
- function genTileNames(topLeftTile, xTotal, yTotal = 1, tms = geo_1.TileMatrixSets.get(geo_1.EpsgCode.Google)) {
12
+ export function genTileNames(topLeftTile, xTotal, yTotal = 1, tms = TileMatrixSets.get(EpsgCode.Google)) {
19
13
  const bounds = [];
20
14
  yTotal += topLeftTile.y;
21
15
  xTotal += topLeftTile.x;
@@ -24,9 +18,8 @@ function genTileNames(topLeftTile, xTotal, yTotal = 1, tms = geo_1.TileMatrixSet
24
18
  tile.y = y;
25
19
  for (let x = topLeftTile.x; x < xTotal; ++x) {
26
20
  tile.x = x;
27
- bounds.push({ name: geo_1.TileMatrixSet.tileToName(tile), ...tms.tileToSourceBounds(tile) });
21
+ bounds.push({ name: TileMatrixSet.tileToName(tile), ...tms.tileToSourceBounds(tile) });
28
22
  }
29
23
  }
30
24
  return bounds;
31
25
  }
32
- exports.genTileNames = genTileNames;
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Citm2000 = void 0;
4
1
  /**
5
2
  * Well known text for NZGD2000 / Chatham Islands TM 2000
6
3
  *
7
4
  * @see https://epsg.io/3793
8
5
  */
9
- exports.Citm2000 = `PROJCS["NZGD2000 / Chatham Islands TM 2000",
6
+ export const Citm2000 = `PROJCS["NZGD2000 / Chatham Islands TM 2000",
10
7
  GEOGCS["NZGD2000",
11
8
  DATUM["New_Zealand_Geodetic_Datum_2000",
12
9
  SPHEROID["GRS 1980",6378137,298.257222101,
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Nztm2000 = void 0;
4
1
  /**
5
2
  * Well known text for NZGD2000
6
3
  *
7
4
  * @see https://epsg.io/2193
8
5
  */
9
- exports.Nztm2000 = `PROJCS["NZGD2000 / New Zealand Transverse Mercator 2000",
6
+ export const Nztm2000 = `PROJCS["NZGD2000 / New Zealand Transverse Mercator 2000",
10
7
  GEOGCS["NZGD2000",
11
8
  DATUM["New_Zealand_Geodetic_Datum_2000",
12
9
  SPHEROID["GRS 1980",6378137,298.257222101,