@map-colonies/mc-utils 3.1.0 → 3.2.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/README.md +67 -67
- package/dist/arrays/index.d.ts +1 -1
- package/dist/arrays/index.js +17 -17
- package/dist/arrays/subGroups.d.ts +8 -8
- package/dist/arrays/subGroups.js +33 -33
- package/dist/communication/http/httpClient.d.ts +29 -29
- package/dist/communication/http/httpClient.d.ts.map +1 -1
- package/dist/communication/http/httpClient.js +329 -317
- package/dist/communication/http/httpClient.js.map +1 -1
- package/dist/communication/http/index.d.ts +1 -1
- package/dist/communication/http/index.js +17 -17
- package/dist/communication/index.d.ts +1 -1
- package/dist/communication/index.js +17 -17
- package/dist/dateTime/getUTCDate.d.ts +1 -1
- package/dist/dateTime/getUTCDate.js +10 -10
- package/dist/dateTime/index.d.ts +1 -1
- package/dist/dateTime/index.js +17 -17
- package/dist/geo/bboxUtils.d.ts +23 -23
- package/dist/geo/bboxUtils.js +89 -89
- package/dist/geo/geoConvertor.d.ts +18 -18
- package/dist/geo/geoConvertor.js +49 -49
- package/dist/geo/geoHash.d.ts +24 -24
- package/dist/geo/geoHash.js +134 -134
- package/dist/geo/geoIntersection.d.ts +19 -19
- package/dist/geo/geoIntersection.js +70 -70
- package/dist/geo/index.d.ts +8 -8
- package/dist/geo/index.js +24 -24
- package/dist/geo/tileBatcher.d.ts +8 -8
- package/dist/geo/tileBatcher.js +97 -97
- package/dist/geo/tileRanger.d.ts +46 -46
- package/dist/geo/tileRanger.js +232 -232
- package/dist/geo/tiles.d.ts +82 -82
- package/dist/geo/tiles.js +219 -219
- package/dist/geo/tilesGenerator.d.ts +2 -2
- package/dist/geo/tilesGenerator.js +17 -17
- package/dist/index.d.ts +6 -6
- package/dist/index.js +22 -22
- package/dist/models/enums/gdal/dataType.d.ts +16 -16
- package/dist/models/enums/gdal/dataType.js +20 -20
- package/dist/models/enums/gdal/index.d.ts +2 -2
- package/dist/models/enums/gdal/index.js +18 -18
- package/dist/models/enums/gdal/resamplingMethod.d.ts +16 -16
- package/dist/models/enums/gdal/resamplingMethod.js +20 -20
- package/dist/models/enums/geo/index.d.ts +1 -1
- package/dist/models/enums/geo/index.js +17 -17
- package/dist/models/enums/geo/tileOrigin.d.ts +7 -7
- package/dist/models/enums/geo/tileOrigin.js +11 -11
- package/dist/models/enums/index.d.ts +2 -2
- package/dist/models/enums/index.js +18 -18
- package/dist/models/index.d.ts +2 -2
- package/dist/models/index.js +18 -18
- package/dist/models/interfaces/geo/iPoint.d.ts +7 -7
- package/dist/models/interfaces/geo/iPoint.js +2 -2
- package/dist/models/interfaces/geo/iTile.d.ts +15 -15
- package/dist/models/interfaces/geo/iTile.js +2 -2
- package/dist/models/interfaces/geo/index.d.ts +2 -2
- package/dist/models/interfaces/geo/index.js +18 -18
- package/dist/models/interfaces/index.d.ts +1 -1
- package/dist/models/interfaces/index.js +17 -17
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +17 -17
- package/dist/utils/timeout.d.ts +4 -4
- package/dist/utils/timeout.js +22 -22
- package/package.json +79 -79
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpClient.js","sourceRoot":"","sources":["../../../src/communication/http/httpClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAoG;AACpG,0EAA2C;AAC3C,2DAA8E;AAC9E,mCAA6C;AAC7C,
|
|
1
|
+
{"version":3,"file":"httpClient.js","sourceRoot":"","sources":["../../../src/communication/http/httpClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAoG;AACpG,0EAA2C;AAC3C,2DAA8E;AAC9E,mCAA6C;AAC7C,2DASmC;AAWnC,MAAsB,UAAU;IAKT;IACT;IACS;IACT;IACS;IARX,YAAY,GAAuB,EAAE,CAAC;IAC/B,WAAW,CAAgB;IAE5C,YACqB,MAAc,EACvB,OAAe,EACN,gBAAgB,EAA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CAAC;QACvC,IAAI,MAAM,CAAC,KAAK,KAAK,aAAa,EAAE;YAClC,KAAK,GAAG,8BAAgB,CAAC;SAC1B;aAAM,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,EAAE;YAC3C,KAAK,GAAG,GAAW,EAAE;gBACnB,OAAO,MAAM,CAAC,KAAe,CAAC;YAChC,CAAC,CAAC;SACH;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;SACvF;QACD,OAAO;YACL,OAAO,EAAE,OAAO;YAChB,UAAU,EAAE,KAAK;YACjB,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;SAC9C,CAAC;IACJ,CAAC;CACF;AAvVD,gCAuVC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './httpClient';
|
|
1
|
+
export * from './httpClient';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./httpClient"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./httpClient"), exports);
|
|
18
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './http';
|
|
1
|
+
export * from './http';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./http"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./http"), exports);
|
|
18
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const getUTCDate: () => Date;
|
|
1
|
+
export declare const getUTCDate: () => Date;
|
|
2
2
|
//# sourceMappingURL=getUTCDate.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getUTCDate = void 0;
|
|
4
|
-
const getUTCDate = () => {
|
|
5
|
-
const date = new Date();
|
|
6
|
-
const nowUtc = Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());
|
|
7
|
-
const utcDate = new Date(nowUtc);
|
|
8
|
-
return utcDate;
|
|
9
|
-
};
|
|
10
|
-
exports.getUTCDate = getUTCDate;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUTCDate = void 0;
|
|
4
|
+
const getUTCDate = () => {
|
|
5
|
+
const date = new Date();
|
|
6
|
+
const nowUtc = Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());
|
|
7
|
+
const utcDate = new Date(nowUtc);
|
|
8
|
+
return utcDate;
|
|
9
|
+
};
|
|
10
|
+
exports.getUTCDate = getUTCDate;
|
|
11
11
|
//# sourceMappingURL=getUTCDate.js.map
|
package/dist/dateTime/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './getUTCDate';
|
|
1
|
+
export * from './getUTCDate';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/dateTime/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./getUTCDate"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./getUTCDate"), exports);
|
|
18
18
|
//# sourceMappingURL=index.js.map
|
package/dist/geo/bboxUtils.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { BBox2d } from '@turf/helpers/dist/js/lib/geojson';
|
|
2
|
-
import { ITile, ITileRange } from '../models/interfaces/geo/iTile';
|
|
3
|
-
/**
|
|
4
|
-
* rounds bbox to grid
|
|
5
|
-
* @param bbox original bbox
|
|
6
|
-
* @param zoomLevel target tiles grid zoom level
|
|
7
|
-
* @returns bbox that contains the original bbox and match tile grid lines
|
|
8
|
-
*/
|
|
9
|
-
export declare const snapBBoxToTileGrid: (bbox: BBox2d, zoomLevel: number) => BBox2d;
|
|
10
|
-
/**
|
|
11
|
-
* create bbox from tile grid coordinates
|
|
12
|
-
* @param minTile corner tile for bbox with minimal x,y values
|
|
13
|
-
* @param maxTile corner tile for bbox with maximal x,y values
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
16
|
-
export declare const bboxFromTiles: (minTile: ITile, maxTile: ITile) => BBox2d;
|
|
17
|
-
/**
|
|
18
|
-
* coverts bbox to covering tile range of specified zoom level
|
|
19
|
-
* @param bbox
|
|
20
|
-
* @param zoom target zoom level
|
|
21
|
-
* @returns covering tile range
|
|
22
|
-
*/
|
|
23
|
-
export declare const bboxToTileRange: (bbox: BBox2d, zoom: number) => ITileRange;
|
|
1
|
+
import { BBox2d } from '@turf/helpers/dist/js/lib/geojson';
|
|
2
|
+
import { ITile, ITileRange } from '../models/interfaces/geo/iTile';
|
|
3
|
+
/**
|
|
4
|
+
* rounds bbox to grid
|
|
5
|
+
* @param bbox original bbox
|
|
6
|
+
* @param zoomLevel target tiles grid zoom level
|
|
7
|
+
* @returns bbox that contains the original bbox and match tile grid lines
|
|
8
|
+
*/
|
|
9
|
+
export declare const snapBBoxToTileGrid: (bbox: BBox2d, zoomLevel: number) => BBox2d;
|
|
10
|
+
/**
|
|
11
|
+
* create bbox from tile grid coordinates
|
|
12
|
+
* @param minTile corner tile for bbox with minimal x,y values
|
|
13
|
+
* @param maxTile corner tile for bbox with maximal x,y values
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
export declare const bboxFromTiles: (minTile: ITile, maxTile: ITile) => BBox2d;
|
|
17
|
+
/**
|
|
18
|
+
* coverts bbox to covering tile range of specified zoom level
|
|
19
|
+
* @param bbox
|
|
20
|
+
* @param zoom target zoom level
|
|
21
|
+
* @returns covering tile range
|
|
22
|
+
*/
|
|
23
|
+
export declare const bboxToTileRange: (bbox: BBox2d, zoom: number) => ITileRange;
|
|
24
24
|
//# sourceMappingURL=bboxUtils.d.ts.map
|
package/dist/geo/bboxUtils.js
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.bboxToTileRange = exports.bboxFromTiles = exports.snapBBoxToTileGrid = void 0;
|
|
4
|
-
const geoConvertor_1 = require("./geoConvertor");
|
|
5
|
-
const tiles_1 = require("./tiles");
|
|
6
|
-
const snapMinCordToTileGrid = (cord, tileRes) => {
|
|
7
|
-
const newCord = Math.floor(cord / tileRes) * tileRes;
|
|
8
|
-
return newCord;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* rounds bbox to grid
|
|
12
|
-
* @param bbox original bbox
|
|
13
|
-
* @param zoomLevel target tiles grid zoom level
|
|
14
|
-
* @returns bbox that contains the original bbox and match tile grid lines
|
|
15
|
-
*/
|
|
16
|
-
const snapBBoxToTileGrid = (bbox, zoomLevel) => {
|
|
17
|
-
const minLon = Math.min(bbox[0], bbox[2]);
|
|
18
|
-
const minLat = Math.min(bbox[1], bbox[3]);
|
|
19
|
-
const maxLon = Math.max(bbox[0], bbox[2]);
|
|
20
|
-
const maxLat = Math.max(bbox[1], bbox[3]);
|
|
21
|
-
const tileRes = (0, tiles_1.degreesPerTile)(zoomLevel);
|
|
22
|
-
const snappedMinLon = snapMinCordToTileGrid(minLon, tileRes);
|
|
23
|
-
let snappedMaxLon = snapMinCordToTileGrid(maxLon, tileRes);
|
|
24
|
-
if (snappedMaxLon != maxLon) {
|
|
25
|
-
snappedMaxLon += tileRes;
|
|
26
|
-
}
|
|
27
|
-
let sanppedMinLat;
|
|
28
|
-
let snappedMaxLat;
|
|
29
|
-
if (zoomLevel === 0) {
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
31
|
-
sanppedMinLat = -90;
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
33
|
-
snappedMaxLat = 90;
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
sanppedMinLat = snapMinCordToTileGrid(minLat, tileRes);
|
|
37
|
-
snappedMaxLat = snapMinCordToTileGrid(maxLat, tileRes);
|
|
38
|
-
if (snappedMaxLat != maxLat) {
|
|
39
|
-
snappedMaxLat += tileRes;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
const snappedBbox = [snappedMinLon, sanppedMinLat, snappedMaxLon, snappedMaxLat];
|
|
43
|
-
return snappedBbox;
|
|
44
|
-
};
|
|
45
|
-
exports.snapBBoxToTileGrid = snapBBoxToTileGrid;
|
|
46
|
-
/**
|
|
47
|
-
* create bbox from tile grid coordinates
|
|
48
|
-
* @param minTile corner tile for bbox with minimal x,y values
|
|
49
|
-
* @param maxTile corner tile for bbox with maximal x,y values
|
|
50
|
-
* @returns
|
|
51
|
-
*/
|
|
52
|
-
const bboxFromTiles = (minTile, maxTile) => {
|
|
53
|
-
if (minTile.zoom !== maxTile.zoom) {
|
|
54
|
-
throw new Error(`Could not calcualte bbox from tiles due to not matching zoom levels`);
|
|
55
|
-
}
|
|
56
|
-
const minPoint = (0, geoConvertor_1.tileToDegrees)(minTile);
|
|
57
|
-
const maxPoint = (0, geoConvertor_1.tileToDegrees)({
|
|
58
|
-
x: maxTile.x + 1,
|
|
59
|
-
y: maxTile.y + 1,
|
|
60
|
-
zoom: maxTile.zoom,
|
|
61
|
-
});
|
|
62
|
-
return [minPoint.longitude, minPoint.latitude, maxPoint.longitude, maxPoint.latitude];
|
|
63
|
-
};
|
|
64
|
-
exports.bboxFromTiles = bboxFromTiles;
|
|
65
|
-
/**
|
|
66
|
-
* coverts bbox to covering tile range of specified zoom level
|
|
67
|
-
* @param bbox
|
|
68
|
-
* @param zoom target zoom level
|
|
69
|
-
* @returns covering tile range
|
|
70
|
-
*/
|
|
71
|
-
const bboxToTileRange = (bbox, zoom) => {
|
|
72
|
-
const sanitizedBbox = (0, exports.snapBBoxToTileGrid)(bbox, zoom);
|
|
73
|
-
const minTile = (0, geoConvertor_1.degreesToTile)({
|
|
74
|
-
longitude: sanitizedBbox[0],
|
|
75
|
-
latitude: sanitizedBbox[1],
|
|
76
|
-
}, zoom);
|
|
77
|
-
const maxTile = (0, geoConvertor_1.degreesToTile)({
|
|
78
|
-
longitude: sanitizedBbox[2],
|
|
79
|
-
latitude: sanitizedBbox[3],
|
|
80
|
-
}, zoom);
|
|
81
|
-
return {
|
|
82
|
-
minX: minTile.x,
|
|
83
|
-
minY: minTile.y,
|
|
84
|
-
maxX: maxTile.x,
|
|
85
|
-
maxY: maxTile.y,
|
|
86
|
-
zoom,
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
exports.bboxToTileRange = bboxToTileRange;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bboxToTileRange = exports.bboxFromTiles = exports.snapBBoxToTileGrid = void 0;
|
|
4
|
+
const geoConvertor_1 = require("./geoConvertor");
|
|
5
|
+
const tiles_1 = require("./tiles");
|
|
6
|
+
const snapMinCordToTileGrid = (cord, tileRes) => {
|
|
7
|
+
const newCord = Math.floor(cord / tileRes) * tileRes;
|
|
8
|
+
return newCord;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* rounds bbox to grid
|
|
12
|
+
* @param bbox original bbox
|
|
13
|
+
* @param zoomLevel target tiles grid zoom level
|
|
14
|
+
* @returns bbox that contains the original bbox and match tile grid lines
|
|
15
|
+
*/
|
|
16
|
+
const snapBBoxToTileGrid = (bbox, zoomLevel) => {
|
|
17
|
+
const minLon = Math.min(bbox[0], bbox[2]);
|
|
18
|
+
const minLat = Math.min(bbox[1], bbox[3]);
|
|
19
|
+
const maxLon = Math.max(bbox[0], bbox[2]);
|
|
20
|
+
const maxLat = Math.max(bbox[1], bbox[3]);
|
|
21
|
+
const tileRes = (0, tiles_1.degreesPerTile)(zoomLevel);
|
|
22
|
+
const snappedMinLon = snapMinCordToTileGrid(minLon, tileRes);
|
|
23
|
+
let snappedMaxLon = snapMinCordToTileGrid(maxLon, tileRes);
|
|
24
|
+
if (snappedMaxLon != maxLon) {
|
|
25
|
+
snappedMaxLon += tileRes;
|
|
26
|
+
}
|
|
27
|
+
let sanppedMinLat;
|
|
28
|
+
let snappedMaxLat;
|
|
29
|
+
if (zoomLevel === 0) {
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
31
|
+
sanppedMinLat = -90;
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
33
|
+
snappedMaxLat = 90;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
sanppedMinLat = snapMinCordToTileGrid(minLat, tileRes);
|
|
37
|
+
snappedMaxLat = snapMinCordToTileGrid(maxLat, tileRes);
|
|
38
|
+
if (snappedMaxLat != maxLat) {
|
|
39
|
+
snappedMaxLat += tileRes;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const snappedBbox = [snappedMinLon, sanppedMinLat, snappedMaxLon, snappedMaxLat];
|
|
43
|
+
return snappedBbox;
|
|
44
|
+
};
|
|
45
|
+
exports.snapBBoxToTileGrid = snapBBoxToTileGrid;
|
|
46
|
+
/**
|
|
47
|
+
* create bbox from tile grid coordinates
|
|
48
|
+
* @param minTile corner tile for bbox with minimal x,y values
|
|
49
|
+
* @param maxTile corner tile for bbox with maximal x,y values
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
52
|
+
const bboxFromTiles = (minTile, maxTile) => {
|
|
53
|
+
if (minTile.zoom !== maxTile.zoom) {
|
|
54
|
+
throw new Error(`Could not calcualte bbox from tiles due to not matching zoom levels`);
|
|
55
|
+
}
|
|
56
|
+
const minPoint = (0, geoConvertor_1.tileToDegrees)(minTile);
|
|
57
|
+
const maxPoint = (0, geoConvertor_1.tileToDegrees)({
|
|
58
|
+
x: maxTile.x + 1,
|
|
59
|
+
y: maxTile.y + 1,
|
|
60
|
+
zoom: maxTile.zoom,
|
|
61
|
+
});
|
|
62
|
+
return [minPoint.longitude, minPoint.latitude, maxPoint.longitude, maxPoint.latitude];
|
|
63
|
+
};
|
|
64
|
+
exports.bboxFromTiles = bboxFromTiles;
|
|
65
|
+
/**
|
|
66
|
+
* coverts bbox to covering tile range of specified zoom level
|
|
67
|
+
* @param bbox
|
|
68
|
+
* @param zoom target zoom level
|
|
69
|
+
* @returns covering tile range
|
|
70
|
+
*/
|
|
71
|
+
const bboxToTileRange = (bbox, zoom) => {
|
|
72
|
+
const sanitizedBbox = (0, exports.snapBBoxToTileGrid)(bbox, zoom);
|
|
73
|
+
const minTile = (0, geoConvertor_1.degreesToTile)({
|
|
74
|
+
longitude: sanitizedBbox[0],
|
|
75
|
+
latitude: sanitizedBbox[1],
|
|
76
|
+
}, zoom);
|
|
77
|
+
const maxTile = (0, geoConvertor_1.degreesToTile)({
|
|
78
|
+
longitude: sanitizedBbox[2],
|
|
79
|
+
latitude: sanitizedBbox[3],
|
|
80
|
+
}, zoom);
|
|
81
|
+
return {
|
|
82
|
+
minX: minTile.x,
|
|
83
|
+
minY: minTile.y,
|
|
84
|
+
maxX: maxTile.x,
|
|
85
|
+
maxY: maxTile.y,
|
|
86
|
+
zoom,
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
exports.bboxToTileRange = bboxToTileRange;
|
|
90
90
|
//# sourceMappingURL=bboxUtils.js.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { TileOrigin } from '../models/enums/geo/tileOrigin';
|
|
2
|
-
import { IPoint } from '../models/interfaces/geo/iPoint';
|
|
3
|
-
import { ITile } from '../models/interfaces/geo/iTile';
|
|
4
|
-
/**
|
|
5
|
-
* converts point on WGS84 projection (with degree coordinates) to tile coordinates
|
|
6
|
-
* @param point coordinates to convert to matching tile
|
|
7
|
-
* @param zoomLevel matching tile zoom level
|
|
8
|
-
* @param origin tile grid origin location (default ll)
|
|
9
|
-
* @returns tile that contains the given point.
|
|
10
|
-
*/
|
|
11
|
-
export declare const degreesToTile: (point: IPoint, zoomLevel: number, origin?: TileOrigin) => ITile;
|
|
12
|
-
/**
|
|
13
|
-
* return the coordinates of the minimal corner of the given tile
|
|
14
|
-
* @param tile tile to convert
|
|
15
|
-
* @param origin tile grid origin location (default ll)
|
|
16
|
-
* @returns point with the coordinates of the tile corner
|
|
17
|
-
*/
|
|
18
|
-
export declare const tileToDegrees: (tile: ITile, origin?: TileOrigin) => IPoint;
|
|
1
|
+
import { TileOrigin } from '../models/enums/geo/tileOrigin';
|
|
2
|
+
import { IPoint } from '../models/interfaces/geo/iPoint';
|
|
3
|
+
import { ITile } from '../models/interfaces/geo/iTile';
|
|
4
|
+
/**
|
|
5
|
+
* converts point on WGS84 projection (with degree coordinates) to tile coordinates
|
|
6
|
+
* @param point coordinates to convert to matching tile
|
|
7
|
+
* @param zoomLevel matching tile zoom level
|
|
8
|
+
* @param origin tile grid origin location (default ll)
|
|
9
|
+
* @returns tile that contains the given point.
|
|
10
|
+
*/
|
|
11
|
+
export declare const degreesToTile: (point: IPoint, zoomLevel: number, origin?: TileOrigin) => ITile;
|
|
12
|
+
/**
|
|
13
|
+
* return the coordinates of the minimal corner of the given tile
|
|
14
|
+
* @param tile tile to convert
|
|
15
|
+
* @param origin tile grid origin location (default ll)
|
|
16
|
+
* @returns point with the coordinates of the tile corner
|
|
17
|
+
*/
|
|
18
|
+
export declare const tileToDegrees: (tile: ITile, origin?: TileOrigin) => IPoint;
|
|
19
19
|
//# sourceMappingURL=geoConvertor.d.ts.map
|
package/dist/geo/geoConvertor.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tileToDegrees = exports.degreesToTile = void 0;
|
|
4
|
-
const tileOrigin_1 = require("../models/enums/geo/tileOrigin");
|
|
5
|
-
const tiles_1 = require("./tiles");
|
|
6
|
-
/**
|
|
7
|
-
* converts point on WGS84 projection (with degree coordinates) to tile coordinates
|
|
8
|
-
* @param point coordinates to convert to matching tile
|
|
9
|
-
* @param zoomLevel matching tile zoom level
|
|
10
|
-
* @param origin tile grid origin location (default ll)
|
|
11
|
-
* @returns tile that contains the given point.
|
|
12
|
-
*/
|
|
13
|
-
const degreesToTile = (point, zoomLevel, origin = tileOrigin_1.TileOrigin.LOWER_LEFT) => {
|
|
14
|
-
const resolution = (0, tiles_1.degreesPerTile)(zoomLevel);
|
|
15
|
-
let lat = point.latitude;
|
|
16
|
-
if (origin === tileOrigin_1.TileOrigin.UPPER_LEFT) {
|
|
17
|
-
lat = -lat;
|
|
18
|
-
}
|
|
19
|
-
const xTile = point.longitude / resolution + (1 << zoomLevel);
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
21
|
-
const yTile = zoomLevel != 0 ? lat / resolution + (1 << (zoomLevel - 1)) : lat / resolution + 0.5;
|
|
22
|
-
return {
|
|
23
|
-
x: Math.floor(xTile),
|
|
24
|
-
y: Math.floor(yTile),
|
|
25
|
-
zoom: zoomLevel,
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
exports.degreesToTile = degreesToTile;
|
|
29
|
-
/**
|
|
30
|
-
* return the coordinates of the minimal corner of the given tile
|
|
31
|
-
* @param tile tile to convert
|
|
32
|
-
* @param origin tile grid origin location (default ll)
|
|
33
|
-
* @returns point with the coordinates of the tile corner
|
|
34
|
-
*/
|
|
35
|
-
const tileToDegrees = (tile, origin = tileOrigin_1.TileOrigin.LOWER_LEFT) => {
|
|
36
|
-
const maxLon = 180;
|
|
37
|
-
const maxLat = 90;
|
|
38
|
-
const degPerTile = (0, tiles_1.degreesPerTile)(tile.zoom);
|
|
39
|
-
const lon = tile.x * degPerTile - maxLon;
|
|
40
|
-
let lat = tile.y * degPerTile - maxLat;
|
|
41
|
-
if (origin === tileOrigin_1.TileOrigin.UPPER_LEFT) {
|
|
42
|
-
lat = -lat;
|
|
43
|
-
}
|
|
44
|
-
return {
|
|
45
|
-
latitude: lat,
|
|
46
|
-
longitude: lon,
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
exports.tileToDegrees = tileToDegrees;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tileToDegrees = exports.degreesToTile = void 0;
|
|
4
|
+
const tileOrigin_1 = require("../models/enums/geo/tileOrigin");
|
|
5
|
+
const tiles_1 = require("./tiles");
|
|
6
|
+
/**
|
|
7
|
+
* converts point on WGS84 projection (with degree coordinates) to tile coordinates
|
|
8
|
+
* @param point coordinates to convert to matching tile
|
|
9
|
+
* @param zoomLevel matching tile zoom level
|
|
10
|
+
* @param origin tile grid origin location (default ll)
|
|
11
|
+
* @returns tile that contains the given point.
|
|
12
|
+
*/
|
|
13
|
+
const degreesToTile = (point, zoomLevel, origin = tileOrigin_1.TileOrigin.LOWER_LEFT) => {
|
|
14
|
+
const resolution = (0, tiles_1.degreesPerTile)(zoomLevel);
|
|
15
|
+
let lat = point.latitude;
|
|
16
|
+
if (origin === tileOrigin_1.TileOrigin.UPPER_LEFT) {
|
|
17
|
+
lat = -lat;
|
|
18
|
+
}
|
|
19
|
+
const xTile = point.longitude / resolution + (1 << zoomLevel);
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
21
|
+
const yTile = zoomLevel != 0 ? lat / resolution + (1 << (zoomLevel - 1)) : lat / resolution + 0.5;
|
|
22
|
+
return {
|
|
23
|
+
x: Math.floor(xTile),
|
|
24
|
+
y: Math.floor(yTile),
|
|
25
|
+
zoom: zoomLevel,
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
exports.degreesToTile = degreesToTile;
|
|
29
|
+
/**
|
|
30
|
+
* return the coordinates of the minimal corner of the given tile
|
|
31
|
+
* @param tile tile to convert
|
|
32
|
+
* @param origin tile grid origin location (default ll)
|
|
33
|
+
* @returns point with the coordinates of the tile corner
|
|
34
|
+
*/
|
|
35
|
+
const tileToDegrees = (tile, origin = tileOrigin_1.TileOrigin.LOWER_LEFT) => {
|
|
36
|
+
const maxLon = 180;
|
|
37
|
+
const maxLat = 90;
|
|
38
|
+
const degPerTile = (0, tiles_1.degreesPerTile)(tile.zoom);
|
|
39
|
+
const lon = tile.x * degPerTile - maxLon;
|
|
40
|
+
let lat = tile.y * degPerTile - maxLat;
|
|
41
|
+
if (origin === tileOrigin_1.TileOrigin.UPPER_LEFT) {
|
|
42
|
+
lat = -lat;
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
latitude: lat,
|
|
46
|
+
longitude: lon,
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
exports.tileToDegrees = tileToDegrees;
|
|
50
50
|
//# sourceMappingURL=geoConvertor.js.map
|
package/dist/geo/geoHash.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { Feature, MultiPolygon, Polygon } from '@turf/turf';
|
|
2
|
-
import { BBox2d } from '@turf/helpers/dist/js/lib/geojson';
|
|
3
|
-
import { ITile } from '../models/interfaces/geo/iTile';
|
|
4
|
-
import { TileOrigin } from '../models/enums/geo/tileOrigin';
|
|
5
|
-
/**
|
|
6
|
-
* converts geohash string to its bbox in wgs84 degrees
|
|
7
|
-
* @param geohash geohash string
|
|
8
|
-
* @returns bbox of the supplied geohash
|
|
9
|
-
*/
|
|
10
|
-
export declare const decodeGeoHash: (geohash: string) => BBox2d;
|
|
11
|
-
/**
|
|
12
|
-
* generates optimized geohash iterator for given polygon and target zoom level
|
|
13
|
-
* @param polygon polygon to cover with geohashes
|
|
14
|
-
* @param maxTileZoom target zoom level
|
|
15
|
-
* @returns generator that yields the matching geohashes
|
|
16
|
-
*/
|
|
17
|
-
export declare const createGeoHashGenerator: (polygon: Polygon | Feature<Polygon | MultiPolygon>, maxTileZoom?: number) => Generator<string>;
|
|
18
|
-
/**
|
|
19
|
-
* generate all tiles in supplied polygon
|
|
20
|
-
* @param polygon polygon to cover with tiles
|
|
21
|
-
* @param tileZoom target tiles zoom level
|
|
22
|
-
* @param origin target tiles grid origin location (default ll)
|
|
23
|
-
*/
|
|
24
|
-
export declare function tileGenerator(polygon: Polygon | Feature<Polygon | MultiPolygon>, tileZoom: number, origin?: TileOrigin): AsyncGenerator<ITile>;
|
|
1
|
+
import { Feature, MultiPolygon, Polygon } from '@turf/turf';
|
|
2
|
+
import { BBox2d } from '@turf/helpers/dist/js/lib/geojson';
|
|
3
|
+
import { ITile } from '../models/interfaces/geo/iTile';
|
|
4
|
+
import { TileOrigin } from '../models/enums/geo/tileOrigin';
|
|
5
|
+
/**
|
|
6
|
+
* converts geohash string to its bbox in wgs84 degrees
|
|
7
|
+
* @param geohash geohash string
|
|
8
|
+
* @returns bbox of the supplied geohash
|
|
9
|
+
*/
|
|
10
|
+
export declare const decodeGeoHash: (geohash: string) => BBox2d;
|
|
11
|
+
/**
|
|
12
|
+
* generates optimized geohash iterator for given polygon and target zoom level
|
|
13
|
+
* @param polygon polygon to cover with geohashes
|
|
14
|
+
* @param maxTileZoom target zoom level
|
|
15
|
+
* @returns generator that yields the matching geohashes
|
|
16
|
+
*/
|
|
17
|
+
export declare const createGeoHashGenerator: (polygon: Polygon | Feature<Polygon | MultiPolygon>, maxTileZoom?: number) => Generator<string>;
|
|
18
|
+
/**
|
|
19
|
+
* generate all tiles in supplied polygon
|
|
20
|
+
* @param polygon polygon to cover with tiles
|
|
21
|
+
* @param tileZoom target tiles zoom level
|
|
22
|
+
* @param origin target tiles grid origin location (default ll)
|
|
23
|
+
*/
|
|
24
|
+
export declare function tileGenerator(polygon: Polygon | Feature<Polygon | MultiPolygon>, tileZoom: number, origin?: TileOrigin): AsyncGenerator<ITile>;
|
|
25
25
|
//# sourceMappingURL=geoHash.d.ts.map
|