webdggrid 1.5.0 → 1.7.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.
Files changed (137) hide show
  1. package/dist/webdggrid.js +1 -1
  2. package/dist/webdggrid.js.map +1 -1
  3. package/dist/webdggrid.umd.js +1 -1
  4. package/dist/webdggrid.umd.js.map +1 -1
  5. package/lib-esm/libdggrid.wasm.js +1 -1
  6. package/lib-esm/tsconfig.tsbuildinfo +1 -1
  7. package/lib-esm/webdggrid.js +1218 -16
  8. package/lib-esm/webdggrid.js.map +1 -1
  9. package/lib-wasm/CMakeCache.txt +3 -3
  10. package/lib-wasm/CMakeFiles/3.31.6/CMakeCCompiler.cmake +6 -6
  11. package/lib-wasm/CMakeFiles/3.31.6/CMakeCXXCompiler.cmake +6 -6
  12. package/lib-wasm/CMakeFiles/3.31.6/CMakeSystem.cmake +1 -1
  13. package/lib-wasm/CMakeFiles/Makefile.cmake +1 -1
  14. package/lib-wasm/CMakeFiles/libdggrid.dir/build.make +339 -339
  15. package/lib-wasm/CMakeFiles/libdggrid.dir/flags.make +2 -2
  16. package/lib-wasm/CMakeFiles/libdggrid.dir/link.txt +1 -1
  17. package/lib-wasm/CMakeFiles/libdggrid.dir/src-cpp/dggrid_transform.cpp.o +0 -0
  18. package/lib-wasm/CMakeFiles/libdggrid.dir/src-cpp/dggrid_transform.cpp.o.d +680 -673
  19. package/lib-wasm/CMakeFiles/libdggrid.dir/src-cpp/webdggrid.cpp.o +0 -0
  20. package/lib-wasm/CMakeFiles/libdggrid.dir/src-cpp/webdggrid.cpp.o.d +693 -693
  21. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgAddressBase.cpp.o.d +663 -663
  22. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgAddressType.cpp.o.d +663 -663
  23. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgApSeq.cpp.o.d +670 -670
  24. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgBase.cpp.o.d +663 -663
  25. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgBoundedHexC2RF2D.cpp.o.d +672 -672
  26. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgBoundedHexC3C2RF2D.cpp.o.d +672 -672
  27. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgBoundedHexC3RF2D.cpp.o.d +672 -672
  28. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgBoundedIDGG.cpp.o.d +672 -672
  29. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgBoundedIDGGS.cpp.o.d +672 -672
  30. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgBoundedRF2D.cpp.o.d +672 -672
  31. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgBoundedRFBase0.cpp.o.d +672 -672
  32. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgBoundedRFS2D.cpp.o.d +672 -672
  33. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgCell.cpp.o.d +672 -672
  34. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgColor.cpp.o.d +670 -670
  35. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgConverterBase.cpp.o.d +672 -672
  36. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgDVec2D.cpp.o.d +672 -672
  37. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgDVec3D.cpp.o.d +672 -672
  38. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgDataFieldBase.cpp.o.d +663 -663
  39. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgDataList.cpp.o.d +663 -663
  40. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgDiscRFS2D.cpp.o.d +672 -672
  41. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgDistanceBase.cpp.o.d +672 -672
  42. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgDmdD4Grid2D.cpp.o.d +672 -672
  43. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgDmdD4Grid2DS.cpp.o.d +672 -672
  44. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgDmdD8Grid2D.cpp.o.d +672 -672
  45. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgDmdD8Grid2DS.cpp.o.d +672 -672
  46. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgDmdIDGG.cpp.o.d +672 -672
  47. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgEllipsoidRF.cpp.o.d +672 -672
  48. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgGeoSphRF.cpp.o.d +672 -672
  49. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgGridTopo.cpp.o.d +663 -663
  50. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgHexC1Grid2D.cpp.o.d +672 -672
  51. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgHexC2Grid2D.cpp.o.d +672 -672
  52. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgHexC3Grid2D.cpp.o.d +672 -672
  53. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgHexGrid2DS.cpp.o.d +672 -672
  54. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgHexIDGG.cpp.o.d +672 -672
  55. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgHexIDGGS.cpp.o.d +672 -672
  56. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgIDGG.cpp.o.d +672 -672
  57. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgIDGGBase.cpp.o.d +672 -672
  58. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgIDGGS.cpp.o.d +672 -672
  59. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgIDGGS3H.cpp.o.d +672 -672
  60. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgIDGGS43H.cpp.o.d +672 -672
  61. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgIDGGS4D.cpp.o.d +672 -672
  62. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgIDGGS4H.cpp.o.d +672 -672
  63. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgIDGGS4T.cpp.o.d +672 -672
  64. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgIDGGS7H.cpp.o.d +672 -672
  65. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgIDGGSBase.cpp.o.d +672 -672
  66. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgIDGGutil.cpp.o.d +672 -672
  67. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgIVec2D.cpp.o.d +672 -672
  68. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgIVec3D.cpp.o.d +672 -672
  69. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgIcosaMap.cpp.o.d +672 -672
  70. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgInAIGenFile.cpp.o.d +692 -692
  71. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgInLocStreamFile.cpp.o.d +683 -683
  72. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgInLocTextFile.cpp.o.d +692 -692
  73. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgInShapefile.cpp.o.d +692 -692
  74. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgInShapefileAtt.cpp.o.d +696 -696
  75. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgInputStream.cpp.o.d +683 -683
  76. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgLocBase.cpp.o.d +663 -663
  77. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgLocList.cpp.o.d +673 -673
  78. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgLocVector.cpp.o.d +672 -672
  79. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgLocation.cpp.o.d +672 -672
  80. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgOutAIGenFile.cpp.o.d +692 -692
  81. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgOutChildrenFile.cpp.o.d +691 -691
  82. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgOutGeoJSONFile.cpp.o.d +692 -692
  83. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgOutKMLfile.cpp.o.d +692 -692
  84. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgOutLocFile.cpp.o.d +696 -696
  85. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgOutLocTextFile.cpp.o.d +690 -690
  86. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgOutNeighborsFile.cpp.o.d +691 -691
  87. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgOutPRCellsFile.cpp.o.d +692 -692
  88. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgOutPRPtsFile.cpp.o.d +692 -692
  89. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgOutPtsText.cpp.o.d +692 -692
  90. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgOutRandPtsText.cpp.o.d +692 -692
  91. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgOutShapefile.cpp.o.d +699 -699
  92. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgOutputStream.cpp.o.d +683 -683
  93. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgPolygon.cpp.o.d +672 -672
  94. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgProjFuller.cpp.o.d +672 -672
  95. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgProjGnomonicRF.cpp.o.d +672 -672
  96. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgProjISEA.cpp.o.d +672 -672
  97. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgProjTriRF.cpp.o.d +672 -672
  98. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgRFBase.cpp.o.d +673 -673
  99. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgRFNetwork.cpp.o.d +672 -672
  100. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgRandom.cpp.o.d +672 -672
  101. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgSeriesConverter.cpp.o.d +673 -673
  102. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgSqrD4Grid2D.cpp.o.d +672 -672
  103. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgSqrD4Grid2DS.cpp.o.d +672 -672
  104. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgSqrD8Grid2D.cpp.o.d +672 -672
  105. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgSqrD8Grid2DS.cpp.o.d +672 -672
  106. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgSuperfund.cpp.o.d +663 -663
  107. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgTriGrid2D.cpp.o.d +672 -672
  108. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgTriGrid2DS.cpp.o.d +672 -672
  109. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgTriIDGG.cpp.o.d +672 -672
  110. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgUtil.cpp.o.d +670 -670
  111. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgZ3RF.cpp.o.d +675 -675
  112. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgZ3StringRF.cpp.o.d +672 -672
  113. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgZ7RF.cpp.o.d +675 -675
  114. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgZ7StringRF.cpp.o.d +672 -672
  115. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgZOrderRF.cpp.o.d +675 -675
  116. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/dglib/lib/DgZOrderStringRF.cpp.o.d +672 -672
  117. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/proj4lib/lib/adjlon.cpp.o.d +129 -129
  118. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/proj4lib/lib/pj_auth.cpp.o.d +133 -133
  119. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/proj4lib/lib/pj_mlfn.cpp.o.d +133 -133
  120. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/proj4lib/lib/pj_msfn.cpp.o.d +132 -132
  121. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/proj4lib/lib/pj_phi2.cpp.o.d +133 -133
  122. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/proj4lib/lib/pj_qsfn.cpp.o.d +129 -129
  123. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/proj4lib/lib/pj_tsfn.cpp.o.d +129 -129
  124. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/shapelib/lib/dbfopen.c.o.d +25 -25
  125. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/shapelib/lib/safileio.c.o.d +28 -28
  126. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/shapelib/lib/sbnsearch.c.o.d +25 -25
  127. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/shapelib/lib/shpopen.c.o.d +30 -30
  128. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/shapelib/lib/shptree.c.o.d +28 -28
  129. package/lib-wasm/CMakeFiles/libdggrid.dir/submodules/DGGRID/src/lib/shapelib/lib/shputils.c.o.d +22 -22
  130. package/lib-wasm/cmake_install.cmake +1 -1
  131. package/lib-wasm/libdggrid.js +1 -1
  132. package/lib-wasm/libdggrid.wasm +0 -0
  133. package/package.json +1 -1
  134. package/readme.md +64 -3
  135. package/src-ts/webdggrid.ts +1559 -6
  136. package/types/webdggrid.d.ts +793 -1
  137. package/types/webdggrid.d.ts.map +1 -1
