new MultiPolygon()
 Source:
Extends
Members
envelope
The bounding box of this Geometry
.
 Inherited From:
 Source:
(protected) factory
The GeometryFactory used to create this Geometry
 Overrides:
 Source:
Methods
apply(filter)
Performs an operation with or on this Geometry
and its
subelement Geometry
s (if any). Only GeometryCollections and
subclasses have subelement Geometry's.
Parameters:
Name 
Type 
Description 
filter 

the filter to apply to this Geometry (and its
children, if it is a GeometryCollection ). 
 Inherited From:
 Source:
buffer(distance, quadrantSegments, endCapStyle) → {Geometry}
Computes a buffer area around this geometry having the given width and with a
specified accuracy of approximation for circular arcs, and using a specified
end cap style.
Mathematicallyexact buffer area boundaries can contain circular arcs. To
represent these arcs using linear geometry they must be approximated with
line segments. The quadrantSegments
argument allows
controlling the accuracy of the approximation by specifying the number of
line segments used to represent a quadrant of a circle
The end cap style specifies the buffer geometry that will be created at the
ends of linestrings. The styles provided are:
 BufferOp.CAP_ROUND  (default) a semicircle
 BufferOp.CAP_BUTT  a straight line perpendicular to the end
segment
 BufferOp.CAP_SQUARE  a halfsquare
The buffer operation always returns a polygonal result. The negative or
zerodistance buffer of lines and points is always an empty Polygon.
This is also the result for the buffers of degenerate (zeroarea) polygons.
Parameters:
Name 
Type 
Description 
distance 
number

the width of the buffer (may be positive, negative or 0). 
quadrantSegments 
number

the number of line segments used to represent a
quadrant of a circle. 
endCapStyle 
number

the end cap style to use. 
 Inherited From:
 Source:
 See:

Throws:
TopologyException
if a robustness error occurs
Returns:
a polygonal geometry representing the buffer region (which
may be empty).

Type

Geometry
checkNotGeometryCollection(g)
Throws an exception if g
's class is
GeometryCollection
. (Its subclasses do not trigger an
exception).
Parameters:
Name 
Type 
Description 
g 
Geometry

the Geometry to check. 
 Inherited From:
 Source:
Throws:
Error
if g
is a GeometryCollection
but not
one of its subclasses
clone()
Creates and returns a full copy of this GeometryCollection object.
(including all coordinates contained by it).
 Inherited From:
 Source:
Returns:
a clone of this instance.
compare(a, b) → {number}
Returns the first nonzero result of compareTo
encountered as
the two Collection
s are iterated over. If, by the time one of
the iterations is complete, no nonzero result has been encountered, returns
0 if the other iteration is also complete. If b
completes
before a
, a positive number is returned; if a before b, a
negative number.
Parameters:
Name 
Type 
Description 
a 
Array

a Collection of Comparable s. 
b 
Array

a Collection of Comparable s. 
 Inherited From:
 Source:
Returns:
the first nonzero compareTo
result, if any;
otherwise, zero.

Type

number
compareTo(other) → {number}
Returns whether this
Geometry
is greater than, equal to, or
less than another
Geometry
.
If their classes are different, they are compared using the following
ordering:
 Point (lowest)
 MultiPoint
 LineString
 LinearRing
 MultiLineString
 Polygon
 MultiPolygon
 GeometryCollection (highest)
If the two
Geometry
s have the same class, their first
elements are compared. If those are the same, the second elements are
compared, etc.
Parameters:
Name 
Type 
Description 
other 
Geometry

a Geometry with which to compare this
Geometry. 
 Inherited From:
 Source:
Returns:
a positive number, 0, or a negative number, depending on
whether this object is greater than, equal to, or less than
o
, as defined in "Normal Form For Geometry" in the
JTS Technical Specifications.

Type

number
compareToSameClass(o)
Returns whether this Geometry
is greater than, equal to, or
less than another Geometry
having the same class.
Parameters:
Name 
Type 
Description 
o 

