@deck.gl/geo-layers 8.9.22 → 8.10.0-alpha.2

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@deck.gl/geo-layers",
3
3
  "description": "deck.gl layers supporting geospatial use cases and GIS formats",
4
4
  "license": "MIT",
5
- "version": "8.9.22",
5
+ "version": "8.10.0-alpha.2",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
@@ -45,7 +45,7 @@
45
45
  "@math.gl/culling": "^3.6.2",
46
46
  "@math.gl/web-mercator": "^3.6.2",
47
47
  "@types/geojson": "^7946.0.8",
48
- "h3-js": "^3.7.0",
48
+ "h3-js": "^4.1.0",
49
49
  "long": "^3.2.0"
50
50
  },
51
51
  "peerDependencies": {
@@ -56,5 +56,5 @@
56
56
  "@loaders.gl/core": "^3.4.2",
57
57
  "@luma.gl/core": "^8.0.0"
58
58
  },
59
- "gitHead": "cc0ff51f4f8b234c7b5015a0e0dced6217433a5b"
59
+ "gitHead": "888ee50db498da4b42697854e79e46cdbb881470"
60
60
  }
@@ -1,8 +1,9 @@
1
- import {h3SetToMultiPolygon, H3IndexInput} from 'h3-js';
1
+ import {cellsToMultiPolygon, H3IndexInput} from 'h3-js';
2
2
 
3
3
  import {AccessorFunction, createIterable, UpdateParameters, DefaultProps} from '@deck.gl/core';
4
4
  import {default as H3HexagonLayer} from './h3-hexagon-layer';
5
5
  import GeoCellLayer, {GeoCellLayerProps} from '../geo-cell-layer/GeoCellLayer';
6
+ import {normalizeLongitudes} from './h3-utils';
6
7
 
