@xylabs/geo 4.13.20 → 4.13.21

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 (2) hide show
  1. package/README.md +791 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -12,13 +12,801 @@
12
12
  [![snyk-badge][]][snyk-link]
13
13
  [![socket-badge][]][socket-link]
14
14
 
15
- Version: 4.13.19
16
15
 
17
16
  Base functionality used throughout XY Labs TypeScript/JavaScript libraries
18
17
 
19
- ## Documentation
18
+ ## API Documentation
19
+
20
+ **@xylabs/geo**
21
+
22
+ ***
23
+
24
+ ## Classes
25
+
26
+ - [GeoJson](#classes/GeoJson)
27
+ - [LayerBase](#classes/LayerBase)
28
+ - [MercatorBoundingBox](#classes/MercatorBoundingBox)
29
+ - [MercatorLngLat](#classes/MercatorLngLat)
30
+
31
+ ## Type Aliases
32
+
33
+ - [MercatorTile](#type-aliases/MercatorTile)
34
+ - [MercatorBoundary](#type-aliases/MercatorBoundary)
35
+
36
+ ## Variables
37
+
38
+ - [d2r](#variables/d2r)
39
+ - [r2d](#variables/r2d)
40
+
41
+ ## Functions
42
+
43
+ - [boundingBoxToBoundary](#functions/boundingBoxToBoundary)
44
+ - [boundingBoxToCenter](#functions/boundingBoxToCenter)
45
+ - [boundingBoxToPolygon](#functions/boundingBoxToPolygon)
46
+ - [tileFromPoint](#functions/tileFromPoint)
47
+ - [tileFromQuadkey](#functions/tileFromQuadkey)
48
+ - [tileToBoundingBox](#functions/tileToBoundingBox)
49
+ - [tileToChildren](#functions/tileToChildren)
50
+ - [tileToGeoJson](#functions/tileToGeoJson)
51
+ - [tileToParent](#functions/tileToParent)
52
+ - [tileToPoint](#functions/tileToPoint)
53
+ - [tileToQuadkey](#functions/tileToQuadkey)
54
+ - [tileToSiblings](#functions/tileToSiblings)
55
+ - [tilesEqual](#functions/tilesEqual)
56
+ - [tilesFromBoundingBox](#functions/tilesFromBoundingBox)
57
+ - [hasSiblings](#functions/hasSiblings)
58
+ - [tilesHasTile](#functions/tilesHasTile)
59
+
60
+ ### classes
61
+
62
+ ### <a id="GeoJson"></a>GeoJson
63
+
64
+ [**@xylabs/geo**](#../README)
65
+
66
+ ***
67
+
68
+ ## Constructors
69
+
70
+ ### Constructor
71
+
72
+ ```ts
73
+ new GeoJson(quadkey): GeoJson;
74
+ ```
75
+
76
+ ### Parameters
77
+
78
+ #### quadkey
79
+
80
+ `string`
81
+
82
+ ### Returns
83
+
84
+ `GeoJson`
85
+
86
+ ## Methods
87
+
88
+ ### featureCollection()
89
+
90
+ ```ts
91
+ static featureCollection(features): FeatureCollection;
92
+ ```
93
+
94
+ ### Parameters
95
+
96
+ #### features
97
+
98
+ `Feature`\<`Geometry`, `GeoJsonProperties`\>[]
99
+
100
+ ### Returns
101
+
102
+ `FeatureCollection`
103
+
104
+ ***
105
+
106
+ ### featuresSource()
107
+
108
+ ```ts
109
+ static featuresSource(data): GeoJSONSourceSpecification;
110
+ ```
111
+
112
+ ### Parameters
113
+
114
+ #### data
115
+
116
+ `FeatureCollection`
117
+
118
+ ### Returns
119
+
120
+ `GeoJSONSourceSpecification`
121
+
122
+ ***
123
+
124
+ ### geometryFeature()
125
+
126
+ ```ts
127
+ static geometryFeature(geometry): Feature;
128
+ ```
129
+
130
+ ### Parameters
131
+
132
+ #### geometry
133
+
134
+ `Geometry`
135
+
136
+ ### Returns
137
+
138
+ `Feature`
139
+
140
+ ***
141
+
142
+ ### center()
143
+
144
+ ```ts
145
+ center(): LngLat;
146
+ ```
147
+
148
+ ### Returns
149
+
150
+ `LngLat`
151
+
152
+ ***
153
+
154
+ ### point()
155
+
156
+ ```ts
157
+ point(): Point;
158
+ ```
159
+
160
+ ### Returns
161
+
162
+ `Point`
163
+
164
+ ***
165
+
166
+ ### pointFeature()
167
+
168
+ ```ts
169
+ pointFeature(): Feature;
170
+ ```
171
+
172
+ ### Returns
173
+
174
+ `Feature`
175
+
176
+ ***
177
+
178
+ ### pointFeatureCollection()
179
+
180
+ ```ts
181
+ pointFeatureCollection(): FeatureCollection;
182
+ ```
183
+
184
+ ### Returns
185
+
186
+ `FeatureCollection`
187
+
188
+ ***
189
+
190
+ ### pointSource()
191
+
192
+ ```ts
193
+ pointSource(): GeoJSONSourceSpecification;
194
+ ```
195
+
196
+ ### Returns
197
+
198
+ `GeoJSONSourceSpecification`
199
+
200
+ ***
201
+
202
+ ### polygon()
203
+
204
+ ```ts
205
+ polygon(): Polygon;
206
+ ```
207
+
208
+ ### Returns
209
+
210
+ `Polygon`
211
+
212
+ ***
213
+
214
+ ### polygonFeature()
215
+
216
+ ```ts
217
+ polygonFeature(): Feature;
218
+ ```
219
+
220
+ ### Returns
221
+
222
+ `Feature`
223
+
224
+ ***
225
+
226
+ ### polygonFeatureCollection()
227
+
228
+ ```ts
229
+ polygonFeatureCollection(): FeatureCollection;
230
+ ```
231
+
232
+ ### Returns
233
+
234
+ `FeatureCollection`
235
+
236
+ ***
237
+
238
+ ### polygonSource()
239
+
240
+ ```ts
241
+ polygonSource(): GeoJSONSourceSpecification;
242
+ ```
243
+
244
+ ### Returns
245
+
246
+ `GeoJSONSourceSpecification`
247
+
248
+ ***
249
+
250
+ ### zoom()
251
+
252
+ ```ts
253
+ zoom(): number;
254
+ ```
255
+
256
+ ### Returns
257
+
258
+ `number`
259
+
260
+ ### <a id="LayerBase"></a>LayerBase
261
+
262
+ [**@xylabs/geo**](#../README)
263
+
264
+ ***
265
+
266
+ ## Type Parameters
267
+
268
+ ### T
269
+
270
+ `T` *extends* `MapBox.Layer`
271
+
272
+ ## Constructors
273
+
274
+ ### Constructor
275
+
276
+ ```ts
277
+ new LayerBase<T>(id, source): LayerBase<T>;
278
+ ```
279
+
280
+ ### Parameters
281
+
282
+ #### id
283
+
284
+ `string`
285
+
286
+ #### source
287
+
288
+ `string`
289
+
290
+ ### Returns
291
+
292
+ `LayerBase`\<`T`\>
293
+
294
+ ## Properties
295
+
296
+ ### id
297
+
298
+ ```ts
299
+ id: string;
300
+ ```
301
+
302
+ ***
303
+
304
+ ### source
305
+
306
+ ```ts
307
+ source: string;
308
+ ```
309
+
310
+ ## Methods
311
+
312
+ ### update()
313
+
314
+ ```ts
315
+ update(map, show): void;
316
+ ```
317
+
318
+ ### Parameters
319
+
320
+ #### map
321
+
322
+ `Map$1`
323
+
324
+ #### show
325
+
326
+ `boolean` = `true`
327
+
328
+ ### Returns
329
+
330
+ `void`
331
+
332
+ ***
333
+
334
+ ### buildLayer()
335
+
336
+ ```ts
337
+ abstract buildLayer(): T;
338
+ ```
339
+
340
+ ### Returns
341
+
342
+ `T`
343
+
344
+ ### <a id="MercatorBoundingBox"></a>MercatorBoundingBox
345
+
346
+ [**@xylabs/geo**](#../README)
347
+
348
+ ***
349
+
350
+ ## Extends
351
+
352
+ - `LngLatBounds`
353
+
354
+ ## Constructors
355
+
356
+ ### Constructor
357
+
358
+ ```ts
359
+ new MercatorBoundingBox(sw?, ne?): MercatorBoundingBox;
360
+ ```
361
+
362
+ ### Parameters
363
+
364
+ #### sw?
365
+
366
+ \[`number`, `number`, `number`, `number`\] | `LngLatLike` | \[`LngLatLike`, `LngLatLike`\]
367
+
368
+ #### ne?
369
+
370
+ `LngLatLike`
371
+
372
+ ### Returns
373
+
374
+ `MercatorBoundingBox`
375
+
376
+ ### Inherited from
377
+
378
+ ```ts
379
+ MapBox.LngLatBounds.constructor
380
+ ```
381
+
382
+ ### <a id="MercatorLngLat"></a>MercatorLngLat
383
+
384
+ [**@xylabs/geo**](#../README)
385
+
386
+ ***
387
+
388
+ ## Extends
389
+
390
+ - `LngLat`
391
+
392
+ ## Constructors
393
+
394
+ ### Constructor
395
+
396
+ ```ts
397
+ new MercatorLngLat(lng, lat): MercatorLngLat;
398
+ ```
399
+
400
+ ### Parameters
401
+
402
+ #### lng
403
+
404
+ `number`
405
+
406
+ #### lat
407
+
408
+ `number`
409
+
410
+ ### Returns
411
+
412
+ `MercatorLngLat`
413
+
414
+ ### Inherited from
415
+
416
+ ```ts
417
+ MapBox.LngLat.constructor
418
+ ```
419
+
420
+ ### functions
421
+
422
+ ### <a id="boundingBoxToBoundary"></a>boundingBoxToBoundary
423
+
424
+ [**@xylabs/geo**](#../README)
425
+
426
+ ***
427
+
428
+ ```ts
429
+ function boundingBoxToBoundary(box): MercatorBoundary;
430
+ ```
431
+
432
+ ## Parameters
433
+
434
+ ### box
435
+
436
+ [`MercatorBoundingBox`](#../classes/MercatorBoundingBox)
437
+
438
+ ## Returns
439
+
440
+ [`MercatorBoundary`](#../type-aliases/MercatorBoundary)
441
+
442
+ ### <a id="boundingBoxToCenter"></a>boundingBoxToCenter
443
+
444
+ [**@xylabs/geo**](#../README)
445
+
446
+ ***
447
+
448
+ ```ts
449
+ function boundingBoxToCenter(boundingBox, decimal): number[];
450
+ ```
451
+
452
+ ## Parameters
453
+
454
+ ### boundingBox
455
+
456
+ [`MercatorBoundingBox`](#../classes/MercatorBoundingBox)
457
+
458
+ ### decimal
459
+
460
+ `number` = `6`
461
+
462
+ ## Returns
463
+
464
+ `number`[]
465
+
466
+ ### <a id="boundingBoxToPolygon"></a>boundingBoxToPolygon
467
+
468
+ [**@xylabs/geo**](#../README)
469
+
470
+ ***
471
+
472
+ ```ts
473
+ function boundingBoxToPolygon(box): Polygon;
474
+ ```
475
+
476
+ ## Parameters
477
+
478
+ ### box
479
+
480
+ [`MercatorBoundingBox`](#../classes/MercatorBoundingBox)
481
+
482
+ ## Returns
483
+
484
+ `Polygon`
485
+
486
+ ### <a id="hasSiblings"></a>hasSiblings
487
+
488
+ [**@xylabs/geo**](#../README)
489
+
490
+ ***
491
+
492
+ ```ts
493
+ function hasSiblings(tiles, tile): boolean;
494
+ ```
495
+
496
+ ## Parameters
497
+
498
+ ### tiles
499
+
500
+ [`MercatorTile`](#../type-aliases/MercatorTile)[]
501
+
502
+ ### tile
503
+
504
+ [`MercatorTile`](#../type-aliases/MercatorTile)
505
+
506
+ ## Returns
507
+
508
+ `boolean`
509
+
510
+ ### <a id="tileFromPoint"></a>tileFromPoint
511
+
512
+ [**@xylabs/geo**](#../README)
513
+
514
+ ***
515
+
516
+ ```ts
517
+ function tileFromPoint(point, z): number[];
518
+ ```
519
+
520
+ ## Parameters
521
+
522
+ ### point
523
+
524
+ [`MercatorLngLat`](#../classes/MercatorLngLat)
525
+
526
+ ### z
527
+
528
+ `number`
529
+
530
+ ## Returns
531
+
532
+ `number`[]
533
+
534
+ ### <a id="tileFromQuadkey"></a>tileFromQuadkey
535
+
536
+ [**@xylabs/geo**](#../README)
537
+
538
+ ***
539
+
540
+ ```ts
541
+ function tileFromQuadkey(quadkey): number[];
542
+ ```
543
+
544
+ ## Parameters
545
+
546
+ ### quadkey
547
+
548
+ `string`
549
+
550
+ ## Returns
551
+
552
+ `number`[]
553
+
554
+ ### <a id="tileToBoundingBox"></a>tileToBoundingBox
555
+
556
+ [**@xylabs/geo**](#../README)
557
+
558
+ ***
559
+
560
+ ```ts
561
+ function tileToBoundingBox(tile): MercatorBoundingBox;
562
+ ```
563
+
564
+ ## Parameters
565
+
566
+ ### tile
567
+
568
+ [`MercatorTile`](#../type-aliases/MercatorTile)
569
+
570
+ ## Returns
571
+
572
+ [`MercatorBoundingBox`](#../classes/MercatorBoundingBox)
573
+
574
+ ### <a id="tileToChildren"></a>tileToChildren
575
+
576
+ [**@xylabs/geo**](#../README)
577
+
578
+ ***
579
+
580
+ ```ts
581
+ function tileToChildren(tile): number[][];
582
+ ```
583
+
584
+ ## Parameters
585
+
586
+ ### tile
587
+
588
+ [`MercatorTile`](#../type-aliases/MercatorTile)
589
+
590
+ ## Returns
591
+
592
+ `number`[][]
593
+
594
+ ### <a id="tileToGeoJson"></a>tileToGeoJson
595
+
596
+ [**@xylabs/geo**](#../README)
597
+
598
+ ***
599
+
600
+ ```ts
601
+ function tileToGeoJson(tile): Polygon;
602
+ ```
603
+
604
+ ## Parameters
605
+
606
+ ### tile
607
+
608
+ [`MercatorTile`](#../type-aliases/MercatorTile)
609
+
610
+ ## Returns
611
+
612
+ `Polygon`
613
+
614
+ ### <a id="tileToParent"></a>tileToParent
615
+
616
+ [**@xylabs/geo**](#../README)
617
+
618
+ ***
619
+
620
+ ```ts
621
+ function tileToParent(tile): MercatorTile;
622
+ ```
623
+
624
+ ## Parameters
625
+
626
+ ### tile
627
+
628
+ [`MercatorTile`](#../type-aliases/MercatorTile)
629
+
630
+ ## Returns
631
+
632
+ [`MercatorTile`](#../type-aliases/MercatorTile)
633
+
634
+ ### <a id="tileToPoint"></a>tileToPoint
635
+
636
+ [**@xylabs/geo**](#../README)
637
+
638
+ ***
639
+
640
+ ```ts
641
+ function tileToPoint(tile): MercatorLngLat;
642
+ ```
643
+
644
+ ## Parameters
645
+
646
+ ### tile
647
+
648
+ [`MercatorTile`](#../type-aliases/MercatorTile)
649
+
650
+ ## Returns
651
+
652
+ [`MercatorLngLat`](#../classes/MercatorLngLat)
653
+
654
+ ### <a id="tileToQuadkey"></a>tileToQuadkey
655
+
656
+ [**@xylabs/geo**](#../README)
657
+
658
+ ***
659
+
660
+ ```ts
661
+ function tileToQuadkey(tile): string;
662
+ ```
663
+
664
+ ## Parameters
665
+
666
+ ### tile
667
+
668
+ [`MercatorTile`](#../type-aliases/MercatorTile)
669
+
670
+ ## Returns
671
+
672
+ `string`
673
+
674
+ ### <a id="tileToSiblings"></a>tileToSiblings
675
+
676
+ [**@xylabs/geo**](#../README)
677
+
678
+ ***
679
+
680
+ ```ts
681
+ function tileToSiblings(tile): MercatorTile[];
682
+ ```
683
+
684
+ ## Parameters
685
+
686
+ ### tile
687
+
688
+ [`MercatorTile`](#../type-aliases/MercatorTile)
689
+
690
+ ## Returns
691
+
692
+ [`MercatorTile`](#../type-aliases/MercatorTile)[]
693
+
694
+ ### <a id="tilesEqual"></a>tilesEqual
695
+
696
+ [**@xylabs/geo**](#../README)
697
+
698
+ ***
699
+
700
+ ```ts
701
+ function tilesEqual(tile1, tile2): boolean;
702
+ ```
703
+
704
+ ## Parameters
705
+
706
+ ### tile1
707
+
708
+ [`MercatorTile`](#../type-aliases/MercatorTile)
709
+
710
+ ### tile2
711
+
712
+ [`MercatorTile`](#../type-aliases/MercatorTile)
713
+
714
+ ## Returns
715
+
716
+ `boolean`
717
+
718
+ ### <a id="tilesFromBoundingBox"></a>tilesFromBoundingBox
719
+
720
+ [**@xylabs/geo**](#../README)
721
+
722
+ ***
723
+
724
+ ```ts
725
+ function tilesFromBoundingBox(box, zoom): MercatorTile[];
726
+ ```
727
+
728
+ ## Parameters
729
+
730
+ ### box
731
+
732
+ [`MercatorBoundingBox`](#../classes/MercatorBoundingBox)
733
+
734
+ ### zoom
735
+
736
+ `number`
737
+
738
+ ## Returns
739
+
740
+ [`MercatorTile`](#../type-aliases/MercatorTile)[]
741
+
742
+ ### <a id="tilesHasTile"></a>tilesHasTile
743
+
744
+ [**@xylabs/geo**](#../README)
745
+
746
+ ***
747
+
748
+ ```ts
749
+ function tilesHasTile(tiles, tile): boolean;
750
+ ```
751
+
752
+ ## Parameters
753
+
754
+ ### tiles
755
+
756
+ [`MercatorTile`](#../type-aliases/MercatorTile)[]
757
+
758
+ ### tile
759
+
760
+ [`MercatorTile`](#../type-aliases/MercatorTile)
761
+
762
+ ## Returns
763
+
764
+ `boolean`
765
+
766
+ ### type-aliases
767
+
768
+ ### <a id="MercatorBoundary"></a>MercatorBoundary
769
+
770
+ [**@xylabs/geo**](#../README)
771
+
772
+ ***
773
+
774
+ ```ts
775
+ type MercatorBoundary = MercatorLngLat[];
776
+ ```
777
+
778
+ ### <a id="MercatorTile"></a>MercatorTile
779
+
780
+ [**@xylabs/geo**](#../README)
781
+
782
+ ***
783
+
784
+ ```ts
785
+ type MercatorTile = number[];
786
+ ```
787
+
788
+ ### variables
789
+
790
+ ### <a id="d2r"></a>d2r
791
+
792
+ [**@xylabs/geo**](#../README)
793
+
794
+ ***
795
+
796
+ ```ts
797
+ const d2r: number;
798
+ ```
799
+
800
+ ### <a id="r2d"></a>r2d
801
+
802
+ [**@xylabs/geo**](#../README)
803
+
804
+ ***
805
+
806
+ ```ts
807
+ const r2d: number;
808
+ ```
20
809
 
21
- Coming Soon!
22
810
 
23
811
  Part of [sdk-js](https://www.npmjs.com/package/@xyo-network/sdk-js)
24
812
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/geo",
3
- "version": "4.13.20",
3
+ "version": "4.13.21",
4
4
  "description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
5
5
  "keywords": [
6
6
  "xylabs",