@xylabs/geo 4.13.4 → 4.13.5

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.
@@ -1,84 +1,77 @@
1
- import type { Feature } from 'geojson';
2
- import type { FeatureCollection } from 'geojson';
3
- import type { Geometry } from 'geojson';
4
- import MapBox from 'mapbox-gl';
5
- import type { Point } from 'geojson';
6
- import type { Polygon } from 'geojson';
7
-
8
- export declare const boundingBoxToBoundary: (box: MercatorBoundingBox) => MercatorBoundary;
9
-
10
- export declare const boundingBoxToCenter: (boundingBox: MercatorBoundingBox, decimal?: number) => number[];
11
-
12
- export declare const boundingBoxToPolygon: (box: MercatorBoundingBox) => Polygon;
13
-
14
- export declare const d2r: number;
15
-
16
- export declare class GeoJson {
17
- private _lngLat?;
18
- private _point?;
19
- private _polygon?;
20
- private _zoom?;
21
- private quadkey;
22
- constructor(quadkey: string);
23
- static featureCollection(features: Feature[]): FeatureCollection;
24
- static featuresSource(data: FeatureCollection): MapBox.GeoJSONSourceSpecification;
25
- static geometryFeature(geometry: Geometry): Feature;
26
- center(): MapBox.LngLat;
27
- point(): Point;
28
- pointFeature(): Feature;
29
- pointFeatureCollection(): FeatureCollection;
30
- pointSource(): MapBox.GeoJSONSourceSpecification;
31
- polygon(): Polygon;
32
- polygonFeature(): Feature;
33
- polygonFeatureCollection(): FeatureCollection;
34
- polygonSource(): MapBox.GeoJSONSourceSpecification;
35
- zoom(): number;
36
- }
37
-
38
- export declare const hasSiblings: (tiles: MercatorTile[], tile: MercatorTile) => boolean;
39
-
40
- export declare abstract class LayerBase<T extends MapBox.Layer> {
41
- id: string;
42
- source: string;
43
- constructor(id: string, source: string);
44
- update(map: MapBox.Map, show?: boolean): void;
45
- abstract buildLayer(): T;
46
- }
47
-
48
- export declare type MercatorBoundary = MercatorLngLat[];
49
-
50
- export declare class MercatorBoundingBox extends MapBox.LngLatBounds {
51
- }
52
-
53
- export declare class MercatorLngLat extends MapBox.LngLat {
54
- }
55
-
56
- export declare type MercatorTile = number[];
57
-
58
- export declare const r2d: number;
59
-
60
- export declare const tileFromPoint: (point: MercatorLngLat, z: number) => number[];
61
-
62
- export declare const tileFromQuadkey: (quadkey: string) => number[];
63
-
64
- export declare const tilesEqual: (tile1: MercatorTile, tile2: MercatorTile) => boolean;
65
-
66
- export declare const tilesFromBoundingBox: (box: MercatorBoundingBox, zoom: number) => MercatorTile[];
67
-
68
- export declare const tilesHasTile: (tiles: MercatorTile[], tile: MercatorTile) => boolean;
69
-
70
- export declare const tileToBoundingBox: (tile: MercatorTile) => MercatorBoundingBox;
71
-
72
- export declare const tileToChildren: (tile: MercatorTile) => number[][];
73
-
74
- export declare const tileToGeoJson: (tile: MercatorTile) => Polygon;
75
-
76
- export declare const tileToParent: (tile: MercatorTile) => MercatorTile;
77
-
78
- export declare const tileToPoint: (tile: MercatorTile) => MercatorLngLat;
79
-
80
- export declare const tileToQuadkey: (tile: MercatorTile) => string;
81
-
82
- export declare const tileToSiblings: (tile: MercatorTile) => MercatorTile[];
83
-
84
- export { }
1
+ import { Feature, FeatureCollection, Geometry, Point, Polygon } from 'geojson';
2
+ import MapBox from 'mapbox-gl';
3
+
4
+ declare class GeoJson {
5
+ private _lngLat?;
6
+ private _point?;
7
+ private _polygon?;
8
+ private _zoom?;
9
+ private quadkey;
10
+ constructor(quadkey: string);
11
+ static featureCollection(features: Feature[]): FeatureCollection;
12
+ static featuresSource(data: FeatureCollection): MapBox.GeoJSONSourceSpecification;
13
+ static geometryFeature(geometry: Geometry): Feature;
14
+ center(): MapBox.LngLat;
15
+ point(): Point;
16
+ pointFeature(): Feature;
17
+ pointFeatureCollection(): FeatureCollection;
18
+ pointSource(): MapBox.GeoJSONSourceSpecification;
19
+ polygon(): Polygon;
20
+ polygonFeature(): Feature;
21
+ polygonFeatureCollection(): FeatureCollection;
22
+ polygonSource(): MapBox.GeoJSONSourceSpecification;
23
+ zoom(): number;
24
+ }
25
+
26
+ declare abstract class LayerBase<T extends MapBox.Layer> {
27
+ id: string;
28
+ source: string;
29
+ constructor(id: string, source: string);
30
+ update(map: MapBox.Map, show?: boolean): void;
31
+ abstract buildLayer(): T;
32
+ }
33
+
34
+ type MercatorTile = number[];
35
+ type MercatorBoundary = MercatorLngLat[];
36
+ declare class MercatorBoundingBox extends MapBox.LngLatBounds {
37
+ }
38
+ declare class MercatorLngLat extends MapBox.LngLat {
39
+ }
40
+
41
+ declare const boundingBoxToBoundary: (box: MercatorBoundingBox) => MercatorBoundary;
42
+
43
+ declare const boundingBoxToCenter: (boundingBox: MercatorBoundingBox, decimal?: number) => number[];
44
+
45
+ declare const boundingBoxToPolygon: (box: MercatorBoundingBox) => Polygon;
46
+
47
+ declare const d2r: number;
48
+ declare const r2d: number;
49
+
50
+ declare const tileFromPoint: (point: MercatorLngLat, z: number) => number[];
51
+
52
+ declare const tileFromQuadkey: (quadkey: string) => number[];
53
+
54
+ declare const tileToBoundingBox: (tile: MercatorTile) => MercatorBoundingBox;
55
+
56
+ declare const tileToChildren: (tile: MercatorTile) => number[][];
57
+
58
+ declare const tileToGeoJson: (tile: MercatorTile) => Polygon;
59
+
60
+ declare const tileToParent: (tile: MercatorTile) => MercatorTile;
61
+
62
+ declare const tileToPoint: (tile: MercatorTile) => MercatorLngLat;
63
+
64
+ declare const tileToQuadkey: (tile: MercatorTile) => string;
65
+
66
+ declare const tileToSiblings: (tile: MercatorTile) => MercatorTile[];
67
+
68
+ declare const tilesEqual: (tile1: MercatorTile, tile2: MercatorTile) => boolean;
69
+
70
+ declare const tilesFromBoundingBox: (box: MercatorBoundingBox, zoom: number) => MercatorTile[];
71
+
72
+ declare const hasSiblings: (tiles: MercatorTile[], tile: MercatorTile) => boolean;
73
+
74
+ declare const tilesHasTile: (tiles: MercatorTile[], tile: MercatorTile) => boolean;
75
+
76
+ export { GeoJson, LayerBase, MercatorBoundingBox, MercatorLngLat, boundingBoxToBoundary, boundingBoxToCenter, boundingBoxToPolygon, d2r, hasSiblings, r2d, tileFromPoint, tileFromQuadkey, tileToBoundingBox, tileToChildren, tileToGeoJson, tileToParent, tileToPoint, tileToQuadkey, tileToSiblings, tilesEqual, tilesFromBoundingBox, tilesHasTile };
77
+ export type { MercatorBoundary, MercatorTile };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/geo",
3
- "version": "4.13.4",
3
+ "version": "4.13.5",
4
4
  "description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
5
5
  "keywords": [
6
6
  "xylabs",
@@ -39,8 +39,8 @@
39
39
  "mapbox-gl": "^3.13.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.7",
43
- "@xylabs/tsconfig": "^7.0.0-rc.7",
42
+ "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.8",
43
+ "@xylabs/tsconfig": "^7.0.0-rc.8",
44
44
  "typescript": "^5.8.3",
45
45
  "vitest": "^3.2.4"
46
46
  },