forked from ProbableTrain/MapGenerator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
4157 lines (3751 loc) · 180 KB
/
index.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
/// <reference types="openlayers" />
declare namespace jsts {
export var version: string;
namespace algorithm {
import Point = jsts.geom.Point;
import Coordinate = jsts.geom.Coordinate;
import Geometry = jsts.geom.Geometry;
import GeometryFactory = jsts.geom.GeometryFactory;
import PrecisionModel = jsts.geom.PrecisionModel;
export class Orientation {
static CLOCKWISE: number;
static RIGHT: number;
static COUNTERCLOCKWISE: number;
static LEFT: number;
static COLLINEAR: number;
static STRAIGHT: number;
static index(p1: Point, p2: Point, q: Point): number;
static isCCW(ring: Coordinate[]): boolean;
}
export class BoundaryNodeRule {}
/**
* Computes the convex hull of a Geometry.
* The convex hull is the smallest convex Geometry that contains
* all the points in the input Geometry.
* Uses the Graham Scan algorithm.
*/
export class ConvexHull {
/**
* Create a new convex hull construction for the input Coordinate array.
*/
constructor(pts: Coordinate[], geomFactory: GeometryFactory);
/**
* Create a new convex hull construction for the input Geometry.
*/
constructor(geometry: Geometry);
/**
* Returns a Geometry that represents the convex hull of the input geometry.
* The returned geometry contains the minimal number of points needed
* to represent the convex hull. In particular,
* no more than two consecutive points will be collinear.
*
* @returns if the convex hull contains 3 or more points, a Polygon;
* 2 points, a LineString; 1 point, a Point; 0 points, an empty GeometryCollection.
*/
getConvexHull(): Geometry;
}
/**
* Computes a point in the interior of an areal geometry.
* The point will lie in the geometry interior in all except certain pathological cases.
*
* KNOWN BUGS
* If a fixed precision model is used, in some cases this method
* may return a point which does not lie in the interior.
* If the input polygon is extremely narrow the computed point
* may not lie in the interior of the polygon.
*/
export class InteriorPointArea {
/**
* Creates a new interior point finder for an areal geometry.
*/
constructor(g: Geometry);
/**
* Computes an interior point for the polygonal components of a Geometry.
*
* @param geom the geometry to compute
* @returns the computed interior point, or null if the geometry has no polygonal components
*/
static getInteriorPoint(geom: Geometry): Coordinate | null;
/**
* Gets the computed interior point.
*
* @returns the coordinate of an interior point or null if the input geometry is empty
*/
getInteriorPoint(): Coordinate | null;
}
/**
* A LineIntersector is an algorithm that can both test whether
* two line segments intersect and compute the intersection point(s) if they do.
*
* There are three possible outcomes when determining whether two line segments intersect:
* NO_INTERSECTION - the segments do not intersect
* POINT_INTERSECTION - the segments intersect in a single point
* COLLINEAR_INTERSECTION - the segments are collinear and they intersect in a line segment
*
* For segments which intersect in a single point, the point may be either an endpoint
* or in the interior of each segment.
* If the point lies in the interior of both segments,
* this is termed a proper intersection. The method isProper() test for this situation.
*
* The intersection point(s) may be computed in a precise or non-precise manner.
* Computing an intersection point precisely involves rounding it via a supplied PrecisionModel.
*
* LineIntersectors do not perform an initial envelope intersection test to determine
* if the segments are disjoint. This is because this class is likely to be used
* in a context where envelope overlap is already known to occur (or be likely).
*/
export class LineIntersector {
/** */
static COLLINEAR: number;
/**
* Indicates that line segments intersect in a line segment
*/
static COLLINEAR_INTERSECTION: number;
/** */
static DO_INTERSECT: number;
/**
* These are deprecated, due to ambiguous naming
*/
static DONT_INTERSECT: number;
/**
* Indicates that line segments do not intersect
*/
static NO_INTERSECTION: number;
/**
* Indicates that line segments intersect in a single point
*/
static POINT_INTERSECTION: number;
/** */
constructor();
/**
* Computes the "edge distance" of an intersection point p along a segment.
* The edge distance is a metric of the point along the edge.
* The metric used is a robust and easy to compute metric function.
* It is not equivalent to the usual Euclidean metric.
* It relies on the fact that either the x or the y ordinates of the points
* in the edge are unique, depending on whether the edge is longer
* in the horizontal or vertical direction.
*
* NOTE: This function may produce incorrect distances for inputs
* where p is not precisely on p1-p2
* (E.g. p = (139,9) p1 = (139,10), p2 = (280,1) produces distance 0.0, which is incorrect.
* My hypothesis is that the function is safe to use for points which are
* the result of rounding points which lie on the line,
* but not safe to use for truncated points.
*/
static computeEdgeDistance(p: Coordinate, p0: Coordinate, p1: Coordinate): number;
/**
* This function is non-robust, since it may compute the square of large numbers.
* Currently not sure how to improve this.
*/
static nonRobustComputeEdgeDistance(p: Coordinate, p1: Coordinate, p2: Coordinate): number;
/**
* Force computed intersection to be rounded to a given precision model.
* No getter is provided, because the precision model is not required to be specified.
*/
setPrecisionModel(precisionModel: PrecisionModel): void;
/**
* Gets an endpoint of an input segment.
* @param {int} segmentIndex the index of the input segment (0 or 1)
* @param {int} ptIndex the index of the endpoint (0 or 1)
* @returns the specified endpoint
*/
getEndpoint(segmentIndex: number, ptIndex: number): Coordinate;
/**
* Computes the intersection of the lines p1-p2 and p3-p4.
* This function computes both the boolean value of the hasIntersection test
* and the (approximate) value of the intersection point itself (if there is one).
*/
computeIntersection(p1: Coordinate, p2: Coordinate, p3: Coordinate, p4: Coordinate): void;
toString(): string;
/**
* Tests whether the input geometries intersect.
*
* @returns true if the input geometries intersect
*/
hasIntersection(): boolean;
/**
* Returns the number of intersection points found. This will be either 0, 1 or 2.
* @returns {int} the number of intersection points found (0, 1, or 2)
*/
getIntersectionNum(): number;
/**
* @param {int} intIndex is 0 or 1
* @returns the intIndex'th intersection point
*/
getIntersection(intIndex: number): Coordinate;
/**
* Test whether a point is a intersection point of two line segments.
* Note that if the intersection is a line segment, this method only tests
* for equality with the endpoints of the intersection segment.
* It does not return true if the input point is internal to the intersection segment.
*
* @returns true if the input point is one of the intersection points.
*/
isIntersection(pt: Coordinate): boolean;
/**
* Tests whether either intersection point is an interior point of one of the input segments.
*
* @returns true if either intersection point is in the interior of one of the input segments
*/
isInteriorIntersection(): boolean;
/**
* Tests whether either intersection point is an interior point of the specified input segment.
* @param {int} inputLineIndex
*
* @returns true if either intersection point is in the interior of the input segment
*/
isInteriorIntersection(inputLineIndex: number): boolean;
/**
* Tests whether an intersection is proper.
* The intersection between two line segments is considered proper if they intersect
* in a single point in the interior of both segments
* (e.g. the intersection is a single point and is not equal to any of the endpoints).
* The intersection between a point and a line segment is considered proper if
* the point lies in the interior of the segment (e.g. is not equal to either of the endpoints).
*
* @returns true if the intersection is proper
*/
isProper(): boolean;
/**
* Computes the intIndex'th intersection point in the direction
* of a specified input line segment
*
* @param {int} segmentIndex is 0 or 1
* @param {int} intIndex is 0 or 1
*
* @returns the intIndex'th intersection point in the direction
* of the specified input line segment
*/
getIntersectionAlongSegment(segmentIndex: number, intIndex: number): Coordinate;
/**
* Computes the index (order) of the intIndex'th intersection point
* in the direction of a specified input line segment
*
* @param {int} segmentIndex is 0 or 1
* @param {int} intIndex is 0 or 1
*
* @returns {int} the index of the intersection point along the input segment (0 or 1)
*/
getIndexAlongSegment(segmentIndex: number, intIndex: number): number;
/**
* Computes the "edge distance" of an intersection point
* along the specified input line segment.
*
* @param {int} segmentIndex is 0 or 1
* @param {int} intIndex is 0 or 1
*
* @returns {double} the edge distance of the intersection point
*/
getEdgeDistance(segmentIndex: number, intIndex: number): number;
}
/**
* A robust version of {@link LineIntersector}.
*/
export class RobustLineIntersector extends LineIntersector {
/** */
constructor();
/**
* Compute the intersection of a point p and the line p1-p2.
* This function computes the boolean value of the hasIntersection test.
* The actual value of the intersection (if there is one) is equal to the value of p.
*/
computeIntersection(p: Coordinate, p1: Coordinate, p2: Coordinate): void;
computeIntersection(p: Coordinate, p1: Coordinate, p2: Coordinate, p3: Coordinate): void;
}
namespace locate {
import Polygon = jsts.geom.Polygon;
/**
* An interface for classes which determine the Location of points in a Geometry.
*/
interface PointOnGeometryLocator {
/**
* Determines the Location of a point in the Geometry.
*
* @param p the point to test
*
* @returns {int} the location of the point in the geometry
*/
locate(p: Coordinate): number;
}
/**
* Computes the location of points relative to a Polygonal Geometry,
* using a simple O(n) algorithm.
*
* The algorithm used reports if a point lies in the interior, exterior,
* or exactly on the boundary of the Geometry.
*
* Instance methods are provided to implement the interface PointInAreaLocator.
* However, they provide no performance advantage over the class methods.
*
* This algorithm is suitable for use in cases where only a few points will be tested.
* If many points will be tested, IndexedPointInAreaLocator may provide better performance.
*/
export class SimplePointInAreaLocator implements PointOnGeometryLocator {
/**
* Create an instance of a point-in-area locator, using the provided areal geometry.
*/
constructor(geom: Geometry);
/**
* Determines the Location of a point in an areal Geometry. The return value is one of:
* Location.INTERIOR if the point is in the geometry interior
* Location.BOUNDARY if the point lies exactly on the boundary
* Location.EXTERIOR if the point is outside the geometry
*
* @returns {int} the Location of the point in the geometry
*/
static locate(p: Coordinate, geom: Geometry): number;
/**
* Determines whether a point is contained in a Geometry, or lies on its boundary.
* This is a convenience method for Location.EXTERIOR != locate(p, geom)
*/
static isContained(p: Coordinate, geom: Geometry): boolean;
/**
* Determines the Location of a point in a Polygon. The return value is one of:
* - Location.INTERIOR if the point is in the geometry interior
* - Location.BOUNDARY if the point lies exactly on the boundary
* - Location.EXTERIOR if the point is outside the geometry
* This method is provided for backwards compatibility only. Use locate(Coordinate, Geometry) instead.
*
* @param p {Coordinate} the point to test
* @param poly {Polygon} the geometry to test
*
* @returns {int} the Location of the point in the polygon
*/
static locatePointInPolygon(p: Coordinate, poly: Polygon): number;
/**
* Determines whether a point lies in a Polygon. If the point lies on the polygon boundary it is considered to be inside.
*
* @param p {Coordinate} the point to test
* @param poly {Polygon} the geometry to test
*
* @returns {boolean} true if the point lies in or on the polygon
*/
static containsPointInPolygon(p: Coordinate, poly: Polygon): boolean;
/**
* Determines the Location of a point in an areal Geometry. The return value is one of:
* - Location.INTERIOR if the point is in the geometry interior
* - Location.BOUNDARY if the point lies exactly on the boundary
* - Location.EXTERIOR if the point is outside the geometry
*
* @param p {Coordinate} the point to test
*
* @returns {int} the Location of the point in the geometry
*/
locate(p: Coordinate): number;
}
}
}
namespace densify {
import Geometry = jsts.geom.Geometry;
/**
* Densifies a Geometry by inserting extra vertices along the line segments
* contained in the geometry. All segments in the created densified geometry
* will be no longer than than the given distance tolerance.
* Densified polygonal geometries are guaranteed to be topologically correct.
* The coordinates created during densification respect the input geometry's PrecisionModel.
*/
export class Densifier {
/**
* Creates a new densifier instance.
*/
constructor(inputGeom: Geometry);
/**
* Densifies a geometry using a given distance tolerance,
* and respecting the input geometry's PrecisionModel.
*
* @param geom the geometry to densify
* @param {double} distanceTolerance the distance tolerance to densify
*
* @returns the densified geometry
*/
static densify(geom: Geometry, distanceTolerance: number): Geometry;
/**
* Sets the distance tolerance for the densification.
* All line segments in the densified geometry will be no longer than
* the distance tolerance. simplified geometry will be within this distance
* of the original geometry. The distance tolerance must be positive.
*
* @param {double} distanceTolerance the densification tolerance to use
*/
setDistanceTolerance(distanceTolerance: number): void;
/**
* Gets the densified geometry.
*/
getResultGeometry(): Geometry;
}
}
namespace geom {
/**
* Specifies the precision model of the Coordinates in a Geometry. In other words, specifies the grid of allowable points for all Geometrys.
* The makePrecise method allows rounding a coordinate to a "precise" value; that is, one whose precision is known exactly.
*
* Coordinates are assumed to be precise in geometries. That is, the coordinates are assumed to be rounded to the precision model given for the geometry. JTS input routines automatically round coordinates to the precision model before creating Geometries. All internal operations assume that coordinates are rounded to the precision model. Constructive methods (such as boolean operations) always round computed coordinates to the appropriate precision model.
*
* Currently one type of precision model are supported:
*
* FLOATING - represents full double precision floating point.
* Coordinates are represented internally as Java double-precision values. Since Java uses the IEEE-754 floating point standard, this provides 53 bits of precision.
*
* JSTS methods currently do not handle inputs with different precision models.
*/
export class PrecisionModel {
static FIXED: string;
static FLOATING: string;
static FLOATING_SINGLE: string;
/**
* @param modelType
*/
constructor(modelType?: number | string);
}
/**
* Supplies a set of utility methods for building Geometry objects from lists
* of Coordinates.
*
* Note that the factory constructor methods do <b>not</b> change the input
* coordinates in any way.
*
* In particular, they are not rounded to the supplied <tt>PrecisionModel</tt>.
* It is assumed that input Coordinates meet the given precision.
*/
export class GeometryFactory {
/**
* Constructs a GeometryFactory that generates Geometries having a floating PrecisionModel and a spatial-reference ID of 0.
*/
constructor(precisionModel?: PrecisionModel);
createPointFromInternalCoord(coord: Coordinate, exemplar: Geometry): Point;
/**
* Creates a Geometry with the same extent as the given envelope. The Geometry returned is guaranteed to be valid. To provide this behaviour, the following cases occur:
*
* If the Envelope is:
* - null : returns an empty Point
* - a point : returns a non-empty Point
* - a line : returns a two-point LineString
* - a rectangle : returns a Polygon whose points are (minx, miny), (minx, maxy), (maxx, maxy), (maxx, miny), (minx, miny).
*
* @param {Envelope} envelope the Envelope to convert
*
* @returns {Geometry} an empty Point (for null Envelopes), a Point (when min x = max x and min y = max y) or a Polygon (in all other cases)
*/
toGeometry(envelope: Envelope): Geometry;
/**
* Returns the PrecisionModel that Geometries created by this factory will be associated with.
*
* @returns {PrecisionModel} the PrecisionModel for this factory
*/
getPrecisionModel(): PrecisionModel;
/**
* Constructs an empty LineString geometry.
*
* @returns an empty LineString
*/
createLineString(): LineString;
/**
* Creates a LineString using the given Coordinates; a null or empty array will
* create an empty LineString. Consecutive points must not be equal.
*
* @param {Coordinate[]}
* coordinates an array without null elements, or an empty array, or
* null.
* @return {LineString} A new LineString.
*/
createLineString(coordinates: Coordinate[]): LineString;
/**
* Creates a LineString using the given CoordinateSequence.
* A null or empty CoordinateSequence creates an empty LineString.
*
* @param coordinates a CoordinateSequence (possibly empty), or null
*/
createLineString(coordinates: CoordinateSequence): LineString;
/**
* Constructs an empty Point geometry.
*
* @returns {Point} an empty Point
*/
createPoint(): Point;
/**
* Creates a Point using the given Coordinate; a null Coordinate will create an
* empty Geometry.
*
* @param {Coordinate}
* coordinate Coordinate to base this Point on.
* @return {Point} A new Point.
*/
createPoint(coordinates: Coordinate): Point;
/**
* Creates a Point using the given CoordinateSequence; a null or empty CoordinateSequence will create an empty Point.
*
* @param {CoordinateSequence} coordinates a CoordinateSequence (possibly empty), or null
*
* @returns {Point} the created Point
*/
createPoint(coordinates: CoordinateSequence): Point;
/**
* Constructs an empty MultiPoint geometry.
*
* @returns an empty MultiPoint
*/
createMultiPoint(): MultiPoint;
/**
* Creates a MultiPoint using the given Points. A null or empty array will create an empty MultiPoint.
*
* @param point an array of Points (without null elements), or an empty array, or null
*
* @returns a MultiPoint object
*/
createMultiPoint(point: Point[]): MultiPoint;
/**
* @deprecated Deprecated. Use createMultiPointFromCoords(org.locationtech.jts.geom.Coordinate[]) instead
*
* Creates a MultiPoint using the given Coordinates. A null or empty array will create an empty MultiPoint.
*
* @param coordinates an array (without null elements), or an empty array, or null
*
* @returns a MultiPoint object
*/
createMultiPoint(coordinates: Coordinate[]): MultiPoint;
/**
* Creates a MultiPoint using the points in the given CoordinateSequence.
* A null or empty CoordinateSequence creates an empty MultiPoint.
*
* @param coordinates a CoordinateSequence (possibly empty), or null
* @returns a MultiPoint geometry
*/
createMultiPoint(coordinates: CoordinateSequence): MultiPoint;
/**
* Creates a MultiPoint using the given Coordinates. A null or empty array will create an empty MultiPoint.
*
* @param coordinates an array (without null elements), or an empty array, or null
*
* @returns a MultiPoint object
*/
createMultiPointFromCoords(coordinates: Coordinate[]): MultiPoint;
/**
* Constructs an empty LinearRing geometry.
*
* @returns an empty LinearRing
*/
createLinearRing(): LinearRing;
/**
* Creates a LinearRing using the given Coordinates; a null or empty array
* will create an empty LinearRing. Consecutive points must not be equal.
*
* @param {Coordinate[]}
* coordinates an array without null elements, or an empty array,
* or null.
* @return {LineString} A new LinearRing.
*/
createLinearRing(coordinates: Coordinate[]): LinearRing;
/**
* Creates a LinearRing using the given CoordinateSequence.
* A null or empty array creates an empty LinearRing.
* The points must form a closed and simple linestring.
*
* @param coordinates a CoordinateSequence (possibly empty), or null
*
* @returns the created LinearRing
*
* @throws {IllegalArgumentException} if the ring is not closed, or has too few points
*/
createLinearRing(coordinates: CoordinateSequence): LinearRing;
/**
* Creates a Polygon using the given LinearRing.
*
* @param {LinearRing} shell A LinearRing constructed by coordinates.
* @return {Polygon} A new Polygon.
*/
createPolygon(shell: LinearRing, holes: LinearRing[]): Polygon;
/**
* Constructs a Polygon with the given exterior boundary.
*
* @param shell the outer boundary of the new Polygon, or null or an empty LinearRing if the empty geometry is to be created.
*
* @throws {IllegalArgumentException} if the boundary ring is invalid
*/
createPolygon(shell: CoordinateSequence): Polygon;
/**
* Constructs a Polygon with the given exterior boundary.
*
* @param shell the outer boundary of the new Polygon, or null or an empty LinearRing if the empty geometry is to be created.
*
* @throws {IllegalArgumentException} if the boundary ring is invalid
*/
createPolygon(shell: Coordinate[]): Polygon;
/**
* Constructs a Polygon with the given exterior boundary.
*
* @param shell the outer boundary of the new Polygon, or null or an empty LinearRing if the empty geometry is to be created.
*
* @throws {IllegalArgumentException} if the boundary ring is invalid
*/
createPolygon(shell: LinearRing): Polygon;
/**
* Constructs an empty Polygon geometry.
*
* @returns an empty polygon
*/
createPolygon(): Polygon;
/**
* Constructs an empty MultiPolygon geometry.
*
* @returns an empty MultiPolygon
*/
createMultiPolygon(): MultiPolygon;
/**
* Creates a MultiPolygon using the given Polygons; a null or empty array will create an empty Polygon. The polygons must conform to the assertions specified in the OpenGIS Simple Features Specification for SQL.
*
* @param polygons Polygons, each of which may be empty but not null
*
* @returns the created MultiPolygon
*/
createMultiPolygon(polygons: Polygon[]): MultiPolygon;
/**
* Constructs an empty MultiLineString geometry.
*
* @returns {MultiLineString} an empty MultiLineString
*/
createMultiLineString(): MultiLineString;
/**
* Creates a MultiLineString using the given LineStrings; a null or empty array will create an empty MultiLineString.
*
* @param lineStrings LineStrings, each of which may be empty but not null
*
* @returns the created MultiLineString
*/
createMultiLineString(lineStrings: LineString[]): MultiLineString;
/**
* Constructs an empty GeometryCollection geometry.
*
* @returns {GeometryCollection} an empty GeometryCollection
*/
createGeometryCollection(): GeometryCollection;
/**
* Creates a GeometryCollection using the given Geometries; a null or empty array will create an empty GeometryCollection.
*
* @param geometries an array of Geometries, each of which may be empty but not null, or null
*
* @returns the created GeometryCollection
*/
createGeometryCollection(geometries: Geometry[]): GeometryCollection;
/**
* Creates an empty atomic geometry of the given dimension.
* If passed a dimension of -1 will create an empty GeometryCollection.
*
* @param {int} dimension the required dimension (-1, 0, 1 or 2)
*
* @returns an empty atomic geometry of given dimension
*/
createEmpty(dimension: number): Geometry;
/**
* Creates a deep copy of the input Geometry.
* The CoordinateSequenceFactory defined for this factory is used
* to copy the CoordinateSequences of the input geometry.
* This is a convenient way to change the CoordinateSequence used to represent a geometry,
* or to change the factory used for a geometry.
* Geometry.copy() can also be used to make a deep copy,
* but it does not allow changing the CoordinateSequence type.
*
* @returns a deep copy of the input geometry, using the CoordinateSequence type of this factory
*
* @see Geometry.copy()
*/
createGeometry(g: Geometry): Geometry;
/**
* Gets the SRID value defined for this factory.
*
* @returns {int} the factory SRID value
*/
getSRID(): number;
getCoordinateSequenceFactory(): CoordinateSequenceFactory;
}
export class GeometryCollection extends jsts.geom.Geometry {
constructor(geometries?: Geometry[], factory?: GeometryFactory);
}
/**
* 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(x: number, y: number);
/** */
constructor(c: Coordinate);
/** */
constructor();
/** */
constructor(x: number, y: number, z: number);
/**
* 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;
}
export class CoordinateSequence {
static X: number;
static Y: number;
static Z: number;
static M: number;
}
export interface CoordinateSequenceFactory {
/**
* Returns a CoordinateSequence based on the given array.
* Whether the array is copied or simply referenced is implementation-dependent.
* This method must handle null arguments by creating an empty sequence.
*
* @param coordinates the coordinates
*/
create(coordinates: Coordinate[]): CoordinateSequence;
/**
* Creates a CoordinateSequence which is a copy of the given CoordinateSequence.
* This method must handle null arguments by creating an empty sequence.
*
* @param coordSeq the coordinate sequence to copy
*/
create(coordSeq: CoordinateSequence): CoordinateSequence;
/**
* Creates a CoordinateSequence of the specified size and dimension.
* For this to be useful, the CoordinateSequence implementation must be mutable.
* If the requested dimension is larger than the CoordinateSequence implementation can provide,
* then a sequence of maximum possible dimension should be created. An error should not be thrown.
*
* @param {int} size the number of coordinates in the sequence
* @param {int} dimension the dimension of the coordinates in the sequence (if user-specifiable, otherwise ignored)
*/
create(size: number, dimension: number): CoordinateSequence;
/**
* Creates a CoordinateSequence of the specified size and dimension with measure support.
* For this to be useful, the CoordinateSequence implementation must be mutable.
* If the requested dimension or measures are larger than the CoordinateSequence implementation can provide,
* then a sequence of maximum possible dimension should be created. An error should not be thrown.
*
* @param {int} size the number of coordinates in the sequence
* @param {int} dimension the dimension of the coordinates in the sequence (if user-specifiable, otherwise ignored)
* @param {int} measures the number of measures of the coordinates in the sequence (if user-specifiable, otherwise ignored)
*/
create(size: number, dimension: number, measures: number): CoordinateSequence;
}
/**
* 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>.
*