forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jsts.d.ts
1666 lines (1533 loc) · 71.5 KB
/
jsts.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Type definitions for jsts 0.16.0
// Project: https://github.com/bjornharrtell/jsts
// Definitions by: Stephane Alie <https://github.com/StephaneAlie>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace jsts {
export var version: string;
namespace geom {
/**
* A lightweight class used to store coordinates on the 2-dimensional
* Cartesian plane. It is distinct from {@link Point}, which is a subclass of
* {@link Geometry}. Unlike objects of type {@link Point} (which contain
* additional information such as an envelope, a precision model, and spatial
* reference system information), a <code>Coordinate</code> only contains
* coordinate values and accessor methods.
*/
export class Coordinate {
/**
* @constructor
*/
constructor(x: number, y: number);
/**
* @constructor
*/
constructor(c: Coordinate);
/**
* Gets or sets the x value.
*/
x: number;
/**
* Gets or sets the y value.
*/
y: number;
/**
* Gets or sets the z value.
*/
z: number;
/**
* Sets this <code>Coordinate</code>s (x,y,z) values to that of
* <code>other</code>.
*
* @param {Coordinate}
* other the <code>Coordinate</code> to copy.
*/
setCoordinate(other: Coordinate): void;
/**
* Clones this instance.
*
* @return {Coordinate} A point instance cloned from this.
*/
clone(): Coordinate;
/**
* Computes the 2-dimensional Euclidean distance to another location. The
* Z-ordinate is ignored.
*
* @param {Coordinate}
* p a point.
* @return {number} the 2-dimensional Euclidean distance between the
* locations.
*/
distance(p: Coordinate): number;
/**
* Returns whether the planar projections of the two <code>Coordinate</code>s
* are equal.
*
* @param {Coordinate}
* other a <code>Coordinate</code> with which to do the 2D
* comparison.
* @return {boolean} <code>true</code> if the x- and y-coordinates are
* equal; the z-coordinates do not have to be equal.
*/
equals2D(other: Coordinate): boolean;
/**
* Returns <code>true</code> if <code>other</code> has the same values for
* the x and y ordinates. Since Coordinates are 2.5D, this routine ignores the
* z value when making the comparison.
*
* @param {Coordinate}
* other a <code>Coordinate</code> with which to do the comparison.
* @return {boolean} <code>true</code> if <code>other</code> is a
* <code>Coordinate</code> with the same values for the x and y
* ordinates.
*/
equals(other: Coordinate): boolean;
/**
* Compares this {@link Coordinate} with the specified {@link Coordinate} for
* order. This method ignores the z value when making the comparison. Returns:
* <UL>
* <LI> -1 : this.x < other.x || ((this.x == other.x) && (this.y < other.y))
* <LI> 0 : this.x == other.x && this.y = other.y
* <LI> 1 : this.x > other.x || ((this.x == other.x) && (this.y > other.y))
*
* </UL>
* Note: This method assumes that ordinate values are valid numbers. NaN
* values are not handled correctly.
*
* @param {Coordinate}
* other the <code>Coordinate</code> with which this
* <code>Coordinate</code> is being compared.
* @return {number} -1, zero, or 1 as explained above.
*/
compareTo(other: Coordinate): number;
}
/**
* Defines a rectangular region of the 2D coordinate plane. It is often used to
* represent the bounding box of a {@link Geometry}, e.g. the minimum and
* maximum x and y values of the {@link Coordinate}s.
* <p>
* Note that Envelopes support infinite or half-infinite regions, by using the
* values of <code>Double.POSITIVE_INFINITY</code> and
* <code>Double.NEGATIVE_INFINITY</code>.
* <p>
* When Envelope objects are created or initialized, the supplies extent values
* are automatically sorted into the correct order.
*/
export class Envelope {
/**
* Test the point q to see whether it intersects the Envelope defined by p1-p2
*
* NOTE: calls intersectsEnvelope if four arguments are given to simulate
* overloaded function
*
* @param {jsts.geom.Coordinate}
* p1 one extremal point of the envelope.
* @param {jsts.geom.Coordinate}
* p2 another extremal point of the envelope.
* @param {jsts.geom.Coordinate}
* q the point to test for intersection.
* @return {boolean} <code>true</code> if q intersects the envelope p1-p2.
*/
static intersects(p1: Coordinate, p2: Coordinate, q: Coordinate): boolean;
/**
* Test the envelope defined by p1-p2 for intersection with the envelope defined
* by q1-q2
*
* @param {jsts.geom.Coordinate}
* p1 one extremal point of the envelope P.
* @param {jsts.geom.Coordinate}
* p2 another extremal point of the envelope P.
* @param {jsts.geom.Coordinate}
* q1 one extremal point of the envelope Q.
* @param {jsts.geom.Coordinate}
* q2 another extremal point of the envelope Q.
* @return {boolean} <code>true</code> if Q intersects P.
*/
static intersectsEnvelope(p1: Coordinate, p2: Coordinate, q1: Coordinate, q2: Coordinate): boolean;
/**
* Creates an <code>Envelope</code> for a region defined by maximum and
* minimum values.
*
* @param {number} x1 the first x-value.
* @param {number} x2 the second x-value.
* @param {number} y1 the first y-value.
* @param {number} y2 the second y-value.
*/
constructor(x1: number, x2: number, y1: number, y2: number);
/**
* Initialize an <code>Envelope</code> to a region defined by two Coordinates.
*
* @param {jsts.geom.Coordinate} p1 the first Coordinate.
* @param {jsts.geom.Coordinate} p2 the second Coordinate.
*/
constructor(p1: Coordinate, p2: Coordinate);
/**
* Initialize an <code>Envelope</code> to a region defined by a single
* Coordinate.
*
* @param {jsts.geom.Coordinate} p the Coordinate.
*/
constructor(p: Coordinate);
/**
* Initialize an <code>Envelope</code> from an existing Envelope.
*
* @param {jsts.geom.Envelope} env the Envelope to initialize from.
*/
constructor(env: Envelope);
/**
* the minimum x-coordinate.
*/
minx: number;
/**
* the maximum x-coordinate.
*/
maxx: number;
/**
* the minimum y-coordinate.
*/
miny: number;
/**
* the maximum y-coordinate.
*/
maxy: number;
/**
* Makes this <code>Envelope</code> a "null" envelope, that is, the envelope
* of the empty geometry.
*/
setToNull(): void;
/**
* Returns <code>true</code> if this <code>Envelope</code> is a "null"
* envelope.
*
* @return {boolean} <code>true</code> if this <code>Envelope</code> is
* uninitialized or is the envelope of the empty geometry.
*/
isNull(): boolean;
/**
* Returns the difference between the maximum and minimum y values.
*
* @return {number} max y - min y, or 0 if this is a null <code>Envelope.</code>
*/
getHeight(): number;
/**
* Returns the difference between the maximum and minimum x values.
*
* @return {number} max x - min x, or 0 if this is a null <code>Envelope.</code>
*/
getWidth(): number;
/**
* Returns the <code>Envelope</code>s minimum x-value. min x > max x
* indicates that this is a null <code>Envelope</code>.
*
* @return {number} the minimum x-coordinate.
*/
getMinX(): number;
/**
* Returns the <code>Envelope</code>s maximum x-value. min x > max x
* indicates that this is a null <code>Envelope</code>.
*
* @return {number} the maximum x-coordinate.
*/
getMaxX(): number;
/**
* Returns the <code>Envelope</code>s minimum y-value. min y > max y
* indicates that this is a null <code>Envelope</code>.
*
* @return {number} the minimum y-coordinate.
*/
getMinY(): number;
/**
* Returns the <code>Envelope</code>s maximum y-value. min y > max y
* indicates that this is a null <code>Envelope</code>.
*
* @return {number} the maximum y-coordinate.
*/
getMaxY(): number;
/**
* Gets the area of this envelope.
*
* @return {number} the area of the envelope, 0.0 if the envelope is null.
*/
getArea(): number;
/**
* Enlarges this <code>Envelope</code> so that it contains the given
* {@link Coordinate}. Has no effect if the point is already on or within the
* envelope.
*
* @param {jsts.geom.Coordinate} p the Coordinate to expand to include.
*/
expandToInclude(p: Coordinate): void;
/**
* Enlarges this <code>Envelope</code> so that it contains the given point.
* Has no effect if the point is already on or within the envelope.
*
* @param {number} x the value to lower the minimum x to or to raise the maximum x to.
* @param {number} y the value to lower the minimum y to or to raise the maximum y to.
*/
expandToInclude(x: number, y: number): void;
/**
* Enlarges this <code>Envelope</code> so that it contains the
* <code>other</code> Envelope. Has no effect if <code>other</code> is
* wholly on or within the envelope.
*
* @param {jsts.geom.Envelope} other the <code>Envelope</code> to expand to include.
*/
expandToInclude(other: Envelope): void;
/**
* Expands this envelope by a given distance in all directions. Both positive
* and negative distances are supported.
*
* @param {number} distance the distance to expand the envelope.
*/
expandBy(distance: number): void;
/**
* Expands this envelope by a given distance in all directions. Both positive
* and negative distances are supported.
*
* @param {number}
* deltaX the distance to expand the envelope along the the X axis.
* @param {number}
* deltaY the distance to expand the envelope along the the Y axis.
*/
expandBy(deltaX: number, deltaY: number): void;
/**
* Translates this envelope by given amounts in the X and Y direction.
*
* @param {number}
* transX the amount to translate along the X axis.
* @param {number}
* transY the amount to translate along the Y axis.
*/
translate(transX: number, transY: number): void;
/**
* Computes the coordinate of the centre of this envelope (as long as it is
* non-null
*
* @return {jsts.geom.Coordinate} the centre coordinate of this envelope <code>null</code>
* if the envelope is null.
*/
centre(): Coordinate;
/**
* Computes the intersection of two {@link Envelopes}
*
* @param {jsts.geom.Envelope}
* env the envelope to intersect with.
* @return {jsts.geom.Envelope} a new Envelope representing the intersection of
* the envelopes (this will be the null envelope if either argument is
* null, or they do not intersect.
*/
intersection(env: Envelope): Envelope;
/**
* Check if the region defined by <code>other</code> overlaps (intersects) the
* region of this <code>Envelope</code>.
*
* @param {jsts.geom.Envelope}
* other the <code>Envelope</code> which this <code>Envelope</code>
* is being checked for overlapping.
* @return {boolean} <code>true</code> if the <code>Envelope</code>s
* overlap.
*/
intersects(other: Envelope): boolean;
/**
* Check if the point <code>p</code> overlaps (lies inside) the region of this
* <code>Envelope</code>.
*
* @param {jsts.geom.Coordinate}
* p the <code>Coordinate</code> to be tested.
* @return {boolean} <code>true</code> if the point overlaps this
* <code>Envelope.</code>
*/
intersects(p: Coordinate): boolean;
/**
* Check if the point <code>(x, y)</code> overlaps (lies inside) the region of
* this <code>Envelope</code>.
*
* @param {number}
* x the x-ordinate of the point.
* @param {number}
* y the y-ordinate of the point.
* @return {boolean} <code>true</code> if the point overlaps this
* <code>Envelope.</code>
*/
intersects(x: number, y: number): boolean;
/**
* Tests if the <code>Envelope other</code> lies wholely inside this
* <code>Envelope</code> (inclusive of the boundary).
* <p>
* Note that this is <b>not</b> the same definition as the SFS
* <tt>contains</tt>, which would exclude the envelope boundary.
*
* @param {jsts.geom.Envelope}
* other the <code>Envelope</code> to check.
* @return {boolean} true if <code>other</code> is contained in this
* <code>Envelope.</code>
*
* @see covers(Envelope)
*/
contains(other: Envelope): boolean;
/**
* Tests if the given point lies in or on the envelope.
* <p>
* Note that this is <b>not</b> the same definition as the SFS
* <tt>contains</tt>, which would exclude the envelope boundary.
*
* @param {jsts.geom.Coordinate}
* p the point which this <code>Envelope</code> is being checked for
* containing.
* @return {boolean} <code>true</code> if the point lies in the interior or on
* the boundary of this <code>Envelope</code>.
*
* @see covers(Coordinate)
*/
contains(p: Coordinate): boolean;
/**
* Tests if the given point lies in or on the envelope.
* <p>
* Note that this is <b>not</b> the same definition as the SFS
* <tt>contains</tt>, which would exclude the envelope boundary.
*
* @param {number}
* x the x-coordinate of the point which this <code>Envelope</code>
* is being checked for containing.
* @param {number}
* y the y-coordinate of the point which this <code>Envelope</code>
* is being checked for containing.
* @return {boolean} <code>true</code> if <code>(x, y)</code> lies in the
* interior or on the boundary of this <code>Envelope</code>.
*
* @see covers(double, double)
*/
contains(x: number, y: number): boolean;
/**
* Tests if the given point lies in or on the envelope.
*
* @param {number}
* x the x-coordinate of the point which this <code>Envelope</code>
* is being checked for containing.
* @param {number}
* y the y-coordinate of the point which this <code>Envelope</code>
* is being checked for containing.
* @return {boolean} <code>true</code> if <code>(x, y)</code> lies in the
* interior or on the boundary of this <code>Envelope</code>.
*/
covers(x: number, y: number): boolean;
/**
* Tests if the given point lies in or on the envelope.
*
* @param {jsts.geom.Coordinate}
* p the point which this <code>Envelope</code> is being checked for
* containing.
* @return {boolean} <code>true</code> if the point lies in the interior or on
* the boundary of this <code>Envelope</code>.
*/
covers(p: Coordinate): boolean;
/**
* Tests if the <code>Envelope other</code> lies wholely inside this
* <code>Envelope</code> (inclusive of the boundary).
*
* @param {jsts.geom.Envelope}
* other the <code>Envelope</code> to check.
* @return {boolean} true if this <code>Envelope</code> covers the
* <code>other.</code>
*/
covers(other: Envelope): boolean;
/**
* Computes the distance between this and another <code>Envelope</code>.
*
* @param {jsts.geom.Envelope}
* env The <code>Envelope</code> to test this <code>Envelope</code>
* against.
* @return {number} The distance between overlapping Envelopes is 0. Otherwise,
* the distance is the Euclidean distance between the closest points.
*/
distance(env: Envelope): number;
/**
* @param {jsts.geom.Envelope}
* other the <code>Envelope</code> to check against.
* @return {boolean} true if envelopes are equal.
*/
equals(other: Envelope): boolean;
/**
* @return {string} String representation of this <code>Envelope.</code>
*/
toString(): string;
/**
* @return {jsts.geom.Envelope} A new instance copied from this.
*/
clone(): Envelope;
}
/**
* The base class for all geometric objects.
*/
export class Geometry {
/**
* Creates a new <tt>Geometry</tt> via the specified GeometryFactory.
*/
constructor(factory?: any);
/**
* The bounding box of this <code>Geometry</code>.
*/
envelope: Envelope;
/**
* Gets the factory which contains the context in which this geometry was created.
*
* @return {jsts.geom.GeometryFactory} the factory for this geometry.
*/
getFactory(): any;
/**
* Returns the name of this object's <code>com.vivid.jts.geom</code> interface.
*
* @return {string} The name of this <code>Geometry</code>s most specific <code>jsts.geom</code> interface.
*/
getGeometryType(): string;
/**
*Returns the number of {@link Geometry}s in a {@link GeometryCollection}
* (or 1, if the geometry is not a collection).
*
* @return {number} the number of geometries contained in this geometry.
*/
getNumGeometries(): number;
/**
* Returns an element {@link Geometry} from a {@link GeometryCollection} (or
* <code>this</code>, if the geometry is not a collection).
*
* @param {number} n The index of the geometry element.
*
* @return {Geometry} the n'th geometry contained in this geometry.
*/
getGeometryN(n: number): Geometry;
/**
* Returns the <code>PrecisionModel</code> used by the <code>Geometry</code>.
*
* @return {PrecisionModel} the specification of the grid of allowable points, for this
* <code>Geometry</code> and all other <code>Geometry</code>s.
*/
getPrecisionModel(): any;
/**
* Returns a vertex of this <code>Geometry</code> (usually, but not
* necessarily, the first one). The returned coordinate should not be assumed to
* be an actual Coordinate object used in the internal representation.
*
* @return {Coordinate} a {@link Coordinate} which is a vertex of this
* <code>Geometry</code>. null if this Geometry is empty.
*/
getCoordinate(): Coordinate;
/**
* Returns an array containing the values of all the vertices for this geometry.
* If the geometry is a composite, the array will contain all the vertices for
* the components, in the order in which the components occur in the geometry.
* <p>
* In general, the array cannot be assumed to be the actual internal storage for
* the vertices. Thus modifying the array may not modify the geometry itself.
* Use the {@link CoordinateSequence#setOrdinate} method (possibly on the
* components) to modify the underlying data. If the coordinates are modified,
* {@link #geometryChanged} must be called afterwards.
*
* @return {Coordinate[]} the vertices of this <code>Geometry.</code>
* @see geometryChanged
* @see CoordinateSequence#setOrdinate
*/
getCoordinates(): Coordinate[];
/**
* Returns the count of this <code>Geometry</code>s vertices. The
* <code>Geometry</code> s contained by composite <code>Geometry</code>s
* must be Geometry's; that is, they must implement <code>getNumPoints</code>
*
* @return {number} the number of vertices in this <code>Geometry.</code>
*/
getNumPoints(): number;
/**
* Tests whether this {@link Geometry} is simple. In general, the SFS
* specification of simplicity follows the rule:
* <UL>
* <LI> A Geometry is simple iff the only self-intersections are at boundary
* points.
* </UL>
* Simplicity is defined for each {@link Geometry} subclass as follows:
* <ul>
* <li>Valid polygonal geometries are simple by definition, so
* <code>isSimple</code> trivially returns true.
* <li>Linear geometries are simple iff they do not self-intersect at points
* other than boundary points.
* <li>Zero-dimensional geometries (points) are simple iff they have no
* repeated points.
* <li>Empty <code>Geometry</code>s are always simple
* <ul>
*
* @return {boolean} <code>true</code> if this <code>Geometry</code> has any
* points of self-tangency, self-intersection or other anomalous points.
* @see #isValid
*/
isSimple(): boolean;
/**
* Tests the validity of this <code>Geometry</code>. Subclasses provide their
* own definition of "valid".
*
* @return {boolean} <code>true</code> if this <code>Geometry</code> is
* valid.
*
* @see IsValidOp
*/
isValid(): boolean;
/**
* Returns whether or not the set of points in this <code>Geometry</code> is
* empty.
*
* @return {boolean} <code>true</code> if this <code>Geometry</code> equals
* the empty geometry.
*/
isEmpty(): boolean;
/**
* Returns the minimum distance between this <code>Geometry</code> and the
* <code>Geometry</code> g
*
* @param {Geometry}
* g the <code>Geometry</code> from which to compute the distance.
* @return {number} the distance between the geometries. 0 if either input
* geometry is empty.
* @throws IllegalArgumentException
* if g is null
*/
distance(g: Geometry): number;
/**
* Tests whether the distance from this <code>Geometry</code> to another is
* less than or equal to a specified value.
*
* @param {Geometry}
* geom the Geometry to check the distance to.
* @param {number}
* distance the distance value to compare.
* @return {boolean} <code>true</code> if the geometries are less than
* <code>distance</code> apart.
*/
isWithinDistance(geom: Geometry, distance: number): boolean;
isRectangle(): boolean;
/**
* Returns the area of this <code>Geometry</code>. Areal Geometries have a
* non-zero area. They override this function to compute the area. Others return
* 0.0
*
* @return the area of the Geometry.
*/
getArea(): number;
/**
* Returns the length of this <code>Geometry</code>. Linear geometries return
* their length. Areal geometries return their perimeter. They override this
* function to compute the area. Others return 0.0
*
* @return the length of the Geometry.
*/
getLength(): number;
/**
* Computes the centroid of this <code>Geometry</code>. The centroid is equal
* to the centroid of the set of component Geometries of highest dimension
* (since the lower-dimension geometries contribute zero "weight" to the
* centroid)
*
* @return a {@link Point} which is the centroid of this Geometry.
*/
getCentroid(): Point;
/**
* Computes an interior point of this <code>Geometry</code>. An interior
* point is guaranteed to lie in the interior of the Geometry, if it possible to
* calculate such a point exactly. Otherwise, the point may lie on the boundary
* of the geometry.
*
* @return {Point} a {@link Point} which is in the interior of this Geometry.
*/
getInteriorPoint(): Point;
/**
* Returns the dimension of this geometry. The dimension of a geometry is is the
* topological dimension of its embedding in the 2-D Euclidean plane. In the JTS
* spatial model, dimension values are in the set {0,1,2}.
* <p>
* Note that this is a different concept to the dimension of the vertex
* {@link Coordinate}s. The geometry dimension can never be greater than the
* coordinate dimension. For example, a 0-dimensional geometry (e.g. a Point)
* may have a coordinate dimension of 3 (X,Y,Z).
*
* @return {number} the topological dimension of this geometry.
*/
getDimension(): number;
/**
* Returns the boundary, or an empty geometry of appropriate dimension if this
* <code>Geometry</code> is empty. (In the case of zero-dimensional
* geometries, ' an empty GeometryCollection is returned.) For a discussion of
* this function, see the OpenGIS Simple Features Specification. As stated in
* SFS Section 2.1.13.1, "the boundary of a Geometry is a set of Geometries of
* the next lower dimension."
*
* @return {Geometry} the closure of the combinatorial boundary of this
* <code>Geometry.</code>
*/
getBoundary(): Geometry;
/**
* Returns the dimension of this <code>Geometry</code>s inherent boundary.
*
* @return {number} the dimension of the boundary of the class implementing this
* interface, whether or not this object is the empty geometry. Returns
* <code>Dimension.FALSE</code> if the boundary is the empty geometry.
*/
getBoundaryDimension(): number;
/**
* Returns this <code>Geometry</code>s bounding box. If this
* <code>Geometry</code> is the empty geometry, returns an empty
* <code>Point</code>. If the <code>Geometry</code> is a point, returns a
* non-empty <code>Point</code>. Otherwise, returns a <code>Polygon</code>
* whose points are (minx, miny), (maxx, miny), (maxx, maxy), (minx, maxy),
* (minx, miny).
*
* @return {Geometry} an empty <code>Point</code> (for empty
* <code>Geometry</code>s), a <code>Point</code> (for
* <code>Point</code>s) or a <code>Polygon</code> (in all other
* cases).
*/
getEnvelope(): Geometry;
/**
* Returns the minimum and maximum x and y values in this <code>Geometry</code>,
* or a null <code>Envelope</code> if this <code>Geometry</code> is empty.
*
* @return {Envelope} this <code>Geometry</code>s bounding box; if the
* <code>Geometry</code> is empty, <code>Envelope#isNull</code> will
* return <code>true.</code>
*/
getEnvelopeInternal(): Envelope;
/**
* Tests whether this geometry is disjoint from the specified geometry.
* <p>
* The <code>disjoint</code> predicate has the following equivalent
* definitions:
* <ul>
* <li>The two geometries have no point in common
* <li>The DE-9IM Intersection Matrix for the two geometries matches
* <code>[FF*FF****]</code>
* <li><code>! g.intersects(this)</code> (<code>disjoint</code> is the
* inverse of <code>intersects</code>)
* </ul>
*
* @param {Geometry}
* g the <code>Geometry</code> with which to compare this
* <code>Geometry.</code>
* @return {boolean} <code>true</code> if the two <code>Geometry</code>s
* are disjoint.
*
* @see Geometry#intersects
*/
disjoint(g: Geometry): boolean;
/**
* Tests whether this geometry touches the specified geometry.
* <p>
* The <code>touches</code> predicate has the following equivalent
* definitions:
* <ul>
* <li>The geometries have at least one point in common, but their interiors do
* not intersect.
* <li>The DE-9IM Intersection Matrix for the two geometries matches
* <code>[FT*******]</code> or <code>[F**T*****]</code> or
* <code>[F***T****]</code>
* </ul>
* If both geometries have dimension 0, this predicate returns
* <code>false</code>
*
* @param {Geometry}
* g the <code>Geometry</code> with which to compare this
* <code>Geometry.</code>
* @return {boolean} <code>true</code> if the two <code>Geometry</code>s
* touch; Returns <code>false</code> if both <code>Geometry</code>s
* are points.
*/
touches(g: Geometry): boolean;
/**
* Tests whether this geometry intersects the specified geometry.
* <p>
* The <code>intersects</code> predicate has the following equivalent
* definitions:
* <ul>
* <li>The two geometries have at least one point in common
* <li>The DE-9IM Intersection Matrix for the two geometries matches
* <code>[T********]</code> or <code>[*T*******]</code> or
* <code>[***T*****]</code> or <code>[****T****]</code>
* <li><code>! g.disjoint(this)</code> (<code>intersects</code> is the
* inverse of <code>disjoint</code>)
* </ul>
*
* @param {Geometry}
* g the <code>Geometry</code> with which to compare this
* <code>Geometry.</code>
* @return {boolean} <code>true</code> if the two <code>Geometry</code>s
* intersect.
*
* @see Geometry#disjoint
*/
intersects(g: Geometry): boolean;
/**
* Tests whether this geometry crosses the specified geometry.
* <p>
* The <code>crosses</code> predicate has the following equivalent
* definitions:
* <ul>
* <li>The geometries have some but not all interior points in common.
* <li>The DE-9IM Intersection Matrix for the two geometries matches
* <ul>
* <li><code>[T*T******]</code> (for P/L, P/A, and L/A situations)
* <li><code>[T*****T**]</code> (for L/P, A/P, and A/L situations)
* <li><code>[0********]</code> (for L/L situations)
* </ul>
* </ul>
* For any other combination of dimensions this predicate returns
* <code>false</code>.
* <p>
* The SFS defined this predicate only for P/L, P/A, L/L, and L/A situations.
* JTS extends the definition to apply to L/P, A/P and A/L situations as well,
* in order to make the relation symmetric.
*
* @param {Geometry}
* g the <code>Geometry</code> with which to compare this
* <code>Geometry.</code>
* @return {boolean} <code>true</code> if the two <code>Geometry</code>s
* cross.
*/
crosses(g: Geometry): boolean;
/**
* Tests whether this geometry is within the specified geometry.
* <p>
* The <code>within</code> predicate has the following equivalent definitions:
* <ul>
* <li>Every point of this geometry is a point of the other geometry, and the
* interiors of the two geometries have at least one point in common.
* <li>The DE-9IM Intersection Matrix for the two geometries matches
* <code>[T*F**F***]</code>
* <li><code>g.contains(this)</code> (<code>within</code> is the converse
* of <code>contains</code>)
* </ul>
* An implication of the definition is that "The boundary of a Geometry is not
* within the Geometry". In other words, if a geometry A is a subset of the
* points in the boundary of a geomtry B, <code>A.within(B) = false</code>
*
* @param {Geometry}
* g the <code>Geometry</code> with which to compare this
* <code>Geometry.</code>
* @return {boolean} <code>true</code> if this <code>Geometry</code> is
* within <code>other.</code>
*
* @see Geometry#contains
*/
within(g: Geometry): boolean;
/**
* Tests whether this geometry contains the specified geometry.
* <p>
* The <code>contains</code> predicate has the following equivalent
* definitions:
* <ul>
* <li>Every point of the other geometry is a point of this geometry, and the
* interiors of the two geometries have at least one point in common.
* <li>The DE-9IM Intersection Matrix for the two geometries matches
* <code>[T*****FF*]</code>
* <li><code>g.within(this)</code> (<code>contains</code> is the converse
* of <code>within</code>)
* </ul>
* An implication of the definition is that "Geometries do not contain their
* boundary". In other words, if a geometry A is a subset of the points in the
* boundary of a geometry B, <code>B.contains(A) = false</code>
*
* @param {Geometry}
* g the <code>Geometry</code> with which to compare this
* <code>Geometry.</code>
* @return {boolean} <code>true</code> if this <code>Geometry</code>
* contains <code>g.</code>
*
* @see Geometry#within
*/
contains(g: Geometry): boolean;
/**
* Tests whether this geometry overlaps the specified geometry.
* <p>
* The <code>overlaps</code> predicate has the following equivalent
* definitions:
* <ul>
* <li>The geometries have at least one point each not shared by the other (or
* equivalently neither covers the other), they have the same dimension, and the
* intersection of the interiors of the two geometries has the same dimension as
* the geometries themselves.
* <li>The DE-9IM Intersection Matrix for the two geometries matches
* <code>[T*T***T**]</code> (for two points or two surfaces) or
* <code>[1*T***T**]</code> (for two curves)
* </ul>
* If the geometries are of different dimension this predicate returns
* <code>false</code>.
*
* @param {Geometry}
* g the <code>Geometry</code> with which to compare this
* <code>Geometry.</code>
* @return {boolean} <code>true</code> if the two <code>Geometry</code>s
* overlap.
*/
overlaps(g: Geometry): boolean;
/**
* Tests whether this geometry covers the specified geometry.
* <p>
* The <code>covers</code> predicate has the following equivalent definitions:
* <ul>
* <li>Every point of the other geometry is a point of this geometry.
* <li>The DE-9IM Intersection Matrix for the two geometries matches
* <code>[T*****FF*]</code> or <code>[*T****FF*]</code> or
* <code>[***T**FF*]</code> or <code>[****T*FF*]</code>
* <li><code>g.coveredBy(this)</code> (<code>covers</code> is the converse
* of <code>coveredBy</code>)
* </ul>
* If either geometry is empty, the value of this predicate is <tt>false</tt>.
* <p>
* This predicate is similar to {@link #contains}, but is more inclusive (i.e.
* returns <tt>true</tt> for more cases). In particular, unlike
* <code>contains</code> it does not distinguish between points in the
* boundary and in the interior of geometries. For most situations,
* <code>covers</code> should be used in preference to <code>contains</code>.
* As an added benefit, <code>covers</code> is more amenable to optimization,
* and hence should be more performant.
*
* @param {Geometry}
* g the <code>Geometry</code> with which to compare this
* <code>Geometry.</code>
* @return {boolean} <code>true</code> if this <code>Geometry</code> covers
* <code>g.</code>
*
* @see Geometry#contains
* @see Geometry#coveredBy
*/
covers(g: Geometry): boolean;
/**
* Tests whether this geometry is covered by the specified geometry.
* <p>
* The <code>coveredBy</code> predicate has the following equivalent
* definitions:
* <ul>
* <li>Every point of this geometry is a point of the other geometry.
* <li>The DE-9IM Intersection Matrix for the two geometries matches
* <code>[T*F**F***]</code> or <code>[*TF**F***]</code> or
* <code>[**FT*F***]</code> or <code>[**F*TF***]</code>
* <li><code>g.covers(this)</code> (<code>coveredBy</code> is the converse
* of <code>covers</code>)
* </ul>
* If either geometry is empty, the value of this predicate is <tt>false</tt>.
* <p>
* This predicate is similar to {@link #within}, but is more inclusive (i.e.
* returns <tt>true</tt> for more cases).
*