@maplibre/geojson-vt 6.3.2 → 7.0.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/dist/clip.d.ts.map +1 -1
- package/dist/cluster-tile-index.d.ts +8 -0
- package/dist/cluster-tile-index.d.ts.map +1 -1
- package/dist/convert.d.ts.map +1 -1
- package/dist/deconvert.d.ts +0 -1
- package/dist/deconvert.d.ts.map +1 -1
- package/dist/definitions.d.ts +66 -25
- package/dist/definitions.d.ts.map +1 -1
- package/dist/feature.d.ts +16 -12
- package/dist/feature.d.ts.map +1 -1
- package/dist/geojson-vt-dev.js +602 -453
- package/dist/geojson-vt.js +1 -1
- package/dist/geojson-vt.mjs +599 -450
- package/dist/geojson-vt.mjs.map +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/simplify.d.ts +1 -1
- package/dist/simplify.d.ts.map +1 -1
- package/dist/tile-index.d.ts.map +1 -1
- package/dist/tile.d.ts +5 -2
- package/dist/tile.d.ts.map +1 -1
- package/dist/transform.d.ts +5 -6
- package/dist/transform.d.ts.map +1 -1
- package/dist/wrap.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/clip.test.ts +52 -32
- package/src/clip.ts +225 -143
- package/src/cluster-tile-index.ts +29 -21
- package/src/convert.ts +78 -65
- package/src/deconvert.test.ts +29 -28
- package/src/deconvert.ts +51 -23
- package/src/definitions.ts +69 -17
- package/src/difference.test.ts +38 -75
- package/src/feature.ts +53 -51
- package/src/geojson-to-tile.ts +1 -1
- package/src/geojsonvt.test.ts +113 -0
- package/src/index.ts +1 -17
- package/src/simplify.ts +2 -2
- package/src/tile-index.test.ts +3 -9
- package/src/tile-index.ts +11 -10
- package/src/tile.ts +212 -92
- package/src/transform.test.ts +2 -3
- package/src/transform.ts +24 -99
- package/src/wrap.ts +12 -73
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { GeoJSONVTFeatureDiff, GeoJSONVTSourceDiff } from './difference';
|
|
2
|
-
import type {
|
|
3
|
-
import type { KDBushWithData } from './cluster-tile-index';
|
|
2
|
+
import type { GeoJSONVTOptions, GeoJSONToTileOptions, ClusterProperties, ClusterFeature, ClusterOrPointFeature, GeoJSONVTTile, GeoJSONVTFeature, GeoJSONVTFeaturePoint, GeoJSONVTFeatureNonPoint, GeoJSONVTTileIndex, SuperclusterOptions, GeoJSONVTCoordinatesType } from './definitions';
|
|
4
3
|
import { GeoJSONVT } from './geojsonvt';
|
|
5
4
|
import { ClusterTileIndex } from './cluster-tile-index';
|
|
6
5
|
import { geoJSONToTile } from './geojson-to-tile';
|
|
7
6
|
import { GEOJSONVT_CLIP_START, GEOJSONVT_CLIP_END } from './tile';
|
|
8
7
|
export { GeoJSONVT, ClusterTileIndex as Supercluster, geoJSONToTile, GEOJSONVT_CLIP_START, GEOJSONVT_CLIP_END };
|
|
9
|
-
export type {
|
|
8
|
+
export type { GeoJSONVTOptions, GeoJSONToTileOptions, GeoJSONVTTile, GeoJSONVTFeature, GeoJSONVTSourceDiff, GeoJSONVTFeatureDiff, GeoJSONVTFeaturePoint, GeoJSONVTFeatureNonPoint, SuperclusterOptions, GeoJSONVTCoordinatesType, ClusterProperties, ClusterFeature, ClusterOrPointFeature, GeoJSONVTTileIndex };
|
|
10
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,oBAAoB,EAAE,mBAAmB,EAAC,MAAM,cAAc,CAAC;AAC5E,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,oBAAoB,EAAE,mBAAmB,EAAC,MAAM,cAAc,CAAC;AAC5E,OAAO,KAAK,EAAC,gBAAgB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,cAAc,EAAE,qBAAqB,EAAE,aAAa,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,wBAAwB,EAAC,MAAM,eAAe,CAAC;AACzR,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,oBAAoB,EAAE,kBAAkB,EAAC,MAAM,QAAQ,CAAC;AAEhE,OAAO,EACH,SAAS,EACT,gBAAgB,IAAI,YAAY,EAChC,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EACrB,CAAA;AAED,YAAY,EACR,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACrB,CAAC"}
|
package/dist/simplify.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* @param last - index of the last coordinate in the segment
|
|
6
6
|
* @param sqTolerance - square tolerance value
|
|
7
7
|
*/
|
|
8
|
-
export declare function simplify(coords: number[], first: number, last: number, sqTolerance: number): void;
|
|
8
|
+
export declare function simplify(coords: number[] | Float64Array, first: number, last: number, sqTolerance: number): void;
|
|
9
9
|
//# sourceMappingURL=simplify.d.ts.map
|
package/dist/simplify.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simplify.d.ts","sourceRoot":"","sources":["../src/simplify.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"simplify.d.ts","sourceRoot":"","sources":["../src/simplify.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,QAQzG"}
|
package/dist/tile-index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tile-index.d.ts","sourceRoot":"","sources":["../src/tile-index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tile-index.d.ts","sourceRoot":"","sources":["../src/tile-index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEjK,qBAAa,SAAU,YAAW,kBAAkB;IAWpC,OAAO,CAAC,OAAO;IAT3B,OAAO,CAAC,UAAU,CAAkD;IACpE,OAAO,CAAC,KAAK,CAAa;IAE1B,gBAAgB;IACT,KAAK,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,qBAAqB,CAAA;KAAC,CAAC;IACrD,gBAAgB;IACT,KAAK,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAC,CAAM;gBAGvB,OAAO,EAAE,gBAAgB;IAO7C,UAAU,CAAC,QAAQ,EAAE,wBAAwB,EAAE,GAAG,IAAI;IAWtD,oBAAoB;IACpB,WAAW,CAAC,MAAM,EAAE,wBAAwB,EAAE,EAAE,QAAQ,EAAE,wBAAwB,EAAE,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI;IA4BtH,oBAAoB;IAEpB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAI1D,oBAAoB;IAEpB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,qBAAqB,EAAE,GAAG,IAAI;IAI/D,oBAAoB;IAEpB,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI;IAIzG,oBAAoB;IACpB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IAyC9D;;;;;OAKG;IACH,OAAO,CAAC,WAAW;IAQnB;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,SAAS;IA4FjB;;;;OAIG;IACH,OAAO,CAAC,eAAe;CAuE1B"}
|
package/dist/tile.d.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import type { GeoJSONVTInternalFeature, GeoJSONVTInternalTile, GeoJSONVTOptions } from "./definitions";
|
|
2
2
|
export declare const GEOJSONVT_CLIP_START = "geojsonvt_clip_start";
|
|
3
3
|
export declare const GEOJSONVT_CLIP_END = "geojsonvt_clip_end";
|
|
4
|
+
type TileCoordsConstructor = Int16ArrayConstructor | Int32ArrayConstructor | Float64ArrayConstructor;
|
|
4
5
|
/**
|
|
5
|
-
* Creates a tile object from the given features
|
|
6
|
+
* Creates a tile object from the given features, with their coordinates in the tile's extent
|
|
6
7
|
* @param features - the features to include in the tile
|
|
7
8
|
* @param z
|
|
8
9
|
* @param tx
|
|
9
10
|
* @param ty
|
|
10
11
|
* @param options - the options object
|
|
12
|
+
* @param CoordArray - what holds the coordinates, which has to be a `Float64Array` when the features are not cut at the tile's buffer
|
|
11
13
|
* @returns the created tile
|
|
12
14
|
*/
|
|
13
|
-
export declare function createTile(features: GeoJSONVTInternalFeature[], z: number, tx: number, ty: number, options: GeoJSONVTOptions): GeoJSONVTInternalTile;
|
|
15
|
+
export declare function createTile(features: GeoJSONVTInternalFeature[], z: number, tx: number, ty: number, options: GeoJSONVTOptions, CoordArray?: TileCoordsConstructor): GeoJSONVTInternalTile;
|
|
16
|
+
export {};
|
|
14
17
|
//# sourceMappingURL=tile.d.ts.map
|
package/dist/tile.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tile.d.ts","sourceRoot":"","sources":["../src/tile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAyN,qBAAqB,EAAgC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"tile.d.ts","sourceRoot":"","sources":["../src/tile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAyN,qBAAqB,EAAgC,gBAAgB,EAA8C,MAAM,eAAe,CAAC;AAGxY,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAC3D,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AAEvD,KAAK,qBAAqB,GAAG,qBAAqB,GAAG,qBAAqB,GAAG,uBAAuB,CAAC;AAoBrG;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,wBAAwB,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,UAAU,wBAAoC,GAAG,qBAAqB,CA+BpM"}
|
package/dist/transform.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { GeoJSONVTInternalTile, GeoJSONVTTile } from "./definitions";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* @param tile - the tile
|
|
6
|
-
* @
|
|
7
|
-
* @returns the transformed tile
|
|
3
|
+
* Turns a stored tile, which keeps its coordinates in flat arrays, into the tile `getTile` returns,
|
|
4
|
+
* with every position as an `[x, y]` pair. The stored tile stays as it is.
|
|
5
|
+
* @param tile - the stored tile
|
|
6
|
+
* @returns a new tile with the coordinates as pairs
|
|
8
7
|
*/
|
|
9
|
-
export declare function transformTile(tile: GeoJSONVTInternalTile
|
|
8
|
+
export declare function transformTile(tile: GeoJSONVTInternalTile): GeoJSONVTTile;
|
|
10
9
|
//# sourceMappingURL=transform.d.ts.map
|
package/dist/transform.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../src/transform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../src/transform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,qBAAqB,EAAgC,aAAa,EAAuB,MAAM,eAAe,CAAC;AAE/I;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,qBAAqB,GAAG,aAAa,CAOxE"}
|
package/dist/wrap.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrap.d.ts","sourceRoot":"","sources":["../src/wrap.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"wrap.d.ts","sourceRoot":"","sources":["../src/wrap.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGhF,wBAAgB,IAAI,CAAC,QAAQ,EAAE,wBAAwB,EAAE,EAAE,OAAO,EAAE,gBAAgB,GAAG,wBAAwB,EAAE,CAiBhH"}
|
package/package.json
CHANGED
package/src/clip.test.ts
CHANGED
|
@@ -1,30 +1,51 @@
|
|
|
1
1
|
|
|
2
2
|
import {test, expect} from 'vitest';
|
|
3
3
|
import {clip} from './clip';
|
|
4
|
-
import type {
|
|
4
|
+
import type { GeoJSONVTInternalFeature, GeoJSONVTInternalLineStringFeature, GeoJSONVTInternalMultiPointFeature } from './definitions';
|
|
5
5
|
|
|
6
6
|
const geom1 = [0,0,0,50,0,0,50,10,0,20,10,0,20,20,0,30,20,0,30,30,0,50,30,0,50,40,0,25,40,0,25,50,0,0,50,0,0,60,0,25,60,0];
|
|
7
7
|
const geom2 = [0,0,0,50,0,0,50,10,0,0,10,0];
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* The coordinates of a feature with one ring, which has its number of positions and its size before it.
|
|
11
|
+
*/
|
|
12
|
+
function ring(points: number[], size = 0): Float64Array {
|
|
13
|
+
return new Float64Array([points.length / 3, size, ...points]);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The rings of a feature, each as its `x, y, z` values.
|
|
18
|
+
*/
|
|
19
|
+
function rings(feature: GeoJSONVTInternalFeature): number[][] {
|
|
20
|
+
const geometry = (feature as GeoJSONVTInternalLineStringFeature).geometry;
|
|
21
|
+
const result: number[][] = [];
|
|
22
|
+
for (let i = 0; i < geometry.length; i += 2 + geometry[i] * 3) {
|
|
23
|
+
result.push(Array.from(geometry.subarray(i + 2, i + 2 + geometry[i] * 3)));
|
|
24
|
+
}
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
|
|
9
28
|
test('clips polylines', () => {
|
|
10
29
|
|
|
11
30
|
const clipped = clip([
|
|
12
|
-
{geometry:
|
|
13
|
-
{geometry:
|
|
31
|
+
{geometry: ring(geom1), type: 'LineString', tags: { "1": 1}, minX: 0, minY: 0, maxX: 50, maxY: 60, worldOffset: 0},
|
|
32
|
+
{geometry: ring(geom2), type: 'LineString', tags: { "2": 2}, minX: 0, minY: 0, maxX: 50, maxY: 10, worldOffset: 0}
|
|
14
33
|
], 1, 10, 40, 0, -Infinity, Infinity, {});
|
|
15
34
|
|
|
16
|
-
|
|
17
|
-
{id: null
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
|
|
35
|
+
expect(clipped).toMatchObject([
|
|
36
|
+
{id: null, type: 'MultiLineString', tags: {"1": 1}, minX: 10, minY: 0, maxX: 40, maxY: 60},
|
|
37
|
+
{id: null, type: 'MultiLineString', tags: {"2": 2}, minX: 10, minY: 0, maxX: 40, maxY: 10}
|
|
38
|
+
]);
|
|
39
|
+
expect(rings(clipped[0])).toEqual([
|
|
40
|
+
[10,0,1,40,0,1],
|
|
41
|
+
[40,10,1,20,10,0,20,20,0,30,20,0,30,30,0,40,30,1],
|
|
42
|
+
[40,40,1,25,40,0,25,50,0,10,50,1],
|
|
43
|
+
[10,60,1,25,60,0]
|
|
44
|
+
]);
|
|
45
|
+
expect(rings(clipped[1])).toEqual([
|
|
46
|
+
[10,0,1,40,0,1],
|
|
47
|
+
[40,10,1,10,10,1]
|
|
48
|
+
]);
|
|
28
49
|
});
|
|
29
50
|
|
|
30
51
|
test('clips lines with line metrics on', () => {
|
|
@@ -36,43 +57,42 @@ test('clips lines with line metrics on', () => {
|
|
|
36
57
|
const dy = points[i + 4] - points[i + 1];
|
|
37
58
|
size += Math.sqrt(dx * dx + dy * dy);
|
|
38
59
|
}
|
|
39
|
-
const geom: SliceArray = {points, size, start: 0, end: size};
|
|
40
60
|
|
|
41
|
-
const clipped = clip([{id: 1, geometry:
|
|
61
|
+
const clipped = clip([{id: 1, geometry: ring(points, size), type: 'LineString', tags: {}, minX: 0, minY: 0, maxX: 50, maxY: 60, worldOffset: 0, start: 0, end: size, size}],
|
|
42
62
|
1, 10, 40, 0, -Infinity, Infinity, {lineMetrics: true});
|
|
43
63
|
|
|
44
64
|
expect(
|
|
45
|
-
clipped.map(f => [(f
|
|
65
|
+
clipped.map(f => [(f as GeoJSONVTInternalLineStringFeature).start, (f as GeoJSONVTInternalLineStringFeature).end])).toEqual(
|
|
46
66
|
[[10, 40], [70, 130], [160, 200], [230, 245]]
|
|
47
67
|
);
|
|
48
68
|
});
|
|
49
69
|
|
|
50
|
-
function closed(geometry: number[]):
|
|
51
|
-
return
|
|
70
|
+
function closed(geometry: number[]): Float64Array {
|
|
71
|
+
return ring(geometry.concat(geometry.slice(0, 3)));
|
|
52
72
|
}
|
|
53
73
|
|
|
54
74
|
test('clips polygons', () => {
|
|
55
75
|
|
|
56
76
|
const clipped = clip([
|
|
57
|
-
{geometry: closed(geom1), type: 'Polygon', tags: {"1": 1}, minX: 0, minY: 0, maxX: 50, maxY: 60},
|
|
58
|
-
{geometry: closed(geom2), type: 'Polygon', tags: {"2": 2}, minX: 0, minY: 0, maxX: 50, maxY: 10}
|
|
77
|
+
{geometry: closed(geom1), type: 'Polygon', tags: {"1": 1}, minX: 0, minY: 0, maxX: 50, maxY: 60, worldOffset: 0},
|
|
78
|
+
{geometry: closed(geom2), type: 'Polygon', tags: {"2": 2}, minX: 0, minY: 0, maxX: 50, maxY: 10, worldOffset: 0}
|
|
59
79
|
], 1, 10, 40, 0, -Infinity, Infinity, {});
|
|
60
80
|
|
|
61
|
-
|
|
62
|
-
{id: null
|
|
63
|
-
{id: null
|
|
64
|
-
];
|
|
65
|
-
|
|
66
|
-
expect(
|
|
81
|
+
expect(clipped).toMatchObject([
|
|
82
|
+
{id: null, type: 'Polygon', tags: {"1": 1}, minX: 10, minY: 0, maxX: 40, maxY: 60},
|
|
83
|
+
{id: null, type: 'Polygon', tags: {"2": 2}, minX: 10, minY: 0, maxX: 40, maxY: 10}
|
|
84
|
+
]);
|
|
85
|
+
expect(rings(clipped[0])).toEqual([[10,0,1,40,0,1,40,10,1,20,10,0,20,20,0,30,20,0,30,30,0,40,30,1,40,40,1,25,40,0,25,50,0,10,50,1,10,60,1,25,60,0,10,24,1,10,0,1]]);
|
|
86
|
+
expect(rings(clipped[1])).toEqual([[10,0,1,40,0,1,40,10,1,10,10,1,10,0,1]]);
|
|
67
87
|
});
|
|
68
88
|
|
|
69
89
|
test('clips points', () => {
|
|
70
90
|
|
|
71
91
|
const clipped = clip([
|
|
72
|
-
{geometry: geom1, type: 'MultiPoint', tags: {"1": 1}, minX: 0, minY: 0, maxX: 50, maxY: 60},
|
|
73
|
-
{geometry: geom2, type: 'MultiPoint', tags: {"2": 2}, minX: 0, minY: 0, maxX: 50, maxY: 10}
|
|
92
|
+
{geometry: new Float64Array(geom1), type: 'MultiPoint', tags: {"1": 1}, minX: 0, minY: 0, maxX: 50, maxY: 60, worldOffset: 0},
|
|
93
|
+
{geometry: new Float64Array(geom2), type: 'MultiPoint', tags: {"2": 2}, minX: 0, minY: 0, maxX: 50, maxY: 10, worldOffset: 0}
|
|
74
94
|
], 1, 10, 40, 0, -Infinity, Infinity, {});
|
|
75
95
|
|
|
76
|
-
expect(clipped).
|
|
77
|
-
|
|
96
|
+
expect(clipped).toMatchObject([{id: null, type: 'MultiPoint', tags: {"1": 1}, minX: 20, minY: 10, maxX: 30, maxY: 60}]);
|
|
97
|
+
expect(Array.from((clipped[0] as GeoJSONVTInternalMultiPointFeature).geometry)).toEqual([20,10,0,20,20,0,30,20,0,30,30,0,25,40,0,25,50,0,25,60,0]);
|
|
78
98
|
});
|