@map-colonies/mc-utils 1.9.0 → 2.0.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/README.md +67 -67
- package/dist/arrays/index.d.ts +1 -1
- package/dist/arrays/index.d.ts.map +0 -0
- package/dist/arrays/index.js +17 -13
- package/dist/arrays/index.js.map +1 -1
- package/dist/arrays/subGroups.d.ts +8 -8
- package/dist/arrays/subGroups.d.ts.map +0 -0
- package/dist/arrays/subGroups.js +138 -138
- package/dist/arrays/subGroups.js.map +0 -0
- package/dist/communication/http/httpClient.d.ts +29 -28
- package/dist/communication/http/httpClient.d.ts.map +1 -1
- package/dist/communication/http/httpClient.js +434 -429
- package/dist/communication/http/httpClient.js.map +1 -1
- package/dist/communication/http/index.d.ts +1 -1
- package/dist/communication/http/index.d.ts.map +0 -0
- package/dist/communication/http/index.js +17 -13
- package/dist/communication/http/index.js.map +1 -1
- package/dist/communication/index.d.ts +1 -1
- package/dist/communication/index.d.ts.map +0 -0
- package/dist/communication/index.js +17 -13
- package/dist/communication/index.js.map +1 -1
- package/dist/dateTime/getUTCDate.d.ts +1 -1
- package/dist/dateTime/getUTCDate.d.ts.map +0 -0
- package/dist/dateTime/getUTCDate.js +10 -10
- package/dist/dateTime/getUTCDate.js.map +0 -0
- package/dist/dateTime/index.d.ts +1 -1
- package/dist/dateTime/index.d.ts.map +0 -0
- package/dist/dateTime/index.js +17 -13
- package/dist/dateTime/index.js.map +1 -1
- package/dist/geo/bboxUtils.d.ts +23 -23
- package/dist/geo/bboxUtils.d.ts.map +0 -0
- package/dist/geo/bboxUtils.js +89 -89
- package/dist/geo/bboxUtils.js.map +0 -0
- package/dist/geo/geoConvertor.d.ts +18 -18
- package/dist/geo/geoConvertor.d.ts.map +0 -0
- package/dist/geo/geoConvertor.js +51 -51
- package/dist/geo/geoConvertor.js.map +0 -0
- package/dist/geo/geoHash.d.ts +24 -24
- package/dist/geo/geoHash.d.ts.map +1 -1
- package/dist/geo/geoHash.js +274 -242
- package/dist/geo/geoHash.js.map +1 -1
- package/dist/geo/geoIntersection.d.ts +19 -19
- package/dist/geo/geoIntersection.d.ts.map +0 -0
- package/dist/geo/geoIntersection.js +70 -70
- package/dist/geo/geoIntersection.js.map +0 -0
- package/dist/geo/index.d.ts +8 -8
- package/dist/geo/index.d.ts.map +0 -0
- package/dist/geo/index.js +24 -20
- package/dist/geo/index.js.map +1 -1
- package/dist/geo/tileBatcher.d.ts +8 -8
- package/dist/geo/tileBatcher.d.ts.map +1 -1
- package/dist/geo/tileBatcher.js +188 -167
- package/dist/geo/tileBatcher.js.map +1 -1
- package/dist/geo/tileRanger.d.ts +46 -46
- package/dist/geo/tileRanger.d.ts.map +0 -0
- package/dist/geo/tileRanger.js +327 -327
- package/dist/geo/tileRanger.js.map +0 -0
- package/dist/geo/tiles.d.ts +82 -82
- package/dist/geo/tiles.d.ts.map +1 -1
- package/dist/geo/tiles.js +246 -238
- package/dist/geo/tiles.js.map +1 -1
- package/dist/geo/tilesGenerator.d.ts +2 -2
- package/dist/geo/tilesGenerator.d.ts.map +0 -0
- package/dist/geo/tilesGenerator.js +94 -94
- package/dist/geo/tilesGenerator.js.map +0 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +0 -0
- package/dist/index.js +21 -17
- package/dist/index.js.map +1 -1
- package/dist/models/enums/gdal/dataType.d.ts +16 -16
- package/dist/models/enums/gdal/dataType.d.ts.map +0 -0
- package/dist/models/enums/gdal/dataType.js +20 -20
- package/dist/models/enums/gdal/dataType.js.map +0 -0
- package/dist/models/enums/gdal/index.d.ts +2 -2
- package/dist/models/enums/gdal/index.d.ts.map +0 -0
- package/dist/models/enums/gdal/index.js +18 -14
- package/dist/models/enums/gdal/index.js.map +1 -1
- package/dist/models/enums/gdal/resamplingMethod.d.ts +16 -16
- package/dist/models/enums/gdal/resamplingMethod.d.ts.map +0 -0
- package/dist/models/enums/gdal/resamplingMethod.js +20 -20
- package/dist/models/enums/gdal/resamplingMethod.js.map +0 -0
- package/dist/models/enums/geo/index.d.ts +1 -1
- package/dist/models/enums/geo/index.d.ts.map +0 -0
- package/dist/models/enums/geo/index.js +17 -13
- package/dist/models/enums/geo/index.js.map +1 -1
- package/dist/models/enums/geo/tileOrigin.d.ts +7 -7
- package/dist/models/enums/geo/tileOrigin.d.ts.map +0 -0
- package/dist/models/enums/geo/tileOrigin.js +11 -11
- package/dist/models/enums/geo/tileOrigin.js.map +0 -0
- package/dist/models/enums/index.d.ts +2 -2
- package/dist/models/enums/index.d.ts.map +0 -0
- package/dist/models/enums/index.js +18 -14
- package/dist/models/enums/index.js.map +1 -1
- package/dist/models/index.d.ts +2 -2
- package/dist/models/index.d.ts.map +0 -0
- package/dist/models/index.js +18 -14
- package/dist/models/index.js.map +1 -1
- package/dist/models/interfaces/geo/iPoint.d.ts +7 -7
- package/dist/models/interfaces/geo/iPoint.d.ts.map +0 -0
- package/dist/models/interfaces/geo/iPoint.js +2 -2
- package/dist/models/interfaces/geo/iPoint.js.map +0 -0
- package/dist/models/interfaces/geo/iTile.d.ts +15 -15
- package/dist/models/interfaces/geo/iTile.d.ts.map +0 -0
- package/dist/models/interfaces/geo/iTile.js +2 -2
- package/dist/models/interfaces/geo/iTile.js.map +0 -0
- package/dist/models/interfaces/geo/index.d.ts +2 -2
- package/dist/models/interfaces/geo/index.d.ts.map +0 -0
- package/dist/models/interfaces/geo/index.js +18 -14
- package/dist/models/interfaces/geo/index.js.map +1 -1
- package/dist/models/interfaces/index.d.ts +1 -1
- package/dist/models/interfaces/index.d.ts.map +0 -0
- package/dist/models/interfaces/index.js +17 -13
- package/dist/models/interfaces/index.js.map +1 -1
- package/package.json +79 -79
|
File without changes
|
package/dist/geo/tiles.d.ts
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
import { BBox2d } from '@turf/helpers/dist/js/lib/geojson';
|
|
2
|
-
import { Feature, FeatureCollection, MultiPolygon, Polygon } from '@turf/turf';
|
|
3
|
-
import { ITile, ITileRange } from '../models/interfaces/geo/iTile';
|
|
4
|
-
/**
|
|
5
|
-
* calculates tile size (resolution) in degrees
|
|
6
|
-
* @param zoomLevel zoom level of returned tile size
|
|
7
|
-
* @returns tile size (resolution) in degrees
|
|
8
|
-
*/
|
|
9
|
-
export declare function degreesPerTile(zoomLevel: number): number;
|
|
10
|
-
/**
|
|
11
|
-
* returns pixel size (resolution) in degrees
|
|
12
|
-
* @param zoomLevel tile zoom level of returned tile pixel size
|
|
13
|
-
* @returns pixel size (resolution) in degrees
|
|
14
|
-
*/
|
|
15
|
-
export declare function degreesPerPixel(zoomLevel: number): number;
|
|
16
|
-
/**
|
|
17
|
-
* coverts tile coordinates between ll and ul
|
|
18
|
-
* @param tile source tile
|
|
19
|
-
* @returns converted tile
|
|
20
|
-
*/
|
|
21
|
-
export declare function flipYAxis(tile: ITile): ITile;
|
|
22
|
-
/**
|
|
23
|
-
* converts zoom level (integer) to matching resolution degree value
|
|
24
|
-
* @param zoom zoom level in range of 0-22
|
|
25
|
-
* @returns resolution represented in degrees, or undefined if zoom level is out of range
|
|
26
|
-
*/
|
|
27
|
-
export declare function zoomLevelToResolutionDeg(zoom: number): number | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* converts zoom level (integer) to matching resolution meter value
|
|
30
|
-
* @param zoom zoom level in range of 0-22
|
|
31
|
-
* @returns resolution represented in Meters, or undefined if zoom level is out of range
|
|
32
|
-
*/
|
|
33
|
-
export declare function zoomLevelToResolutionMeter(zoom: number): number | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* converts pixel size (resolution) in degrees to matching zoom level (rounded down)
|
|
36
|
-
* @param resolution pixel size (resolution) in degrees
|
|
37
|
-
* @returns zoom level for given pixel size
|
|
38
|
-
*/
|
|
39
|
-
export declare function degreesPerPixelToZoomLevel(resolution: number): number;
|
|
40
|
-
/**
|
|
41
|
-
* returns bbox of given tile
|
|
42
|
-
* @param tile
|
|
43
|
-
* @returns
|
|
44
|
-
*/
|
|
45
|
-
export declare function tileToBbox(tile: ITile): BBox2d;
|
|
46
|
-
/**
|
|
47
|
-
* returns the batch area
|
|
48
|
-
* @param ITileRange
|
|
49
|
-
* @returns
|
|
50
|
-
*/
|
|
51
|
-
export declare function tileRangeToTilesCount(batch: ITileRange): number;
|
|
52
|
-
/**
|
|
53
|
-
* returns tiles amount of given feature and zoom ranges - based on 2:1 tile scheme
|
|
54
|
-
* use the bboxToTileRange method and provide sanitized bbox coverage of tiles
|
|
55
|
-
* @param feature
|
|
56
|
-
* If feature's properties include attributes of "maxResolutionDeg" and "minResolutionDeg" or just one of them -
|
|
57
|
-
* It will be converted to maxZoom and minZoom instead of default params to calculate
|
|
58
|
-
* minResolutionDeg >= 0.703125
|
|
59
|
-
* maxResolutionDeg <= 0.000000167638063430786
|
|
60
|
-
* @param layerFootprint - referenced layer geometry to snap on the bbox
|
|
61
|
-
* @param defaultMaxZoom optional - default is 22 - if maxResolutionDeg property was provided, the param will be ignored
|
|
62
|
-
* @param defaultMinZoom optional - default is 0 - if minResolutionDeg property was provided, the param will be ignored
|
|
63
|
-
* @returns tile count included on provided feature and zooms ranges
|
|
64
|
-
*/
|
|
65
|
-
export declare function featureToTilesCount(feature: Feature<Polygon | MultiPolygon>, defaultMaxZoom?: number, defaultMinZoom?: number): number;
|
|
66
|
-
/**
|
|
67
|
-
* returns tiles amount of given featureCollection [each feature may include maxResolutionDeg and minResolutionDeg
|
|
68
|
-
* if no resolutions in property will calculate all features with optional argument]
|
|
69
|
-
* based on 2:1 tile scheme
|
|
70
|
-
* use the bboxToTileRange method and provide sanitized bbox coverage of tiles
|
|
71
|
-
* @param fc - FeatureCollection
|
|
72
|
-
* foreach feature in featuresCollection features array:
|
|
73
|
-
* If feature's properties include attributes of "maxResolutionDeg" and "minResolutionDeg" or just one of them -
|
|
74
|
-
* It will be converted to maxZoom and minZoom instead of default params to calculate
|
|
75
|
-
* minResolutionDeg >= 0.703125
|
|
76
|
-
* maxResolutionDeg <= 0.000000167638063430786
|
|
77
|
-
* for current feature in the array
|
|
78
|
-
* @param defaultMaxZoom optional - default is 22 - if maxResolutionDeg property was provided, the param will be ignored
|
|
79
|
-
* @param defaultMinZoom optional - default is 0 - if minResolutionDeg property was provided, the param will be ignored
|
|
80
|
-
* @returns tile count included on provided feature and zooms ranges
|
|
81
|
-
*/
|
|
82
|
-
export declare function featureCollectionToTilesCount(fc: FeatureCollection, defaultMaxZoom?: number, defaultMinZoom?: number): number;
|
|
1
|
+
import { BBox2d } from '@turf/helpers/dist/js/lib/geojson';
|
|
2
|
+
import { Feature, FeatureCollection, MultiPolygon, Polygon } from '@turf/turf';
|
|
3
|
+
import { ITile, ITileRange } from '../models/interfaces/geo/iTile';
|
|
4
|
+
/**
|
|
5
|
+
* calculates tile size (resolution) in degrees
|
|
6
|
+
* @param zoomLevel zoom level of returned tile size
|
|
7
|
+
* @returns tile size (resolution) in degrees
|
|
8
|
+
*/
|
|
9
|
+
export declare function degreesPerTile(zoomLevel: number): number;
|
|
10
|
+
/**
|
|
11
|
+
* returns pixel size (resolution) in degrees
|
|
12
|
+
* @param zoomLevel tile zoom level of returned tile pixel size
|
|
13
|
+
* @returns pixel size (resolution) in degrees
|
|
14
|
+
*/
|
|
15
|
+
export declare function degreesPerPixel(zoomLevel: number): number;
|
|
16
|
+
/**
|
|
17
|
+
* coverts tile coordinates between ll and ul
|
|
18
|
+
* @param tile source tile
|
|
19
|
+
* @returns converted tile
|
|
20
|
+
*/
|
|
21
|
+
export declare function flipYAxis(tile: ITile): ITile;
|
|
22
|
+
/**
|
|
23
|
+
* converts zoom level (integer) to matching resolution degree value
|
|
24
|
+
* @param zoom zoom level in range of 0-22
|
|
25
|
+
* @returns resolution represented in degrees, or undefined if zoom level is out of range
|
|
26
|
+
*/
|
|
27
|
+
export declare function zoomLevelToResolutionDeg(zoom: number): number | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* converts zoom level (integer) to matching resolution meter value
|
|
30
|
+
* @param zoom zoom level in range of 0-22
|
|
31
|
+
* @returns resolution represented in Meters, or undefined if zoom level is out of range
|
|
32
|
+
*/
|
|
33
|
+
export declare function zoomLevelToResolutionMeter(zoom: number): number | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* converts pixel size (resolution) in degrees to matching zoom level (rounded down)
|
|
36
|
+
* @param resolution pixel size (resolution) in degrees
|
|
37
|
+
* @returns zoom level for given pixel size
|
|
38
|
+
*/
|
|
39
|
+
export declare function degreesPerPixelToZoomLevel(resolution: number): number;
|
|
40
|
+
/**
|
|
41
|
+
* returns bbox of given tile
|
|
42
|
+
* @param tile
|
|
43
|
+
* @returns
|
|
44
|
+
*/
|
|
45
|
+
export declare function tileToBbox(tile: ITile): BBox2d;
|
|
46
|
+
/**
|
|
47
|
+
* returns the batch area
|
|
48
|
+
* @param ITileRange
|
|
49
|
+
* @returns
|
|
50
|
+
*/
|
|
51
|
+
export declare function tileRangeToTilesCount(batch: ITileRange): number;
|
|
52
|
+
/**
|
|
53
|
+
* returns tiles amount of given feature and zoom ranges - based on 2:1 tile scheme
|
|
54
|
+
* use the bboxToTileRange method and provide sanitized bbox coverage of tiles
|
|
55
|
+
* @param feature
|
|
56
|
+
* If feature's properties include attributes of "maxResolutionDeg" and "minResolutionDeg" or just one of them -
|
|
57
|
+
* It will be converted to maxZoom and minZoom instead of default params to calculate
|
|
58
|
+
* minResolutionDeg >= 0.703125
|
|
59
|
+
* maxResolutionDeg <= 0.000000167638063430786
|
|
60
|
+
* @param layerFootprint - referenced layer geometry to snap on the bbox
|
|
61
|
+
* @param defaultMaxZoom optional - default is 22 - if maxResolutionDeg property was provided, the param will be ignored
|
|
62
|
+
* @param defaultMinZoom optional - default is 0 - if minResolutionDeg property was provided, the param will be ignored
|
|
63
|
+
* @returns tile count included on provided feature and zooms ranges
|
|
64
|
+
*/
|
|
65
|
+
export declare function featureToTilesCount(feature: Feature<Polygon | MultiPolygon>, defaultMaxZoom?: number, defaultMinZoom?: number): number;
|
|
66
|
+
/**
|
|
67
|
+
* returns tiles amount of given featureCollection [each feature may include maxResolutionDeg and minResolutionDeg
|
|
68
|
+
* if no resolutions in property will calculate all features with optional argument]
|
|
69
|
+
* based on 2:1 tile scheme
|
|
70
|
+
* use the bboxToTileRange method and provide sanitized bbox coverage of tiles
|
|
71
|
+
* @param fc - FeatureCollection
|
|
72
|
+
* foreach feature in featuresCollection features array:
|
|
73
|
+
* If feature's properties include attributes of "maxResolutionDeg" and "minResolutionDeg" or just one of them -
|
|
74
|
+
* It will be converted to maxZoom and minZoom instead of default params to calculate
|
|
75
|
+
* minResolutionDeg >= 0.703125
|
|
76
|
+
* maxResolutionDeg <= 0.000000167638063430786
|
|
77
|
+
* for current feature in the array
|
|
78
|
+
* @param defaultMaxZoom optional - default is 22 - if maxResolutionDeg property was provided, the param will be ignored
|
|
79
|
+
* @param defaultMinZoom optional - default is 0 - if minResolutionDeg property was provided, the param will be ignored
|
|
80
|
+
* @returns tile count included on provided feature and zooms ranges
|
|
81
|
+
*/
|
|
82
|
+
export declare function featureCollectionToTilesCount(fc: FeatureCollection, defaultMaxZoom?: number, defaultMinZoom?: number): number;
|
|
83
83
|
//# sourceMappingURL=tiles.d.ts.map
|
package/dist/geo/tiles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiles.d.ts","sourceRoot":"","sources":["../../src/geo/tiles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAQ,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrF,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"tiles.d.ts","sourceRoot":"","sources":["../../src/geo/tiles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAQ,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrF,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AA4DnE;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGxD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAO5C;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEzE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE3E;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAQrE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,CAI9C;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAE/D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,GAAG,YAAY,CAAC,EAAE,cAAc,SAAK,EAAE,cAAc,SAAI,GAAG,MAAM,CA+B7H;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,6BAA6B,CAAC,EAAE,EAAE,iBAAiB,EAAE,cAAc,SAAK,EAAE,cAAc,SAAI,GAAG,MAAM,CAWpH"}
|