7
8
  const defaultProps: DefaultProps<H3ClusterLayerProps> = {
8
9
  getHexagons: {type: 'accessor', value: d => d.hexagons}
@@ -45,9 +46,13 @@ export default class H3ClusterLayer<DataT = any, ExtraProps extends {} = {}> ext
45
46
  for (const object of iterable) {
46
47
  objectInfo.index++;
47
48
  const hexagons = getHexagons(object, objectInfo);
48
- const multiPolygon = h3SetToMultiPolygon(hexagons, true);
49
+ const multiPolygon = cellsToMultiPolygon(hexagons, true);
49
50
 
50
51
  for (const polygon of multiPolygon) {
52
+ // Normalize polygons to prevent wrapping over the anti-meridian
53
+ for (const ring of polygon) {
54
+ normalizeLongitudes(ring);
55
+ }
51
56
  polygons.push(this.getSubLayerRow({polygon}, object, objectInfo.index));
52
57
  }
53
58
  }
@@ -1,14 +1,12 @@
1
1
  import {
2
- h3ToGeoBoundary,
3
- h3GetResolution,
4
- h3ToGeo,
5
- geoToH3,
6
- h3IsPentagon,
7
- h3Distance,
8
- edgeLength,
2
+ getResolution,
3
+ cellToLatLng,
4
+ latLngToCell,
5
+ isPentagon,
6
+ gridDistance,
7
+ getHexagonEdgeLengthAvg,
9
8
  H3Index
10
9
  } from 'h3-js';
11
- import {lerp} from '@math.gl/core';
12
10
  import {
13
11
  AccessorFunction,
14
12
  CompositeLayer,
@@ -20,72 +18,13 @@ import {
20
18
  DefaultProps
21
19
  } from '@deck.gl/core';
22
20
  import {ColumnLayer, PolygonLayer, PolygonLayerProps} from '@deck.gl/layers';
21
+ import {flattenPolygon, getHexagonCentroid, h3ToPolygon} from './h3-utils';
23
22
 
24
23
  // There is a cost to updating the instanced geometries when using highPrecision: false
25
24
  // This constant defines the distance between two hexagons that leads to "significant
26
25
  // distortion." Smaller value makes the column layer more sensitive to viewport change.
27
26
  const UPDATE_THRESHOLD_KM = 10;
28
27
 
29
- // normalize longitudes w.r.t center (refLng), when not provided first vertex
30
- export function normalizeLongitudes(vertices: number[][], refLng?: number): void {
31
- refLng = refLng === undefined ? vertices[0][0] : refLng;
32
- for (const pt of vertices) {
33
- const deltaLng = pt[0] - refLng;
34
- if (deltaLng > 180) {
35
- pt[0] -= 360;
36
- } else if (deltaLng < -180) {
37
- pt[0] += 360;
38
- }
39
- }
40
- }
41
-
42
- // scale polygon vertices w.r.t center (hexId)
43
- export function scalePolygon(hexId: H3Index, vertices: number[][], factor: number): void {
44
- const [lat, lng] = h3ToGeo(hexId);
45
- const actualCount = vertices.length;
46
-
47
- // normalize with respect to center
48
- normalizeLongitudes(vertices, lng);
49
-
50
- // `h3ToGeoBoundary` returns same array object for first and last vertex (closed polygon),
51
- // if so skip scaling the last vertex
52
- const vertexCount = vertices[0] === vertices[actualCount - 1] ? actualCount - 1 : actualCount;
53
- for (let i = 0; i < vertexCount; i++) {
54
- vertices[i][0] = lerp(lng, vertices[i][0], factor);
55
- vertices[i][1] = lerp(lat, vertices[i][1], factor);
56
- }
57
- }
58
-
59
- function getHexagonCentroid(getHexagon, object, objectInfo) {
60
- const hexagonId = getHexagon(object, objectInfo);
61
- const [lat, lng] = h3ToGeo(hexagonId);
62
- return [lng, lat];
63
- }
64
-
65
- function h3ToPolygon(hexId: H3Index, coverage: number = 1): number[][] {
66
- const vertices = h3ToGeoBoundary(hexId, true);
67
-
68
- if (coverage !== 1) {
69
- // scale and normalize vertices w.r.t to center
70
- scalePolygon(hexId, vertices, coverage);
71
- } else {
72
- // normalize w.r.t to start vertex
73
- normalizeLongitudes(vertices);
74
- }
75
-
76
- return vertices;
77
- }
78
-
79
- function flattenPolygon(vertices: number[][]): Float64Array {
80
- const positions = new Float64Array(vertices.length * 2);
81
- let i = 0;
82
- for (const pt of vertices) {
83
- positions[i++] = pt[0];
84
- positions[i++] = pt[1];
85
- }
86
- return positions;
87
- }
88
-
89
28
  function mergeTriggers(getHexagon, coverage) {
90
29
  let trigger;
91
30
  if (getHexagon === undefined || getHexagon === null) {
@@ -199,7 +138,7 @@ export default class H3HexagonLayer<
199
138
  objectInfo.index++;
200
139
  const hexId = this.props.getHexagon(object, objectInfo);
201
140
  // Take the resolution of the first hex
202
- const hexResolution = h3GetResolution(hexId);
141
+ const hexResolution = getResolution(hexId);
203
142
  if (resolution < 0) {
204
143
  resolution = hexResolution;
205
144
  if (!this.props.highPrecision) break;
@@ -207,7 +146,7 @@ export default class H3HexagonLayer<
207
146
  hasMultipleRes = true;
208
147
  break;
209
148
  }
210
- if (h3IsPentagon(hexId)) {
149
+ if (isPentagon(hexId)) {
211
150
  hasPentagon = true;
212
151
  break;
213
152
  }
@@ -215,7 +154,7 @@ export default class H3HexagonLayer<
215
154
 
216
155
  return {
217
156
  resolution,
218
- edgeLengthKM: resolution >= 0 ? edgeLength(resolution, 'km') : 0,
157
+ edgeLengthKM: resolution >= 0 ? getHexagonEdgeLengthAvg(resolution, 'km') : 0,
219
158
  hasMultipleRes,
220
159
  hasPentagon
221
160
  };
@@ -245,23 +184,26 @@ export default class H3HexagonLayer<
245
184
  return;
246
185
  }
247
186
  const hex =
248
- this.props.centerHexagon || geoToH3(viewport.latitude, viewport.longitude, resolution);
187
+ this.props.centerHexagon || latLngToCell(viewport.latitude, viewport.longitude, resolution);
249
188
  if (centerHex === hex) {
250
189
  return;
251
190
  }
252
191
  if (centerHex) {
253
- const distance = h3Distance(centerHex, hex);
254
- // h3Distance returns a negative number if the distance could not be computed
255
- // due to the two indexes very far apart or on opposite sides of a pentagon.
256
- if (distance >= 0 && distance * edgeLengthKM < UPDATE_THRESHOLD_KM) {
257
- return;
192
+ try {
193
+ const distance = gridDistance(centerHex, hex);
194
+ if (distance * edgeLengthKM < UPDATE_THRESHOLD_KM) {
195
+ return;
196
+ }
197
+ } catch {
198
+ // gridDistance throws if the distance could not be computed
199
+ // due to the two indexes very far apart or on opposite sides of a pentagon.
258
200
  }
259
201
  }
260
202
 
261
203
  const {unitsPerMeter} = viewport.distanceScales;
262
204
 
263
205
  let vertices = h3ToPolygon(hex);
264
- const [centerLat, centerLng] = h3ToGeo(hex);
206
+ const [centerLat, centerLng] = cellToLatLng(hex);
265
207
 
266
208
  const [centerX, centerY] = viewport.projectFlat([centerLng, centerLat]);
267
209
  vertices = vertices.map(p => {
@@ -0,0 +1,63 @@
1
+ import {CoordPair, H3IndexInput, cellToBoundary, cellToLatLng} from 'h3-js';
2
+ import {lerp} from '@math.gl/core';
3
+
4
+ // normalize longitudes w.r.t center (refLng), when not provided first vertex
5
+ export function normalizeLongitudes(vertices: CoordPair[], refLng?: number): void {
6
+ refLng = refLng === undefined ? vertices[0][0] : refLng;
7
+ for (const pt of vertices) {
8
+ const deltaLng = pt[0] - refLng;
9
+ if (deltaLng > 180) {
10
+ pt[0] -= 360;
11
+ } else if (deltaLng < -180) {
12
+ pt[0] += 360;
13
+ }
14
+ }
15
+ }
16
+
17
+ // scale polygon vertices w.r.t center (hexId)
18
+ export function scalePolygon(hexId: H3IndexInput, vertices: CoordPair[], factor: number): void {
19
+ const [lat, lng] = cellToLatLng(hexId);
20
+ const actualCount = vertices.length;
21
+
22
+ // normalize with respect to center
23
+ normalizeLongitudes(vertices, lng);
24
+
25
+ // `cellToBoundary` returns same array object for first and last vertex (closed polygon),
26
+ // if so skip scaling the last vertex
27
+ const vertexCount = vertices[0] === vertices[actualCount - 1] ? actualCount - 1 : actualCount;
28
+ for (let i = 0; i < vertexCount; i++) {
29
+ vertices[i][0] = lerp(lng, vertices[i][0], factor);
30
+ vertices[i][1] = lerp(lat, vertices[i][1], factor);
31
+ }
32
+ }
33
+
34
+ // gets hexagon centroid
35
+ export function getHexagonCentroid(getHexagon, object, objectInfo) {
36
+ const hexagonId = getHexagon(object, objectInfo);
37
+ const [lat, lng] = cellToLatLng(hexagonId);
38
+ return [lng, lat];
39
+ }
40
+
41
+ export function h3ToPolygon(hexId: H3IndexInput, coverage: number = 1): number[][] {
42
+ const vertices = cellToBoundary(hexId, true);
43
+
44
+ if (coverage !== 1) {
45
+ // scale and normalize vertices w.r.t to center
46
+ scalePolygon(hexId, vertices, coverage);
47
+ } else {
48
+ // normalize w.r.t to start vertex
49
+ normalizeLongitudes(vertices);
50
+ }
51
+
52
+ return vertices;
53
+ }
54
+
55
+ export function flattenPolygon(vertices: number[][]): Float64Array {
56
+ const positions = new Float64Array(vertices.length * 2);
57
+ let i = 0;
58
+ for (const pt of vertices) {
59
+ positions[i++] = pt[0];
60
+ positions[i++] = pt[1];
61
+ }
62
+ return positions;
63
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"h3-cluster-layer.d.ts","sourceRoot":"","sources":["../../src/h3-layers/h3-cluster-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,YAAY,EAAC,MAAM,OAAO,CAAC;AAExD,OAAO,EAAC,gBAAgB,EAAkB,gBAAgB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAE/F,OAAO,YAAY,EAAE,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AAM/E,kDAAkD;AAClD,oBAAY,mBAAmB,CAAC,KAAK,GAAG,GAAG,IAAI,oBAAoB,CAAC,KAAK,CAAC,GACxE,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAE3B,0CAA0C;AAC1C,aAAK,oBAAoB,CAAC,KAAK,IAAI;IACjC;;;;OAIG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;CACvD,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,cAAc,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,SAAS,EAAE,GAAG,EAAE,CAAE,SAAQ,YAAY,CAC/F,KAAK,EACL,QAAQ,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,GAAG,UAAU,CACnD;IACC,MAAM,CAAC,SAAS,SAAoB;IACpC,MAAM,CAAC,YAAY,yCAAgB;IAEnC,eAAe,IAAI,IAAI;IAIvB,WAAW,CAAC,EAAC,KAAK,EAAE,WAAW,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAuB/D,aAAa,IAAI,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;CAahD"}
1
+ {"version":3,"file":"h3-cluster-layer.d.ts","sourceRoot":"","sources":["../../src/h3-layers/h3-cluster-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,YAAY,EAAC,MAAM,OAAO,CAAC;AAExD,OAAO,EAAC,gBAAgB,EAAkB,gBAAgB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAE/F,OAAO,YAAY,EAAE,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AAO/E,kDAAkD;AAClD,oBAAY,mBAAmB,CAAC,KAAK,GAAG,GAAG,IAAI,oBAAoB,CAAC,KAAK,CAAC,GACxE,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAE3B,0CAA0C;AAC1C,aAAK,oBAAoB,CAAC,KAAK,IAAI;IACjC;;;;OAIG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;CACvD,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,cAAc,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,SAAS,EAAE,GAAG,EAAE,CAAE,SAAQ,YAAY,CAC/F,KAAK,EACL,QAAQ,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,GAAG,UAAU,CACnD;IACC,MAAM,CAAC,SAAS,SAAoB;IACpC,MAAM,CAAC,YAAY,yCAAgB;IAEnC,eAAe,IAAI,IAAI;IAIvB,WAAW,CAAC,EAAC,KAAK,EAAE,WAAW,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IA2B/D,aAAa,IAAI,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;CAahD"}
@@ -1,8 +1,6 @@
1
1
  import { H3Index } from 'h3-js';
2
2
  import { AccessorFunction, CompositeLayer, Layer, LayersList, UpdateParameters, DefaultProps } from '@deck.gl/core/typed';
3
3
  import { PolygonLayerProps } from '@deck.gl/layers/typed';
4
- export declare function normalizeLongitudes(vertices: number[][], refLng?: number): void;
5
- export declare function scalePolygon(hexId: H3Index, vertices: number[][], factor: number): void;
6
4
  /** All properties supported by H3HexagonLayer */
7
5
  export declare type H3HexagonLayerProps<DataT = any> = _H3HexagonLayerProps<DataT> & PolygonLayerProps<DataT>;
8
6
  /** Props added by the H3HexagonLayer */
@@ -1 +1 @@
1
- {"version":3,"file":"h3-hexagon-lay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,CAAC,mBAAmB;IA0B3B,OAAO,CAAC,kBAAkB;CAuB3B"}
@@ -0,0 +1,7 @@
1
+ import { CoordPair, H3IndexInput } from 'h3-js';
2
+ export declare function normalizeLongitudes(vertices: CoordPair[], refLng?: number): void;
3
+ export declare function scalePolygon(hexId: H3IndexInput, vertices: CoordPair[], factor: number): void;
4
+ export declare function getHexagonCentroid(getHexagon: any, object: any, objectInfo: any): number[];
5
+ export declare function h3ToPolygon(hexId: H3IndexInput, coverage?: number): number[][];
6
+ export declare function flattenPolygon(vertices: number[][]): Float64Array;
7
+ //# sourceMappingURL=h3-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"h3-utils.d.ts","sourceRoot":"","sources":["../../src/h3-layers/h3-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,YAAY,EAA+B,MAAM,OAAO,CAAC;AAI5E,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAUhF;AAGD,wBAAgB,YAAY,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAc7F;AAGD,wBAAgB,kBAAkB,CAAC,UAAU,KAAA,EAAE,MAAM,KAAA,EAAE,UAAU,KAAA,YAIhE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,GAAE,MAAU,GAAG,MAAM,EAAE,EAAE,CAYjF;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,GAAG,YAAY,CAQjE"}