a Geometry having the same class as this
Geometry. 
 Inherited From:
 Source:
Returns:
a positive number, 0, or a negative number, depending on whether this
object is greater than, equal to, or less than o
, as
defined in "Normal Form For Geometry" in the JTS Technical
Specifications.
(protected) computeEnvelopeInternal()
 Inherited From:
 Source:
contains(g) → {boolean}
Tests whether this geometry contains the specified geometry.
The contains
predicate has the following equivalent
definitions:
 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.
 The DE9IM Intersection Matrix for the two geometries matches
[T*****FF*]
g.within(this)
(contains
is the converse
of within
)
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,
B.contains(A) = false
Parameters:
Name 
Type 
Description 
g 
Geometry

the Geometry with which to compare this
Geometry. 
 Inherited From:
 Source:
 See:

Returns:
true
if this Geometry
contains g.

Type

boolean
convexHull() → {Geometry}
Computes the smallest convex
Polygon
that contains all the
points in the
Geometry
. This obviously applies only to
Geometry
s which contain 3 or more points; the results for
degenerate cases are specified as follows:
Number of Point s in argument Geometry

Geometry class of result 
0 
empty GeometryCollection 
1 
Point 
2 
LineString 
3 or more 
Polygon 
 Inherited From:
 Source:
Returns:
the minimumarea convex polygon containing this
Geometry
' s points.

Type

Geometry
coveredBy(g) → {boolean}
Tests whether this geometry is covered by the specified geometry.
The coveredBy
predicate has the following equivalent
definitions:
 Every point of this geometry is a point of the other geometry.
 The DE9IM Intersection Matrix for the two geometries matches
[T*F**F***]
or [*TF**F***]
or
[**FT*F***]
or [**F*TF***]
g.covers(this)
(coveredBy
is the converse
of covers
)
If either geometry is empty, the value of this predicate is
false.
This predicate is similar to #within, but is more inclusive (i.e.
returns true for more cases).
Parameters:
Name 
Type 
Description 
g 
Geometry

the Geometry with which to compare this
Geometry. 
 Inherited From:
 Source:
 See:

 Geometry#within
 Geometry#covers
Returns:
true
if this Geometry
is
covered by g.

Type

boolean
covers(g) → {boolean}
Tests whether this geometry covers the specified geometry.
The covers
predicate has the following equivalent definitions:
 Every point of the other geometry is a point of this geometry.
 The DE9IM Intersection Matrix for the two geometries matches
[T*****FF*]
or [*T****FF*]
or
[***T**FF*]
or [****T*FF*]
g.coveredBy(this)
(covers
is the converse
of coveredBy
)
If either geometry is empty, the value of this predicate is
false.
This predicate is similar to #contains, but is more inclusive (i.e.
returns true for more cases). In particular, unlike
contains
it does not distinguish between points in the
boundary and in the interior of geometries. For most situations,
covers
should be used in preference to contains
.
As an added benefit, covers
is more amenable to optimization,
and hence should be more performant.
Parameters:
Name 
Type 
Description 
g 
Geometry

the Geometry with which to compare this
Geometry. 
 Inherited From:
 Source:
 See:

 Geometry#contains
 Geometry#coveredBy
Returns:
true
if this Geometry
covers
g.

Type

boolean
crosses(g) → {boolean}
Tests whether this geometry crosses the specified geometry.
The crosses
predicate has the following equivalent
definitions:
 The geometries have some but not all interior points in common.
 The DE9IM Intersection Matrix for the two geometries matches
[T*T******]
(for P/L, P/A, and L/A situations)
[T*****T**]
(for L/P, A/P, and A/L situations)
[0********]
(for L/L situations)
For any other combination of dimensions this predicate returns
false
.
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.
Parameters:
Name 
Type 
Description 
g 
Geometry

the Geometry with which to compare this
Geometry. 
 Inherited From:
 Source:
Returns:
true
if the two Geometry
s
cross.

Type