@@ -63,6 +63,24 @@ export interface Coordinate {
63
63
  /** Longitude in decimal degrees. Range: −180 to 180. */
64
64
  lng: number;
65
65
  }
66
+ /**
67
+ * VERTEX2DD coordinate representation.
68
+ *
69
+ * Represents a position relative to the icosahedron vertices and triangular
70
+ * faces in DGGRID's coordinate system.
71
+ */
72
+ export interface Vertex2DDCoordinate {
73
+ /** Whether to keep this vertex. */
74
+ keep: boolean;
75
+ /** Vertex number (0-11 for icosahedron). */
76
+ vertNum: number;
77
+ /** Triangle number on the icosahedron. */
78
+ triNum: number;
79
+ /** X coordinate within the triangle. */
80
+ x: number;
81
+ /** Y coordinate within the triangle. */
82
+ y: number;
83
+ }
66
84
  /**
67
85
  * GeoJSON `properties` object attached to every cell feature returned by
68
86
  * {@link Webdggrid.sequenceNumToGridFeatureCollection}.
@@ -131,8 +149,28 @@ export interface IDGGSProps {
131
149
  * | 7 | 2 + 10 × 7^r |
132
150
  *
133
151
  * Aperture `4` is the most common choice and is the default.
152
+ * Ignored if `apertureSequence` is specified.
134
153
  */
135
- aperture: 3 | 4 | 5 | 7;
154
+ aperture?: 3 | 4 | 5 | 7;
155
+ /**
156
+ * Mixed aperture sequence (e.g., `"434747"`).
157
+ *
158
+ * When specified, each character defines the aperture for that resolution level.
159
+ * The maximum resolution is limited to the length of the sequence string.
160
+ *
161
+ * **Constraints:**
162
+ * - Only valid for `HEXAGON` topology
163
+ * - Only characters `'3'`, `'4'`, and `'7'` are allowed
164
+ * - SEQNUM addressing is not supported (operations will fail)
165
+ * - Z3/Z7 hierarchical indexing is not supported
166
+ *
167
+ * @example
168
+ * ```ts
169
+ * // Resolution 1 uses aperture 4, res 2 uses aperture 3, etc.
170
+ * apertureSequence: "434747"
171
+ * ```
172
+ */
173
+ apertureSequence?: string;
136
174
  /** Shape of each cell. See {@link Topology}. */
