@maplibre/geojson-vt 6.2.0 → 6.3.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 +7 -2
- package/dist/cluster-tile-index.d.ts +12 -9
- package/dist/cluster-tile-index.d.ts.map +1 -1
- package/dist/convert.d.ts +2 -9
- package/dist/convert.d.ts.map +1 -1
- package/dist/deconvert.d.ts +4 -11
- package/dist/deconvert.d.ts.map +1 -1
- package/dist/definitions.d.ts +38 -10
- package/dist/definitions.d.ts.map +1 -1
- package/dist/difference.d.ts +2 -1
- package/dist/difference.d.ts.map +1 -1
- package/dist/geojson-vt-dev.js +263 -133
- package/dist/geojson-vt.js +1 -1
- package/dist/geojson-vt.mjs +261 -132
- package/dist/geojson-vt.mjs.map +1 -1
- package/dist/geojsonvt.d.ts +8 -4
- package/dist/geojsonvt.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/tile-index.d.ts +4 -3
- package/dist/tile-index.d.ts.map +1 -1
- package/dist/world-coordinate-helper.d.ts +13 -0
- package/dist/world-coordinate-helper.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/cluster-tile-index.test.ts +28 -8
- package/src/cluster-tile-index.ts +53 -27
- package/src/convert.ts +45 -47
- package/src/deconvert.test.ts +4 -4
- package/src/deconvert.ts +15 -31
- package/src/definitions.ts +39 -10
- package/src/difference.ts +48 -19
- package/src/geojson-to-tile.ts +2 -2
- package/src/geojsonvt.test.ts +171 -20
- package/src/geojsonvt.ts +24 -10
- package/src/index.ts +2 -1
- package/src/tile-index.ts +8 -6
- package/src/world-coordinate-helper.ts +63 -0
- package/src/wrap.ts +1 -1
package/README.md
CHANGED
|
@@ -64,7 +64,8 @@ var tileIndex = new GeoJSONVT(data, {
|
|
|
64
64
|
promoteId: null, // name of a feature property to promote to feature.id. Cannot be used with `generateId`
|
|
65
65
|
generateId: false, // whether to generate feature ids. Cannot be used with `promoteId`
|
|
66
66
|
updateable: false, // whether the tile index can be updated (with the caveat of a stored simplified copy)
|
|
67
|
-
|
|
67
|
+
coordinates: 'lngLat', // 'lngLat', projected with web mercator, or 'unitSquare', x and y from 0 to 1 taken as they are
|
|
68
|
+
wrap: true, // whether the world wraps around the antimeridian
|
|
68
69
|
indexMaxZoom: 5, // max zoom in the initial tile index
|
|
69
70
|
indexMaxPoints: 100000 // max number of points per tile in the index
|
|
70
71
|
});
|
|
@@ -74,7 +75,11 @@ By default, tiles at zoom levels above `indexMaxZoom` are generated on the fly,
|
|
|
74
75
|
|
|
75
76
|
The `promoteId` and `generateId` options ignore existing `id` values on the feature objects.
|
|
76
77
|
|
|
77
|
-
With `
|
|
78
|
+
With `coordinates: 'unitSquare'`, positions are x and y from 0 to 1 across the square tile 0/0/0 covers, y growing downward, instead of lng/lat, for data in another projection. They are taken as they are, neither projected nor clamped, and `getData` and the cluster methods return them in the same square.
|
|
79
|
+
|
|
80
|
+
With `wrap: false`, the world is that square and ends at its edges. Nothing is copied across the antimeridian, features are cut at the tile buffer around the square, points outside it are left out of the clusters, and `getTile` returns `null` for tiles outside it. A map projection that is not repeated around the world, for example, uses `coordinates: 'unitSquare'` and `wrap: false`.
|
|
81
|
+
|
|
82
|
+
`coordinates` and `wrap` are experimental, so they can still change in a minor release.
|
|
78
83
|
|
|
79
84
|
GeoJSON-VT only operates on zoom levels up to 24.
|
|
80
85
|
|
|
@@ -24,14 +24,8 @@ export declare class ClusterTileIndex implements GeoJSONVTTileIndex {
|
|
|
24
24
|
stride: number;
|
|
25
25
|
clusterProps: Record<string, unknown>[];
|
|
26
26
|
points: GeoJSONVTInternalPointFeature[];
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
* world are then left out of the clusters, tiles at an edge get no points from the opposite one, `getTile` returns
|
|
30
|
-
* `null` outside the world, and clusters come back in world coordinates.
|
|
31
|
-
* @experimental
|
|
32
|
-
*/
|
|
33
|
-
worldCoordinates: boolean;
|
|
34
|
-
constructor(options?: SuperclusterOptions, worldCoordinates?: boolean);
|
|
27
|
+
private worldCoordinateHelper;
|
|
28
|
+
constructor(options?: SuperclusterOptions);
|
|
35
29
|
/**
|
|
36
30
|
* Loads GeoJSON Point and MultiPoint features and builds the internal clustering index.
|
|
37
31
|
* Each position of a MultiPoint is clustered as a point of its own, with the id and properties of its feature.
|
|
@@ -58,10 +52,19 @@ export declare class ClusterTileIndex implements GeoJSONVTTileIndex {
|
|
|
58
52
|
private createIndex;
|
|
59
53
|
/**
|
|
60
54
|
* Returns clusters and/or points within a bounding box at a given zoom level.
|
|
61
|
-
* @param bbox - Bounding box in `[westLng, southLat, eastLng, northLat]` order, or `[minX, minY, maxX, maxY]` in
|
|
55
|
+
* @param bbox - Bounding box in `[westLng, southLat, eastLng, northLat]` order, or `[minX, minY, maxX, maxY]` in the unit square with `coordinates: 'unitSquare'`.
|
|
56
|
+
* In a world that wraps, the box can reach across the antimeridian. In one that doesn't, only its part inside the world counts.
|
|
62
57
|
* @param zoom - Zoom level to query.
|
|
63
58
|
*/
|
|
64
59
|
getClusters(bbox: [number, number, number, number], zoom: number): ClusterOrPointFeature[];
|
|
60
|
+
/**
|
|
61
|
+
* The clusters and points in the part of a box inside a world that ends at its edges.
|
|
62
|
+
*/
|
|
63
|
+
private getClustersInWorld;
|
|
64
|
+
/**
|
|
65
|
+
* The clusters and points in a box of a unit square that wraps, where the box can reach across its left or right edge.
|
|
66
|
+
*/
|
|
67
|
+
private getClustersAcrossEdge;
|
|
65
68
|
private getClustersInternal;
|
|
66
69
|
/**
|
|
67
70
|
* The clusters and points in a box of the internal coordinates, `[minX, minY, maxX, maxY]`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cluster-tile-index.d.ts","sourceRoot":"","sources":["../src/cluster-tile-index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAG5B,OAAO,KAAK,EAAiB,qBAAqB,EAAqB,kBAAkB,EAAoB,wBAAwB,EAAE,6BAA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OAAO,CAAC,GAAG;CASd"}
|
package/dist/convert.d.ts
CHANGED
|
@@ -3,15 +3,8 @@ import type { GeoJSONVTInternalFeature, GeoJSONVTOptions } from './definitions';
|
|
|
3
3
|
* converts GeoJSON to internal source features (an intermediate projected JSON vector format with simplification data)
|
|
4
4
|
* @param data
|
|
5
5
|
* @param options
|
|
6
|
+
* @param unlocated - the features without coordinates, by id: a feature with an id that converts to nothing is set in it, and one that converts to something is deleted from it
|
|
6
7
|
* @returns
|
|
7
8
|
*/
|
|
8
|
-
export declare function convertToInternal(data: GeoJSON.GeoJSON, options: GeoJSONVTOptions): GeoJSONVTInternalFeature[];
|
|
9
|
-
/**
|
|
10
|
-
* Convert longitude to spherical mercator in [0..1] range, or keep a world coordinate as it is
|
|
11
|
-
*/
|
|
12
|
-
export declare function projectX(x: number, worldCoordinates?: boolean): number;
|
|
13
|
-
/**
|
|
14
|
-
* Convert latitude to spherical mercator in [0..1] range, or keep a world coordinate as it is
|
|
15
|
-
*/
|
|
16
|
-
export declare function projectY(y: number, worldCoordinates?: boolean): number;
|
|
9
|
+
export declare function convertToInternal(data: GeoJSON.GeoJSON, options: GeoJSONVTOptions, unlocated?: Map<string | number, GeoJSON.Feature>): GeoJSONVTInternalFeature[];
|
|
17
10
|
//# sourceMappingURL=convert.d.ts.map
|
package/dist/convert.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../src/convert.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../src/convert.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,wBAAwB,EAAE,gBAAgB,EAAa,MAAM,eAAe,CAAC;AAI1F;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,wBAAwB,EAAE,CAiBjK"}
|
package/dist/deconvert.d.ts
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
|
+
import { type WorldCoordinateHelper } from './world-coordinate-helper';
|
|
1
2
|
import type { GeoJSONVTInternalFeature } from './definitions';
|
|
2
3
|
/**
|
|
3
4
|
* Converts internal source features back to GeoJSON format.
|
|
4
5
|
*/
|
|
5
|
-
export declare function convertToGeoJSON(source: GeoJSONVTInternalFeature[],
|
|
6
|
+
export declare function convertToGeoJSON(source: GeoJSONVTInternalFeature[], worldCoordinateHelper?: WorldCoordinateHelper): GeoJSON.GeoJSON;
|
|
6
7
|
/**
|
|
7
8
|
* Converts a single internal feature to GeoJSON format.
|
|
8
9
|
*/
|
|
9
|
-
export declare function featureToGeoJSON(feature: GeoJSONVTInternalFeature,
|
|
10
|
-
export declare function unprojectPoints(coords: number[] | Float64Array,
|
|
11
|
-
/**
|
|
12
|
-
* Convert spherical mercator in [0..1] range to longitude, or keep a world coordinate as it is
|
|
13
|
-
*/
|
|
14
|
-
export declare function unprojectX(x: number, worldCoordinates?: boolean): number;
|
|
15
|
-
/**
|
|
16
|
-
* Convert spherical mercator in [0..1] range to latitude, or keep a world coordinate as it is
|
|
17
|
-
*/
|
|
18
|
-
export declare function unprojectY(y: number, worldCoordinates?: boolean): number;
|
|
10
|
+
export declare function featureToGeoJSON(feature: GeoJSONVTInternalFeature, worldCoordinateHelper?: WorldCoordinateHelper): GeoJSON.Feature;
|
|
11
|
+
export declare function unprojectPoints(coords: number[] | Float64Array, worldCoordinateHelper?: WorldCoordinateHelper): GeoJSON.Position[];
|
|
19
12
|
//# sourceMappingURL=deconvert.d.ts.map
|
package/dist/deconvert.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deconvert.d.ts","sourceRoot":"","sources":["../src/deconvert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,eAAe,CAAC;AAE5D;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,wBAAwB,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"deconvert.d.ts","sourceRoot":"","sources":["../src/deconvert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,qBAAqB,EAAC,MAAM,2BAA2B,CAAC;AACpG,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,eAAe,CAAC;AAE5D;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,wBAAwB,EAAE,EAAE,qBAAqB,GAAE,qBAAqD,GAAG,OAAO,CAAC,OAAO,CAOlK;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,GAAE,qBAAqD,GAAG,OAAO,CAAC,OAAO,CAWjK;AAwCD,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,YAAY,EAAE,qBAAqB,GAAE,qBAAqD,GAAG,OAAO,CAAC,QAAQ,EAAE,CAQjK"}
|
package/dist/definitions.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The space positions are given in, see `coordinates` in {@link GeoJSONVTOptions}.
|
|
3
|
+
* @experimental
|
|
4
|
+
*/
|
|
5
|
+
export type GeoJSONVTCoordinatesType = 'lngLat' | 'unitSquare';
|
|
1
6
|
export type GeoJSONVTOptions = {
|
|
2
7
|
/**
|
|
3
8
|
* Max zoom to preserve detail on
|
|
@@ -54,15 +59,23 @@ export type GeoJSONVTOptions = {
|
|
|
54
59
|
*/
|
|
55
60
|
debug?: number;
|
|
56
61
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* returns `null` outside it, and `getData` and the cluster methods return world coordinates too.
|
|
62
|
+
* The space the positions are in. `'lngLat'` is longitude and latitude, which web mercator puts in the square from 0
|
|
63
|
+
* to 1 that tile 0/0/0 covers, with latitudes beyond ~85.05 degrees clamped onto its top and bottom. `'unitSquare'`
|
|
64
|
+
* is x and y in that square already, y growing downward, taken as they are, for data in another projection.
|
|
65
|
+
* `getData` and the cluster methods return positions in the same space.
|
|
62
66
|
* @experimental
|
|
63
|
-
* @default
|
|
67
|
+
* @default 'lngLat'
|
|
64
68
|
*/
|
|
65
|
-
|
|
69
|
+
coordinates?: GeoJSONVTCoordinatesType;
|
|
70
|
+
/**
|
|
71
|
+
* Whether the world wraps around the antimeridian. With `true`, features near the left or right edge are copied
|
|
72
|
+
* across it, and the tiles at either edge include what lies past it. With `false`, the world is the square and ends
|
|
73
|
+
* at its edges. Features are cut at the tile buffer around it, points outside it are left out of the clusters, and
|
|
74
|
+
* `getTile` returns `null` outside it. `geoJSONToTile` doesn't wrap unless this is `true`.
|
|
75
|
+
* @experimental
|
|
76
|
+
* @default true
|
|
77
|
+
*/
|
|
78
|
+
wrap?: boolean;
|
|
66
79
|
/**
|
|
67
80
|
* Enable Supercluster for point features. Each position of a MultiPoint feature is clustered as a point of its own.
|
|
68
81
|
* Other geometry types are left out.
|
|
@@ -70,14 +83,14 @@ export type GeoJSONVTOptions = {
|
|
|
70
83
|
*/
|
|
71
84
|
cluster?: boolean;
|
|
72
85
|
/**
|
|
73
|
-
* Options for the Supercluster point clustering algorithm.
|
|
86
|
+
* Options for the Supercluster point clustering algorithm. `coordinates` and `wrap` come from the options above.
|
|
74
87
|
* @see {@link SuperclusterOptions}
|
|
75
88
|
*/
|
|
76
|
-
clusterOptions?: SuperclusterOptions
|
|
89
|
+
clusterOptions?: Omit<SuperclusterOptions, 'coordinates' | 'wrap'>;
|
|
77
90
|
};
|
|
78
91
|
export type GeoJSONToTileOptions = GeoJSONVTOptions & {
|
|
79
92
|
/**
|
|
80
|
-
* Whether to wrap features around the antimeridian
|
|
93
|
+
* Whether to wrap features around the antimeridian, see `wrap` in {@link GeoJSONVTOptions}.
|
|
81
94
|
* @default false
|
|
82
95
|
*/
|
|
83
96
|
wrap?: boolean;
|
|
@@ -256,5 +269,20 @@ export type SuperclusterOptions = {
|
|
|
256
269
|
* @default props => props
|
|
257
270
|
*/
|
|
258
271
|
map?: (props: GeoJSON.GeoJsonProperties) => Record<string, unknown>;
|
|
272
|
+
/**
|
|
273
|
+
* The space the points are in, see `coordinates` in {@link GeoJSONVTOptions}. The bounding box of `getClusters` is
|
|
274
|
+
* in the same space.
|
|
275
|
+
* @experimental
|
|
276
|
+
* @default 'lngLat'
|
|
277
|
+
*/
|
|
278
|
+
coordinates?: GeoJSONVTCoordinatesType;
|
|
279
|
+
/**
|
|
280
|
+
* Whether the world wraps around the antimeridian, see `wrap` in {@link GeoJSONVTOptions}. With `false`, points
|
|
281
|
+
* outside the square are left out of the clusters, the tiles at an edge get no points from the opposite one, and
|
|
282
|
+
* `getTile` returns `null` outside the square.
|
|
283
|
+
* @experimental
|
|
284
|
+
* @default true
|
|
285
|
+
*/
|
|
286
|
+
wrap?: boolean;
|
|
259
287
|
};
|
|
260
288
|
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../src/definitions.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC3B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,UA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G;IACH,MAAM,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;IACjG;;;OAGG;IACH,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpE;;;;;OAKG;IACH,WAAW,CAAC,EAAE,wBAAwB,CAAC;IACvC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC"}
|
package/dist/difference.d.ts
CHANGED
|
@@ -63,9 +63,10 @@ type HashedGeoJSONVTSourceDiff = {
|
|
|
63
63
|
* @param source
|
|
64
64
|
* @param dataDiff
|
|
65
65
|
* @param options
|
|
66
|
+
* @param unlocated - the features without coordinates, by id, so that an update can give them some
|
|
66
67
|
* @returns
|
|
67
68
|
*/
|
|
68
|
-
export declare function applySourceDiff(source: GeoJSONVTInternalFeature[], dataDiff: GeoJSONVTSourceDiff, options: GeoJSONVTOptions): ApplySourceDiffResult;
|
|
69
|
+
export declare function applySourceDiff(source: GeoJSONVTInternalFeature[], dataDiff: GeoJSONVTSourceDiff, options: GeoJSONVTOptions, unlocated?: Map<string | number, GeoJSON.Feature>): ApplySourceDiffResult;
|
|
69
70
|
/**
|
|
70
71
|
* Convert a GeoJSON Source Diff to an idempotent hashed representation using Sets and Maps
|
|
71
72
|
*/
|
package/dist/difference.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"difference.d.ts","sourceRoot":"","sources":["../src/difference.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEhF,MAAM,MAAM,mBAAmB,GAAG;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,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