boolean
difference(other) → {Geometry}
Computes a Geometry
representing the points making up this
Geometry
that do not make up other
. This
method returns the closure of the resultant Geometry
.
Parameters:
Name 
Type 
Description 
other 
Geometry

the Geometry with which to compute the
difference. 
 Inherited From:
 Source:
Throws:
Returns:
the point set difference of this Geometry
with other.

Type

Geometry
disjoint(g) → {boolean}
Tests whether this geometry is disjoint from the specified geometry.
The disjoint
predicate has the following equivalent
definitions:
 The two geometries have no point in common
 The DE9IM Intersection Matrix for the two geometries matches
[FF*FF****]
! g.intersects(this)
(disjoint
is the
inverse of intersects
)
Parameters:
Name 
Type 
Description 
g 
Geometry

the Geometry with which to compare this
Geometry. 
 Inherited From:
 Source:
 See:

Returns:
true
if the two Geometry
s
are disjoint.

Type

boolean
distance(g) → {number}
Returns the minimum distance between this Geometry
and the
Geometry
g
Parameters:
Name 
Type 
Description 
g 
Geometry

the Geometry from which to compute the distance. 
 Inherited From:
 Source:
Throws:
IllegalArgumentException
if g is null
Returns:
the distance between the geometries. 0 if either input
geometry is empty.

Type

number
equal(a, b, tolerance) → {boolean}
Parameters:
 Inherited From:
 Source:
Returns:
true if equal.

Type

boolean
equals(o) → {boolean}
Tests whether this geometry is structurally and numerically equal to a given
Object. If the argument
Object is not a
Geometry, the result is
false. Otherwise, the result
is computed using #equalsExact(Geometry).
This method is provided to fulfill the Java contract for valuebased object
equality. In conjunction with #hashCode() it provides semantics which
are most useful for using Geometrys as keys and values in Java
collections.
Note that to produce the expected result the input geometries should be in
normal form. It is the caller's responsibility to perform this where required
(using or as appropriate).
Parameters:
Name 
Type 
Description 
o 
Object

the Object to compare. 
 Inherited From:
 Source:
 See:

Returns:
true if this geometry is exactly equal to the argument.

Type