137
175
  topology: Topology;
138
176
  /** Projection used to map the polyhedron faces onto the sphere. See {@link Projection}. */
@@ -500,5 +538,759 @@ export declare class Webdggrid {
500
538
  * input cell ID.
501
539
  */
502
540
  sequenceNumToGridFeatureCollection(sequenceNum: bigint[], resolution?: number): FeatureCollection<Polygon, DGGSGeoJsonProperty>;
541
+ /**
542
+ * Returns all neighboring cells (sharing an edge) for each input cell.
543
+ *
544
+ * For hexagonal grids, each interior cell typically has 6 neighbors.
545
+ * Pentagon cells and boundary cells may have fewer. Triangle topology
546
+ * is not supported by the underlying DGGRID library.
547
+ *
548
+ * The output is a 2-D array: `result[i]` contains all neighbors of
549
+ * `sequenceNum[i]`.
550
+ *
551
+ * ```ts
552
+ * const neighbors = dggs.sequenceNumNeighbors([123n], 5);
553
+ * // neighbors[0] = [122n, 124n, 125n, 126n, 127n, 128n]
554
+ * ```
555
+ *
556
+ * ::: warning
557
+ * Triangle topology is **not supported**. Attempting to retrieve neighbors
558
+ * for a TRIANGLE grid will throw an error.
559
+ * :::
560
+ *
561
+ * @param sequenceNum - Array of `BigInt` cell IDs whose neighbors to find.
562
+ * @param resolution - Resolution at which the IDs were generated. Defaults
563
+ * to the instance's current {@link resolution}.
564
+ * @returns A 2-D array of `BigInt[]`: `result[i]` is the array of neighbor
565
+ * IDs for `sequenceNum[i]`.
566
+ * @throws If Triangle topology is used or if an invalid cell ID is provided.
567
+ */
568
+ sequenceNumNeighbors(sequenceNum: bigint[], resolution?: number): bigint[][];
569
+ /**
570
+ * Returns the parent cell at the next coarser resolution (resolution - 1)
571
+ * for each input cell.
572
+ *
573
+ * The parent-child relationship forms a hierarchical index structure. For
574
+ * aperture 4 grids, each parent contains 4 children; for aperture 7, each
575
+ * parent contains 7 children.
576
+ *
577
+ * ```ts
578
+ * const parents = dggs.sequenceNumParent([123n, 456n], 5);
579
+ * // parents = [30n, 114n] (at resolution 4)
580
+ * ```
581
+ *
582
+ * ::: info
583
+ * Calling this method at resolution 0 will throw an error because there
584
+ * are no cells at resolution -1.
585
+ * :::
586
+ *
587
+ * @param sequenceNum - Array of `BigInt` cell IDs whose parents to find.
588
+ * @param resolution - Resolution at which the input IDs were generated.
589
+ * Must be > 0. Defaults to the instance's current {@link resolution}.
590
+ * @returns Array of `BigInt` parent cell IDs at resolution - 1, one per
591
+ * input cell, in the same order.
592
+ * @throws If resolution is 0 or if an invalid cell ID is provided.
593
+ */
594
+ sequenceNumParent(sequenceNum: bigint[], resolution?: number): bigint[];
595
+ /**
596
+ * Returns **all** parent cells that touch each input cell at the coarser
597
+ * resolution (resolution - 1).
598
+ *
599
+ * Unlike {@link sequenceNumParent} which returns only the primary
600
+ * (containing) parent, this method returns every parent cell whose area
601
+ * overlaps with the child cell. For interior cells this is typically 1;
602
+ * for cells on a parent boundary it may be 2 or more.
603
+ *
604
+ * The **first element** of each inner array is always the primary
605
+ * (containing) parent — the same value returned by
606
+ * {@link sequenceNumParent}.
607
+ *
608
+ * ```ts
609
+ * const allParents = dggs.sequenceNumAllParents([256n], 3);
610
+ * // allParents[0] = [65n, 66n] — 65 is the containing parent,
611
+ * // 66 is a touching neighbor parent
612
+ * ```
613
+ *
614
+ * @param sequenceNum - Array of `BigInt` cell IDs to query.
615
+ * @param resolution - Resolution at which the input IDs were generated
616
+ * (must be > 0). Defaults to the instance's current {@link resolution}.
617
+ * @returns A 2-D array: `result[i]` contains all parent cell IDs that
618
+ * touch `sequenceNum[i]`, with the primary parent first.
619
+ * @throws If `resolution` is 0 or negative, or if an invalid cell ID is
620
+ * provided.
621
+ */
622
+ sequenceNumAllParents(sequenceNum: bigint[], resolution?: number): bigint[][];
623
+ /**
624
+ * Returns all child cells at the next finer resolution (resolution + 1)
625
+ * for each input cell.
626
+ *
627
+ * The number of children depends on the aperture:
628
+ * - Aperture 3: 3 children per parent
629
+ * - Aperture 4: 4 children per parent
630
+ * - Aperture 7: 7 children per parent
631
+ *
632
+ * The output is a 2-D array: `result[i]` contains all children of
633
+ * `sequenceNum[i]`.
634
+ *
635
+ * ```ts
636
+ * const children = dggs.sequenceNumChildren([30n], 4);
637
+ * // children[0] = [120n, 121n, 122n, 123n] (at resolution 5, aperture 4)
638
+ * ```
639
+ *
640
+ * ::: info
641
+ * Children always include both boundary and interior cells. The returned
642
+ * cells completely cover the parent cell's area.
643
+ * :::
644
+ *
645
+ * @param sequenceNum - Array of `BigInt` cell IDs whose children to find.
646
+ * @param resolution - Resolution at which the input IDs were generated.
647
+ * Defaults to the instance's current {@link resolution}.
648
+ * @returns A 2-D array of `BigInt[]`: `result[i]` is the array of child
649
+ * IDs for `sequenceNum[i]` at resolution + 1.
650
+ * @throws If an invalid cell ID is provided or if the maximum resolution
651
+ * is exceeded.
652
+ */
653
+ sequenceNumChildren(sequenceNum: bigint[], resolution?: number): bigint[][];
654
+ /**
655
+ * Convert a SEQNUM cell ID to VERTEX2DD (icosahedral vertex) coordinates.
656
+ *
657
+ * VERTEX2DD addresses represent positions relative to the vertices and
658
+ * triangular faces of the underlying icosahedron.
659
+ *
660
+ * ```ts
661
+ * const vertex = dggs.sequenceNumToVertex2DD(100n, 5);
662
+ * // vertex = { keep: true, vertNum: 1, triNum: 1, x: 0.0625, y: 0.054... }
663
+ * ```
664
+ *
665
+ * @param sequenceNum - The cell sequence number to convert.
666
+ * @param resolution - Resolution of the input cell. Defaults to the
667
+ * instance's current {@link resolution}.
668
+ * @returns An object with `{keep, vertNum, triNum, x, y}` representing
669
+ * the vertex coordinate.
670
+ */
671
+ sequenceNumToVertex2DD(sequenceNum: bigint, resolution?: number): Vertex2DDCoordinate;
672
+ /**
673
+ * Convert VERTEX2DD (icosahedral vertex) coordinates to a SEQNUM cell ID.
674
+ *
675
+ * ```ts
676
+ * const seqnum = dggs.vertex2DDToSequenceNum(true, 1, 1, 0.0625, 0.054, 5);
677
+ * // seqnum = 100n
678
+ * ```
679
+ *
680
+ * @param keep - Whether to keep this vertex.
681
+ * @param vertNum - Vertex number (0-11 for icosahedron).
682
+ * @param triNum - Triangle number on the icosahedron.
683
+ * @param x - X coordinate within the triangle.
684
+ * @param y - Y coordinate within the triangle.
685
+ * @param resolution - Resolution at which to compute the cell ID. Defaults
686
+ * to the instance's current {@link resolution}.
687
+ * @returns The sequence number (BigInt) of the cell containing this coordinate.
688
+ */
689
+ vertex2DDToSequenceNum(keep: boolean, vertNum: number, triNum: number, x: number, y: number, resolution?: number): bigint;
690
+ /**
691
+ * Convert a SEQNUM cell ID to ZORDER (Z-order curve) coordinate.
692
+ *
693
+ * ZORDER uses digit-interleaved coordinates to create a space-filling
694
+ * curve index. This provides good spatial locality for range queries.
695
+ *
696
+ * **Compatibility:** ZORDER is only available for **aperture 3 and 4**
697
+ * hexagon grids. It is **NOT supported** for aperture 7.
698
+ *
699
+ * ```ts
700
+ * // With aperture 4:
701
+ * const zorder = dggs.sequenceNumToZOrder(100n, 5);
702
+ * // zorder = 1168684103302643712n
703
+ * ```
704
+ *
705
+ * @param sequenceNum - The cell sequence number to convert.
706
+ * @param resolution - Resolution of the input cell. Defaults to the
707
+ * instance's current {@link resolution}.
708
+ * @returns A BigInt representing the Z-order coordinate.
709
+ * @throws If used with an incompatible aperture (7) or topology.
710
+ */
711
+ sequenceNumToZOrder(sequenceNum: bigint, resolution?: number): bigint;
712
+ /**
713
+ * Convert a ZORDER (Z-order curve) coordinate to a SEQNUM cell ID.
714
+ *
715
+ * ```ts
716
+ * const seqnum = dggs.zOrderToSequenceNum(1168684103302643712n, 5);
717
+ * // seqnum = 100n
718
+ * ```
719
+ *
720
+ * @param zorderValue - The Z-order coordinate value (BigInt).
721
+ * @param resolution - Resolution at which to compute the cell ID. Defaults
722
+ * to the instance's current {@link resolution}.
723
+ * @returns The sequence number (BigInt) corresponding to this Z-order value.
724
+ * @throws If used with an incompatible aperture (7) or topology.
725
+ */
726
+ zOrderToSequenceNum(zorderValue: bigint, resolution?: number): bigint;
727
+ /**
728
+ * Convert a SEQNUM cell ID to Z3 (base-3 Central Place Indexing) coordinate.
729
+ *
730
+ * Z3 uses base-3 digit encoding optimized for aperture 3 hexagon grids.
731
+ * Each parent cell contains exactly 3 children in the hierarchy.
732
+ *
733
+ * **Compatibility:** Z3 is **only available for aperture 3** hexagon grids.
734
+ *
735
+ * ```ts
736
+ * // With aperture 3:
737
+ * const z3 = dggs.sequenceNumToZ3(100n, 5);
738
+ * // z3 = 1773292353277132799n
739
+ * ```
740
+ *
741
+ * @param sequenceNum - The cell sequence number to convert.
742
+ * @param resolution - Resolution of the input cell. Defaults to the
743
+ * instance's current {@link resolution}.
744
+ * @returns A BigInt representing the Z3 coordinate (INT64 format).
745
+ * @throws If used with an incompatible aperture (not 3) or topology.
746
+ */
747
+ sequenceNumToZ3(sequenceNum: bigint, resolution?: number): bigint;
748
+ /**
749
+ * Convert a Z3 (base-3 Central Place Indexing) coordinate to a SEQNUM cell ID.
750
+ *
751
+ * ```ts
752
+ * const seqnum = dggs.z3ToSequenceNum(1773292353277132799n, 5);
753
+ * // seqnum = 100n
754
+ * ```
755
+ *
756
+ * @param z3Value - The Z3 coordinate value (BigInt, INT64 format).
757
+ * @param resolution - Resolution at which to compute the cell ID. Defaults
758
+ * to the instance's current {@link resolution}.
759
+ * @returns The sequence number (BigInt) corresponding to this Z3 value.
760
+ * @throws If used with an incompatible aperture (not 3) or topology.
761
+ */
762
+ z3ToSequenceNum(z3Value: bigint, resolution?: number): bigint;
763
+ /**
764
+ * Convert a SEQNUM cell ID to Z7 (base-7 Central Place Indexing) coordinate.
765
+ *
766
+ * Z7 uses base-7 digit encoding with pure bitarithmetic operations,
767
+ * optimized for aperture 7 hexagon grids. Each parent cell contains
768
+ * exactly 7 children in the hierarchy.
769
+ *
770
+ * **Compatibility:** Z7 is **only available for aperture 7** hexagon grids.
771
+ *
772
+ * ```ts
773
+ * // With aperture 7:
774
+ * const z7 = dggs.sequenceNumToZ7(100n, 5);
775
+ * // z7 = 1153167795211468799n (displayed as hex: 0x1000000000000fff)
776
+ * ```
777
+ *
778
+ * @param sequenceNum - The cell sequence number to convert.
779
+ * @param resolution - Resolution of the input cell. Defaults to the
780
+ * instance's current {@link resolution}.
781
+ * @returns A BigInt representing the Z7 coordinate (INT64/hex format).
782
+ * @throws If used with an incompatible aperture (not 7) or topology.
783
+ */
784
+ sequenceNumToZ7(sequenceNum: bigint, resolution?: number): bigint;
785
+ /**
786
+ * Convert a Z7 (base-7 Central Place Indexing) coordinate to a SEQNUM cell ID.
787
+ *
788
+ * ```ts
789
+ * const seqnum = dggs.z7ToSequenceNum(1153167795211468799n, 5);
790
+ * // seqnum = 100n
791
+ * ```
792
+ *
793
+ * @param z7Value - The Z7 coordinate value (BigInt, INT64/hex format).
794
+ * @param resolution - Resolution at which to compute the cell ID. Defaults
795
+ * to the instance's current {@link resolution}.
796
+ * @returns The sequence number (BigInt) corresponding to this Z7 value.
797
+ * @throws If used with an incompatible aperture (not 7) or topology.
798
+ */
799
+ z7ToSequenceNum(z7Value: bigint, resolution?: number): bigint;
800
+ /** @internal */ static readonly Z7_MAX_RES = 20;
801
+ /** @internal */ static readonly Z7_BITS_PER_DIGIT = 3n;
802
+ /** @internal */ static readonly Z7_DIGIT_MASK = 7n;
803
+ /** @internal */ static readonly Z7_QUAD_OFFSET = 60n;
804
+ /** @internal */ static readonly Z7_QUAD_MASK = 17293822569102704640n;
805
+ /** @internal */ static readonly Z3_MAX_RES = 30;
806
+ /** @internal */ static readonly Z3_BITS_PER_DIGIT = 2n;
807
+ /** @internal */ static readonly Z3_DIGIT_MASK = 3n;
808
+ /** @internal */ static readonly Z3_QUAD_OFFSET = 60n;
809
+ /** @internal */ static readonly Z3_QUAD_MASK = 17293822569102704640n;
810
+ /** @internal */ static readonly ZORDER_MAX_RES = 30;
811
+ /** @internal */ static readonly ZORDER_BITS_PER_DIGIT = 2n;
812
+ /** @internal */ static readonly ZORDER_DIGIT_MASK = 3n;
813
+ /** @internal */ static readonly ZORDER_QUAD_OFFSET = 60n;
814
+ /** @internal */ static readonly ZORDER_QUAD_MASK = 17293822569102704640n;
815
+ /**
816
+ * Get the quad (icosahedron face) number from a Z7 index.
817
+ *
818
+ * The quad occupies bits 63–60 of the 64-bit packed value.
819
+ *
820
+ * ```ts
821
+ * const quad = dggs.z7GetQuad(z7Value); // 0–11
822
+ * ```
823
+ *
824
+ * @param z7Value - A Z7 packed index (BigInt).
825
+ * @returns The quad number (0–11).
826
+ */
827
+ z7GetQuad(z7Value: bigint): number;
828
+ /**
829
+ * Get the digit at a specific resolution level from a Z7 index.
830
+ *
831
+ * Each digit is 3 bits wide and occupies a fixed position in the 64-bit value.
832
+ * Valid digits are 0–6; the value 7 is the invalid/padding marker.
833
+ *
834
+ * ```ts
835
+ * const digit = dggs.z7GetDigit(z7Value, 3); // 0–6 (or 7 = invalid)
836
+ * ```
837
+ *
838
+ * @param z7Value - A Z7 packed index (BigInt).
839
+ * @param res - Resolution level (1-based, 1 to 20).
840
+ * @returns The digit value (0–7).
841
+ */
842
+ z7GetDigit(z7Value: bigint, res: number): number;
843
+ /**
844
+ * Set the digit at a specific resolution level in a Z7 index.
845
+ *
846
+ * Returns a new Z7 value with the digit at position `res` replaced.
847
+ *
848
+ * ```ts
849
+ * const child = dggs.z7SetDigit(z7Value, 6, 3); // set res-6 digit to 3
850
+ * ```
851
+ *
852
+ * @param z7Value - A Z7 packed index (BigInt).
853
+ * @param res - Resolution level (1-based, 1 to 20).
854
+ * @param digit - The digit value to set (0–6, or 7 for invalid).
855
+ * @returns A new Z7 value with the digit replaced.
856
+ */
857
+ z7SetDigit(z7Value: bigint, res: number, digit: number): bigint;
858
+ /**
859
+ * Extract all digits from a Z7 index up to a given resolution.
860
+ *
861
+ * ```ts
862
+ * const { quad, digits } = dggs.z7ExtractDigits(z7Value, 5);
863
+ * // quad: 1, digits: [2, 0, 3, 4, 1]
864
+ * ```
865
+ *
866
+ * @param z7Value - A Z7 packed index (BigInt).
867
+ * @param resolution - Number of digits to extract (1-based).
868
+ * @returns Object with `quad` (number) and `digits` (number array).
869
+ */
870
+ z7ExtractDigits(z7Value: bigint, resolution: number): {
871
+ quad: number;
872
+ digits: number[];
873
+ };
874
+ /**
875
+ * Get the quad (icosahedron face) number from a Z3 index.
876
+ *
877
+ * ```ts
878
+ * const quad = dggs.z3GetQuad(z3Value); // 0–11
879
+ * ```
880
+ *
881
+ * @param z3Value - A Z3 packed index (BigInt).
882
+ * @returns The quad number (0–11).
883
+ */
884
+ z3GetQuad(z3Value: bigint): number;
885
+ /**
886
+ * Get the digit at a specific resolution level from a Z3 index.
887
+ *
888
+ * Each digit is 2 bits wide. Valid digits are 0–2; the value 3 is the
889
+ * invalid/padding marker.
890
+ *
891
+ * ```ts
892
+ * const digit = dggs.z3GetDigit(z3Value, 3); // 0–2 (or 3 = invalid)
893
+ * ```
894
+ *
895
+ * @param z3Value - A Z3 packed index (BigInt).
896
+ * @param res - Resolution level (1-based, 1 to 30).
897
+ * @returns The digit value (0–3).
898
+ */
899
+ z3GetDigit(z3Value: bigint, res: number): number;
900
+ /**
901
+ * Set the digit at a specific resolution level in a Z3 index.
902
+ *
903
+ * ```ts
904
+ * const child = dggs.z3SetDigit(z3Value, 6, 1); // set res-6 digit to 1
905
+ * ```
906
+ *
907
+ * @param z3Value - A Z3 packed index (BigInt).
908
+ * @param res - Resolution level (1-based, 1 to 30).
909
+ * @param digit - The digit value to set (0–2, or 3 for invalid).
910
+ * @returns A new Z3 value with the digit replaced.
911
+ */
912
+ z3SetDigit(z3Value: bigint, res: number, digit: number): bigint;
913
+ /**
914
+ * Extract all digits from a Z3 index up to a given resolution.
915
+ *
916
+ * ```ts
917
+ * const { quad, digits } = dggs.z3ExtractDigits(z3Value, 5);
918
+ * // quad: 1, digits: [1, 0, 2, 1, 0]
919
+ * ```
920
+ *
921
+ * @param z3Value - A Z3 packed index (BigInt).
922
+ * @param resolution - Number of digits to extract (1-based).
923
+ * @returns Object with `quad` (number) and `digits` (number array).
924
+ */
925
+ z3ExtractDigits(z3Value: bigint, resolution: number): {
926
+ quad: number;
927
+ digits: number[];
928
+ };
929
+ /**
930
+ * Get the quad (icosahedron face) number from a ZORDER index.
931
+ *
932
+ * ```ts
933
+ * const quad = dggs.zOrderGetQuad(zorderValue); // 0–11
934
+ * ```
935
+ *
936
+ * @param zorderValue - A ZORDER packed index (BigInt).
937
+ * @returns The quad number (0–11).
938
+ */
939
+ zOrderGetQuad(zorderValue: bigint): number;
940
+ /**
941
+ * Get the digit at a specific resolution level from a ZORDER index.
942
+ *
943
+ * Each digit is 2 bits wide (values 0–3).
944
+ *
945
+ * ```ts
946
+ * const digit = dggs.zOrderGetDigit(zorderValue, 3); // 0–3
947
+ * ```
948
+ *
949
+ * @param zorderValue - A ZORDER packed index (BigInt).
950
+ * @param res - Resolution level (1-based, 1 to 30).
951
+ * @returns The digit value (0–3).
952
+ */
953
+ zOrderGetDigit(zorderValue: bigint, res: number): number;
954
+ /**
955
+ * Set the digit at a specific resolution level in a ZORDER index.
956
+ *
957
+ * ```ts
958
+ * const modified = dggs.zOrderSetDigit(zorderValue, 3, 2);
959
+ * ```
960
+ *
961
+ * @param zorderValue - A ZORDER packed index (BigInt).
962
+ * @param res - Resolution level (1-based, 1 to 30).
963
+ * @param digit - The digit value to set (0–3).
964
+ * @returns A new ZORDER value with the digit replaced.
965
+ */
966
+ zOrderSetDigit(zorderValue: bigint, res: number, digit: number): bigint;
967
+ /**
968
+ * Extract all digits from a ZORDER index up to a given resolution.
969
+ *
970
+ * ```ts
971
+ * const { quad, digits } = dggs.zOrderExtractDigits(zorderValue, 5);
972
+ * // quad: 1, digits: [2, 0, 3, 1, 0]
973
+ * ```
974
+ *
975
+ * @param zorderValue - A ZORDER packed index (BigInt).
976
+ * @param resolution - Number of digits to extract (1-based).
977
+ * @returns Object with `quad` (number) and `digits` (number array).
978
+ */
979
+ zOrderExtractDigits(zorderValue: bigint, resolution: number): {
980
+ quad: number;
981
+ digits: number[];
982
+ };
983
+ /**
984
+ * Helper to build the DGGS parameter array for WASM calls.
985
+ * @private
986
+ */
987
+ private _getParams;
988
+ /**
989
+ * Converts geographic coordinates to PLANE coordinates.
990
+ *
991
+ * @param coordinates - Array of `[lng, lat]` pairs
992
+ * @param resolution - Resolution level
993
+ * @returns Array of `{x, y}` plane coordinates
994
+ */
995
+ geoToPlane(coordinates: number[][], resolution?: number): Array<{
996
+ x: number;
997
+ y: number;
998
+ }>;
999
+ /**
1000
+ * Converts geographic coordinates to PROJTRI coordinates.
1001
+ *
1002
+ * @param coordinates - Array of `[lng, lat]` pairs
1003
+ * @param resolution - Resolution level
1004
+ * @returns Array of `{tnum, x, y}` projection triangle coordinates
1005
+ */
1006
+ geoToProjtri(coordinates: number[][], resolution?: number): Array<{
1007
+ tnum: number;
1008
+ x: number;
1009
+ y: number;
1010
+ }>;
1011
+ /**
1012
+ * Converts geographic coordinates to Q2DD coordinates.
1013
+ *
1014
+ * @param coordinates - Array of `[lng, lat]` pairs
1015
+ * @param resolution - Resolution level
1016
+ * @returns Array of `{quad, x, y}` quad 2D double coordinates
1017
+ */
1018
+ geoToQ2dd(coordinates: number[][], resolution?: number): Array<{
1019
+ quad: number;
1020
+ x: number;
1021
+ y: number;
1022
+ }>;
1023
+ /**
1024
+ * Converts geographic coordinates to Q2DI coordinates.
1025
+ *
1026
+ * @param coordinates - Array of `[lng, lat]` pairs
1027
+ * @param resolution - Resolution level
1028
+ * @returns Array of `{quad, i, j}` quad 2D integer coordinates
1029
+ */
1030
+ geoToQ2di(coordinates: number[][], resolution?: number): Array<{
1031
+ quad: number;
1032
+ i: bigint;
1033
+ j: bigint;
1034
+ }>;
1035
+ /**
1036
+ * Converts sequence numbers to PLANE coordinates.
1037
+ *
1038
+ * @param sequenceNum - Array of cell IDs
1039
+ * @param resolution - Resolution level
1040
+ * @returns Array of `{x, y}` plane coordinates
1041
+ */
1042
+ sequenceNumToPlane(sequenceNum: bigint[], resolution?: number): Array<{
1043
+ x: number;
1044
+ y: number;
1045
+ }>;
1046
+ /**
1047
+ * Converts sequence numbers to PROJTRI coordinates.
1048
+ *
1049
+ * @param sequenceNum - Array of cell IDs
1050
+ * @param resolution - Resolution level
1051
+ * @returns Array of `{tnum, x, y}` projection triangle coordinates
1052
+ */
1053
+ sequenceNumToProjtri(sequenceNum: bigint[], resolution?: number): Array<{
1054
+ tnum: number;
1055
+ x: number;
1056
+ y: number;
1057
+ }>;
1058
+ /**
1059
+ * Converts sequence numbers to Q2DD coordinates.
1060
+ *
1061
+ * @param sequenceNum - Array of cell IDs
1062
+ * @param resolution - Resolution level
1063
+ * @returns Array of `{quad, x, y}` quad 2D double coordinates
1064
+ */
1065
+ sequenceNumToQ2dd(sequenceNum: bigint[], resolution?: number): Array<{
1066
+ quad: number;
1067
+ x: number;
1068
+ y: number;
1069
+ }>;
1070
+ /**
1071
+ * Converts sequence numbers to Q2DI coordinates.
1072
+ *
1073
+ * @param sequenceNum - Array of cell IDs
1074
+ * @param resolution - Resolution level
1075
+ * @returns Array of `{quad, i, j}` quad 2D integer coordinates
1076
+ */
1077
+ sequenceNumToQ2di(sequenceNum: bigint[], resolution?: number): Array<{
1078
+ quad: number;
1079
+ i: bigint;
1080
+ j: bigint;
1081
+ }>;
1082
+ /**
1083
+ * Converts Q2DI coordinates to geographic coordinates.
1084
+ *
1085
+ * @param coords - Array of `{quad, i, j}` coordinates
1086
+ * @param resolution - Resolution level
1087
+ * @returns Array of `[lng, lat]` positions
1088
+ */
1089
+ q2diToGeo(coords: Array<{
1090
+ quad: number;
1091
+ i: bigint;
1092
+ j: bigint;
1093
+ }>, resolution?: number): Position[];
1094
+ /**
1095
+ * Converts Q2DI coordinates to sequence numbers.
1096
+ *
1097
+ * @param coords - Array of `{quad, i, j}` coordinates
1098
+ * @param resolution - Resolution level
1099
+ * @returns Array of cell IDs
1100
+ */
1101
+ q2diToSequenceNum(coords: Array<{
1102
+ quad: number;
1103
+ i: bigint;
1104
+ j: bigint;
1105
+ }>, resolution?: number): bigint[];
1106
+ /**
1107
+ * Converts Q2DI coordinates to PLANE coordinates.
1108
+ *
1109
+ * @param coords - Array of `{quad, i, j}` coordinates
1110
+ * @param resolution - Resolution level
1111
+ * @returns Array of `{x, y}` plane coordinates
1112
+ */
1113
+ q2diToPlane(coords: Array<{
1114
+ quad: number;
1115
+ i: bigint;
1116
+ j: bigint;
1117
+ }>, resolution?: number): Array<{
1118
+ x: number;
1119
+ y: number;
1120
+ }>;
1121
+ /**
1122
+ * Converts Q2DI coordinates to PROJTRI coordinates.
1123
+ *
1124
+ * @param coords - Array of `{quad, i, j}` coordinates
1125
+ * @param resolution - Resolution level
1126
+ * @returns Array of `{tnum, x, y}` projection triangle coordinates
1127
+ */
1128
+ q2diToProjtri(coords: Array<{
1129
+ quad: number;
1130
+ i: bigint;
1131
+ j: bigint;
1132
+ }>, resolution?: number): Array<{
1133
+ tnum: number;
1134
+ x: number;
1135
+ y: number;
1136
+ }>;
1137
+ /**
1138
+ * Converts Q2DI coordinates to Q2DD coordinates.
1139
+ *
1140
+ * @param coords - Array of `{quad, i, j}` coordinates
1141
+ * @param resolution - Resolution level
1142
+ * @returns Array of `{quad, x, y}` quad 2D double coordinates
1143
+ */
1144
+ q2diToQ2dd(coords: Array<{
1145
+ quad: number;
1146
+ i: bigint;
1147
+ j: bigint;
1148
+ }>, resolution?: number): Array<{
1149
+ quad: number;
1150
+ x: number;
1151
+ y: number;
1152
+ }>;
1153
+ /**
1154
+ * Converts Q2DD coordinates to geographic coordinates.
1155
+ *
1156
+ * @param coords - Array of `{quad, x, y}` coordinates
1157
+ * @param resolution - Resolution level
1158
+ * @returns Array of `[lng, lat]` positions
1159
+ */
1160
+ q2ddToGeo(coords: Array<{
1161
+ quad: number;
1162
+ x: number;
1163
+ y: number;
1164
+ }>, resolution?: number): Position[];
1165
+ /**
1166
+ * Converts Q2DD coordinates to sequence numbers.
1167
+ *
1168
+ * @param coords - Array of `{quad, x, y}` coordinates
1169
+ * @param resolution - Resolution level
1170
+ * @returns Array of cell IDs
1171
+ */
1172
+ q2ddToSequenceNum(coords: Array<{
1173
+ quad: number;
1174
+ x: number;
1175
+ y: number;
1176
+ }>, resolution?: number): bigint[];
1177
+ /**
1178
+ * Converts Q2DD coordinates to PLANE coordinates.
1179
+ *
1180
+ * @param coords - Array of `{quad, x, y}` coordinates
1181
+ * @param resolution - Resolution level
1182
+ * @returns Array of `{x, y}` plane coordinates
1183
+ */
1184
+ q2ddToPlane(coords: Array<{
1185
+ quad: number;
1186
+ x: number;
1187
+ y: number;
1188
+ }>, resolution?: number): Array<{
1189
+ x: number;
1190
+ y: number;
1191
+ }>;
1192
+ /**
1193
+ * Converts Q2DD coordinates to PROJTRI coordinates.
1194
+ *
1195
+ * @param coords - Array of `{quad, x, y}` coordinates
1196
+ * @param resolution - Resolution level
1197
+ * @returns Array of `{tnum, x, y}` projection triangle coordinates
1198
+ */
1199
+ q2ddToProjtri(coords: Array<{
1200
+ quad: number;
1201
+ x: number;
1202
+ y: number;
1203
+ }>, resolution?: number): Array<{
1204
+ tnum: number;
1205
+ x: number;
1206
+ y: number;
1207
+ }>;
1208
+ /**
1209
+ * Converts Q2DD coordinates to Q2DI coordinates.
1210
+ *
1211
+ * @param coords - Array of `{quad, x, y}` coordinates
1212
+ * @param resolution - Resolution level
1213
+ * @returns Array of `{quad, i, j}` quad 2D integer coordinates
1214
+ */
1215
+ q2ddToQ2di(coords: Array<{
1216
+ quad: number;
1217
+ x: number;
1218
+ y: number;
1219
+ }>, resolution?: number): Array<{
1220
+ quad: number;
1221
+ i: bigint;
1222
+ j: bigint;
1223
+ }>;
1224
+ /**
1225
+ * Converts PROJTRI coordinates to geographic coordinates.
1226
+ *
1227
+ * @param coords - Array of `{tnum, x, y}` coordinates
1228
+ * @param resolution - Resolution level
1229
+ * @returns Array of `[lng, lat]` positions
1230
+ */
1231
+ projtriToGeo(coords: Array<{
1232
+ tnum: number;
1233
+ x: number;
1234
+ y: number;
1235
+ }>, resolution?: number): Position[];
1236
+ /**
1237
+ * Converts PROJTRI coordinates to sequence numbers.
1238
+ *
1239
+ * @param coords - Array of `{tnum, x, y}` coordinates
1240
+ * @param resolution - Resolution level
1241
+ * @returns Array of cell IDs
1242
+ */
1243
+ projtriToSequenceNum(coords: Array<{
1244
+ tnum: number;
1245
+ x: number;
1246
+ y: number;
1247
+ }>, resolution?: number): bigint[];
1248
+ /**
1249
+ * Converts PROJTRI coordinates to PLANE coordinates.
1250
+ *
1251
+ * @param coords - Array of `{tnum, x, y}` coordinates
1252
+ * @param resolution - Resolution level
1253
+ * @returns Array of `{x, y}` plane coordinates
1254
+ */
1255
+ projtriToPlane(coords: Array<{
1256
+ tnum: number;
1257
+ x: number;
1258
+ y: number;
1259
+ }>, resolution?: number): Array<{
1260
+ x: number;
1261
+ y: number;
1262
+ }>;
1263
+ /**
1264
+ * Converts PROJTRI coordinates to Q2DD coordinates.
1265
+ *
1266
+ * @param coords - Array of `{tnum, x, y}` coordinates
1267
+ * @param resolution - Resolution level
1268
+ * @returns Array of `{quad, x, y}` quad 2D double coordinates
1269
+ */
1270
+ projtriToQ2dd(coords: Array<{
1271
+ tnum: number;
1272
+ x: number;
1273
+ y: number;
1274
+ }>, resolution?: number): Array<{
1275
+ quad: number;
1276
+ x: number;
1277
+ y: number;
1278
+ }>;
1279
+ /**
1280
+ * Converts PROJTRI coordinates to Q2DI coordinates.
1281
+ *
1282
+ * @param coords - Array of `{tnum, x, y}` coordinates
1283
+ * @param resolution - Resolution level
1284
+ * @returns Array of `{quad, i, j}` quad 2D integer coordinates
1285
+ */
1286
+ projtriToQ2di(coords: Array<{
1287
+ tnum: number;
1288
+ x: number;
1289
+ y: number;
1290
+ }>, resolution?: number): Array<{
1291
+ quad: number;
1292
+ i: bigint;
1293
+ j: bigint;
1294
+ }>;
503
1295
  }
504
1296
  //# sourceMappingURL=webdggrid.d.ts.map