boolean
equalsExact(other, tolerance) → {boolean
Parameters:
Name 
Type 
Description 
other 
Geometry


tolerance 
double


 Overrides:
 Source:
Returns:

Type

boolean
equalsNorm(g) → {boolean}
Tests whether two geometries are exactly equal in their normalized forms.
This is a convenience method which creates normalized versions of both
geometries before computing #equalsExact(Geometry). This method is
relatively expensive to compute. For maximum performance, the client should
instead perform normalization itself at an appropriate point during
execution.
Parameters:
Name 
Type 
Description 
g 
Geometry

a Geometry. 
 Inherited From:
 Source:
Returns:
true if the input geometries are exactly equal in their
normalized form.

Type

boolean
equalsTopo(g) → {boolean}
Tests whether this geometry is topologically equal to the argument geometry
as defined by the SFS
equals predicate.
The SFS equals
predicate has the following equivalent
definitions:
 The two geometries have at least one point in common, and no point of
either geometry lies in the exterior of the other geometry.
 The DE9IM Intersection Matrix for the two geometries matches the
pattern T*F**FFF*
T*F
**F
FF*
Note that this method computes
topologically equality. For
structural equality, see #equalsExact(Geometry).
Parameters:
Name 
Type 
Description 
g 
Geometry

the Geometry with which to compare this
Geometry. 
 Inherited From:
 Source:
 See:

Returns:
true
if the two Geometry
s
are topologically equal.

Type

boolean
getArea()
Returns the area of this Geometry
. Areal Geometries have a
nonzero area. They override this function to compute the area. Others return
0.0
 Inherited From:
 Source:
Returns:
the area of the Geometry.
getBoundary() → {Geometry}
Computes the boundary of this geometry
 Overrides:
 Source:
 See:

Returns:
a lineal geometry (which may be empty).

Type

Geometry
getBoundaryDimension() → {number}
Returns the dimension of this Geometry
s inherent boundary.
 Inherited From:
 Source:
Returns:
the dimension of the boundary of the class implementing this
interface, whether or not this object is the empty geometry. Returns
Dimension.FALSE
if the boundary is the empty geometry.

Type

number
getCentroid()
Computes the centroid of this Geometry
. The centroid is equal
to the centroid of the set of component Geometries of highest dimension
(since the lowerdimension geometries contribute zero "weight" to the
centroid)
 Inherited From:
 Source:
Returns:
a Point which is the centroid of this Geometry.
getCoordinate() → {Coordinate}
 Inherited From:
 Source:
Returns:

Type

Coordinate
getCoordinates() → {Array.<Coordinate>}
Collects all coordinates of all subgeometries into an Array.
Note that while changes to the coordinate objects themselves may modify the
Geometries in place, the returned Array as such is only a temporary
container which is not synchronized back.
 Inherited From:
 Source:
Returns:
the collected coordinates.

Type

Array.<Coordinate>
getDimension() → {number}
Returns the dimension of this geometry. The dimension of a geometry is is the
topological dimension of its embedding in the 2D Euclidean plane. In the JTS
spatial model, dimension values are in the set {0,1,2}.
Note that this is a different concept to the dimension of the vertex
Coordinates. The geometry dimension can never be greater than the
coordinate dimension. For example, a 0dimensional geometry (e.g. a Point)
may have a coordinate dimension of 3 (X,Y,Z).
 Inherited From:
 Source:
Returns:
the topological dimension of this geometry.

Type

number
getEnvelope() → {Geometry}
Returns this Geometry
s bounding box. If this
Geometry
is the empty geometry, returns an empty
Point
. If the Geometry
is a point, returns a
nonempty Point
. Otherwise, returns a Polygon
whose points are (minx, miny), (maxx, miny), (maxx, maxy), (minx, maxy),
(minx, miny).
 Inherited From:
 Source:
Returns:
an empty Point
(for empty
Geometry
s), a Point
(for
Point
s) or a Polygon
(in all other
cases).

Type

Geometry
getEnvelopeInternal() → {Envelope}
Returns the minimum and maximum x and y values in this Geometry
,
or a null Envelope
if this Geometry
is empty.
 Inherited From:
 Source:
Returns:
this Geometry
s bounding box; if the
Geometry
is empty, Envelope#isNull
will
return true.

Type

Envelope
Gets the factory which contains the context in which this geometry was
created.
 Inherited From:
 Source:
Returns:
the factory for this geometry.

Type

jsts.geom.GeometryFactory
getGeometryN(n) → {Geometry}
Parameters:
Name 
Type 
Description 
n 
int


 Inherited From:
 Source:
Returns:

Type

Geometry
getGeometryType() → {string}
Returns the name of this object's com.vivid.jts.geom
interface.
 Inherited From:
 Source:
Returns:
the name of this Geometry
s most specific
jsts.geom
interface.

Type

string
getInteriorPoint() → {Point}
Computes an interior point of this Geometry
. 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.
 Inherited From:
 Source:
Returns:
a Point which is in the interior of this Geometry.

Type

Point
getLength()
Returns the length of this Geometry
. Linear geometries return
their length. Areal geometries return their perimeter. They override this
function to compute the area. Others return 0.0
 Inherited From:
 Source:
Returns:
the length of the Geometry.
getNumGeometries() → {int}
 Inherited From:
 Source:
Returns:

Type

int
getNumPoints() → {number}
 Inherited From:
 Source:
Returns:

Type

number
getPrecisionModel() → {PrecisionModel}
Returns the PrecisionModel
used by the Geometry
.
 Inherited From:
 Source:
Returns:
the specification of the grid of allowable points,
for this Geometry
and all other Geometry
s.

Type

PrecisionModel
intersection(other) → {Geometry}
Computes a Geometry
representing the points shared by this
Geometry
and other
. GeometryCollections
support intersection with homogeneous collection types, with the semantics
that the result is a GeometryCollection of the intersection of each
element of the target with the argument.
Parameters:
Name 
Type 
Description 
other 
Geometry

the Geometry with which to compute the
intersection. 
 Inherited From:
 Source:
Throws:
Returns:
the points common to the two Geometry
s.

Type

Geometry
intersects(g) → {boolean}
Tests whether this geometry intersects the specified geometry.
The intersects
predicate has the following equivalent
definitions:
 The two geometries have at least one point in common
 The DE9IM Intersection Matrix for the two geometries matches
[T********]
or [*T*******]
or
[***T*****]
or [****T****]
! g.disjoint(this)
(intersects
is the
inverse of disjoint
)
Parameters:
Name 
Type 
Description 
g 
Geometry

the Geometry with which to compare this
Geometry. 
 Inherited From:
 Source:
 See:

Returns:
true
if the two Geometry
s
intersect.

Type

boolean
isEmpty() → {boolean}
 Inherited From:
 Source:
Returns:

Type

boolean
isEquivalentClass(other) → {boolean}
Returns whether the two Geometry
s are equal, from the point
of view of the equalsExact
method. Called by
equalsExact
. In general, two Geometry
classes
are considered to be "equivalent" only if they are the same class. An
exception is LineString
, which is considered to be equivalent
to its subclasses.
Parameters:
Name 
Type 
Description 
other 
Geometry

the Geometry with which to compare this
Geometry for equality. 
 Inherited From:
 Source:
Returns:
true
if the classes of the two
Geometry
s are considered to be equal by the
equalsExact
method.

Type

boolean
isGeometryCollection() → {boolean}
 Inherited From:
 Source:
Returns:
true if this is a GeometryCollection.

Type

boolean
isGeometryCollectionBase() → {boolean}
 Inherited From:
 Source:
Returns:
true if this is a GeometryCollection but not subclass.

Type

boolean
isSimple() → {boolean}
Tests whether this Geometry is simple. In general, the SFS
specification of simplicity follows the rule:
 A Geometry is simple iff the only selfintersections are at boundary
points.
Simplicity is defined for each Geometry subclass as follows:
 Valid polygonal geometries are simple by definition, so
isSimple
trivially returns true.
 Linear geometries are simple iff they do not selfintersect at points
other than boundary points.
 Zerodimensional geometries (points) are simple iff they have no
repeated points.
 Empty
Geometry
s are always simple
 Inherited From:
 Source:
 See:

Returns:
true
if this Geometry
has any
points of selftangency, selfintersection or other anomalous points.

Type

boolean
isValid() → {boolean}
Tests the validity of this Geometry
. Subclasses provide their
own definition of "valid".
 Inherited From:
 Source:
 See:

Returns:
true
if this Geometry
is
valid.

Type

boolean
isWithinDistance(geom, distance) → {boolean}
Tests whether the distance from this Geometry
to another is
less than or equal to a specified value.
Parameters:
Name 
Type 
Description 
geom 
Geometry

the Geometry to check the distance to. 
distance 
number

the distance value to compare. 
 Inherited From:
 Source:
Returns:
true
if the geometries are less than
distance
apart.

Type

boolean
norm()
Creates a new Geometry which is a normalized copy of this Geometry.
 Inherited From:
 Source:
 See:

Returns:
a normalized copy of this geometry.
normalize()
Converts this Geometry
to normal form (or
canonical form ). Normal form is a unique representation for
Geometry
s. It can be used to test whether two
Geometry
s are equal in a way that is independent of the
ordering of the coordinates within them. Normal form equality is a stronger
condition than topological equality, but weaker than pointwise equality. The
definitions for normal form use the standard lexicographical ordering for
coordinates. "Sorted in order of coordinates" means the obvious extension of
this ordering to sequences of coordinates.
 Inherited From:
 Source:
overlaps(g) → {boolean}
Tests whether this geometry overlaps the specified geometry.
The overlaps
predicate has the following equivalent
definitions:
 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.
 The DE9IM Intersection Matrix for the two geometries matches
[T*T***T**]
(for two points or two surfaces) or
[1*T***T**]
(for two curves)
If the geometries are of different dimension this predicate returns
false
.
Parameters:
Name 
Type 
Description 
g 
Geometry

the Geometry with which to compare this
Geometry. 
 Inherited From:
 Source:
Returns:
true
if the two Geometry
s
overlap.

Type

boolean
relate(other, intersectionPattern) → {boolean}
Tests whether the elements in the DE9IM IntersectionMatrix for the
two
Geometry
s match the elements in
intersectionPattern
. The pattern is a 9character string,
with symbols drawn from the following set:
 0 (dimension 0)
 1 (dimension 1)
 2 (dimension 2)
 T ( matches 0, 1 or 2)
 F ( matches FALSE)
 * ( matches any value)
For more information on the DE9IM, see the
OpenGIS Simple Features
Specification.
Parameters:
Name 
Type 
Description 
other 
Geometry

the Geometry with which to compare this
Geometry. 
intersectionPattern 
string

the pattern against which to check the
intersection matrix for the two Geometry s. 
 Inherited From:
 Source:
 See:

Returns:
true
if the DE9IM intersection matrix for
the two Geometry
s match
intersectionPattern.

Type

boolean
relate2(g) → {IntersectionMatrix}
Returns the DE9IM IntersectionMatrix for the two
Geometry
s.
Parameters:
Name 
Type 
Description 
g 
Geometry

the Geometry with which to compare this
Geometry. 
 Inherited From:
 Source:
Returns:
an IntersectionMatrix describing the
intersections of the interiors, boundaries and exteriors of the two
Geometry
s.

Type

IntersectionMatrix
symDifference(other) → {Geometry}
Returns a set combining the points in this Geometry
not in
other
, and the points in other
not in this
Geometry
. This method returns the closure of the resultant
Geometry
.
Parameters:
Name 
Type 
Description 
other 
Geometry

the Geometry with which to compute the
symmetric difference. 
 Inherited From:
 Source:
Throws:
Returns:
the point set symmetric difference of this
Geometry
with other.

Type

Geometry
touches(g) → {boolean}
Tests whether this geometry touches the specified geometry.
The touches
predicate has the following equivalent
definitions:
 The geometries have at least one point in common, but their interiors do
not intersect.
 The DE9IM Intersection Matrix for the two geometries matches
[FT*******]
or [F**T*****]
or
[F***T****]
If both geometries have dimension 0, this predicate returns
false
Parameters:
Name 
Type 
Description 
g 
Geometry

the Geometry with which to compare this
Geometry. 
 Inherited From:
 Source:
Returns:
true
if the two Geometry
s
touch; Returns false
if both Geometry
s
are points.

Type

boolean
union(other) → {Geometry}
Computes a
Geometry
representing all the points in this
Geometry
and
other
.
Or without arguments:
Computes the union of all the elements of this geometry. Heterogeneous
GeometryCollections are fully supported.
The result obeys the following contract:
 Unioning a set of LineStrings has the effect of fully noding
and dissolving the linework.
 Unioning a set of Polygons will always return a
Polygonal geometry (unlike {link #union(Geometry)}, which may return
geometrys of lower dimension if a topology collapse occurred.
Parameters:
Name 
Type 
Description 
other 
Geometry

the Geometry with which to compute the union. 
 Inherited From:
 Source:
Throws:
Returns:
a set combining the points of this Geometry
and the points of other.

Type

Geometry
within(g) → {boolean}
Tests whether this geometry is within the specified geometry.
The within
predicate has the following equivalent definitions:
 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.
 The DE9IM Intersection Matrix for the two geometries matches
[T*F**F***]
g.contains(this)
(within
is the converse
of contains
)
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,
A.within(B) = false
Parameters:
Name 
Type 
Description 
g 
Geometry

the Geometry with which to compare this
Geometry. 
 Inherited From:
 Source:
 See:

Returns:
true
if this Geometry
is
within other.

Type

boolean