class Point extends Geometry with Puntal
Represents a single point.
A Point is topologically valid if and only if:
- the coordinate which defines it (if any) is a valid coordinate
(i.e. does not have an
NaNX or Y ordinate)
- Annotations
- @SerialVersionUID()
- Version
1.7
- Alphabetic
- By Inheritance
- Point
- Puntal
- Geometry
- Serializable
- Comparable
- Cloneable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Point(coordinates: CoordinateSequence, factory: GeometryFactory)
- coordinates
contains the single coordinate on which to base this
Point, ornullto create the empty geometry.
- new Point(factory: GeometryFactory)
- new Point(coordinate: Coordinate, precisionModel: PrecisionModel, SRID: Int)
Constructs a
Pointwith the given coordinate.Constructs a
Pointwith the given coordinate.- coordinate
the coordinate on which to base this
Point, ornullto create the empty geometry.- precisionModel
the specification of the grid of allowable points for this
Point- SRID
the ID of the Spatial Reference System used by this
Point
- Deprecated
Use GeometryFactory instead
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- var SRID: Int
The ID of the Spatial Reference System used by this
GeometryThe ID of the Spatial Reference System used by this
Geometry- Attributes
- protected
- Definition Classes
- Geometry
- def applyF(filter: GeometryComponentFilter): Unit
Performs an operation with or on this Geometry and its component Geometry's.
- def applyF(filter: GeometryFilter): Unit
Performs an operation with or on this
Geometryand its subelementGeometrys (if any). - def applyF(filter: CoordinateSequenceFilter): Unit
Performs an operation on the coordinates in this
Geometry's {link CoordinateSequence}s. - def applyF(filter: CoordinateFilter): Unit
Performs an operation with or on this
Geometry's coordinates.Performs an operation with or on this
Geometry's coordinates. If this method modifies any coordinate values, {link #geometryChanged} must be called to update the geometry state. Note that you cannot use this method to modify this Geometry if its underlying CoordinateSequence's #get method returns a copy of the Coordinate, rather than the actual Coordinate stored (if it even stores Coordinate objects at all).- filter
the filter to apply to this
Geometry's coordinates
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def buffer(distance: Double, quadrantSegments: Int, endCapStyle: Int): 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.
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.
Mathematically-exact buffer area boundaries can contain circular arcs. To represent these arcs using linear geometry they must be approximated with line segments. The
quadrantSegmentsargument allows controlling the accuracy of the approximation by specifying the number of line segments used to represent a quadrant of a circleThe 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 semi-circleBufferOp.CAP_BUTT- a straight line perpendicular to the end segmentBufferOp.CAP_SQUARE- a half-square
The buffer operation always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty {link Polygon}. This is also the result for the buffers of degenerate (zero-area) polygons.
- distance
the width of the buffer (may be positive, negative or 0)
- quadrantSegments
the number of line segments used to represent a quadrant of a circle
- endCapStyle
the end cap style to use return a polygonal geometry representing the buffer region (which may be empty) throws TopologyException if a robustness error occurs
- Definition Classes
- Geometry
- See also
#buffer(double)
#buffer(double, int)
BufferOp
- def buffer(distance: Double, quadrantSegments: Int): Geometry
Computes a buffer area around this geometry having the given width and with a specified accuracy of approximation for circular arcs.
Computes a buffer area around this geometry having the given width and with a specified accuracy of approximation for circular arcs.
Mathematically-exact buffer area boundaries can contain circular arcs. To represent these arcs using linear geometry they must be approximated with line segments. The
quadrantSegmentsargument allows controlling the accuracy of the approximation by specifying the number of line segments used to represent a quadrant of a circleThe buffer operation always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty {link Polygon}. This is also the result for the buffers of degenerate (zero-area) polygons.
- distance
the width of the buffer (may be positive, negative or 0)
- quadrantSegments
the number of line segments used to represent a quadrant of a circle return a polygonal geometry representing the buffer region (which may be empty) throws TopologyException if a robustness error occurs
- Definition Classes
- Geometry
- See also
#buffer(double)
#buffer(double, int, int)
- def buffer(distance: Double): Geometry
Computes a buffer area around this geometry having the given width.
Computes a buffer area around this geometry having the given width. The buffer of a Geometry is the Minkowski sum or difference of the geometry with a disc of radius
abs(distance).Mathematically-exact buffer area boundaries can contain circular arcs. To represent these arcs using linear geometry they must be approximated with line segments. The buffer geometry is constructed using 8 segments per quadrant to approximate the circular arcs. The end cap style is
CAP_ROUND.The buffer operation always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty {link Polygon}. This is also the result for the buffers of degenerate (zero-area) polygons.
- distance
the width of the buffer (may be positive, negative or 0) return a polygonal geometry representing the buffer region (which may be empty) throws TopologyException if a robustness error occurs
- Definition Classes
- Geometry
- See also
#buffer(double, int)
#buffer(double, int, int)
- def compare[A](a: Collection[A], b: Collection[A], comparator: Comparator[A]): Int
Returns the first non-zero result of
compareToencountered as the twoCollections are iterated over.Returns the first non-zero result of
compareToencountered as the twoCollections are iterated over. If, by the time one of the iterations is complete, no non-zero result has been encountered, returns 0 if the other iteration is also complete. Ifbcompletes beforea, a positive number is returned; if a before b, a negative number.- a
a
CollectionofComparables- b
a
CollectionofComparables return the first non-zerocompareToresult, if any; otherwise, zero
- Definition Classes
- Geometry
- def compareTo(other: Geometry, comp: CoordinateSequenceComparator): Int
Returns whether this
Geometryis greater than, equal to, or less than anotherGeometry, using the given {link CoordinateSequenceComparator}.Returns whether this
Geometryis greater than, equal to, or less than anotherGeometry, using the given {link CoordinateSequenceComparator}. <P>If their classes are different, they are compared using the following ordering: <UL> <LI> Point (lowest) <LI> MultiPoint <LI> LineString <LI> LinearRing <LI> MultiLineString <LI> Polygon <LI> MultiPolygon <LI> GeometryCollection (highest) </UL> If the two
Geometrys have the same class, their first elements are compared. If those are the same, the second elements are compared, etc.- comp
a
CoordinateSequenceComparatorreturn a positive number, 0, or a negative number, depending on whether this object is greater than, equal to, or less thano, as defined in "Normal Form For Geometry" in the JTS Technical Specifications
- Definition Classes
- Geometry
- def compareTo(other: Geometry): Int
Returns whether this
Geometryis greater than, equal to, or less than anotherGeometry.Returns whether this
Geometryis greater than, equal to, or less than anotherGeometry. <P>If their classes are different, they are compared using the following ordering: <UL> <LI> Point (lowest) <LI> MultiPoint <LI> LineString <LI> LinearRing <LI> MultiLineString <LI> Polygon <LI> MultiPolygon <LI> GeometryCollection (highest) </UL> If the two
Geometrys have the same class, their first elements are compared. If those are the same, the second elements are compared, etc.- Definition Classes
- Geometry → Comparable
- def compareToSameClass(other: Geometry, comp: CoordinateSequenceComparator): Int
Returns whether this
Geometryis greater than, equal to, or less than anotherGeometryof the same class.Returns whether this
Geometryis greater than, equal to, or less than anotherGeometryof the same class. using the given {link CoordinateSequenceComparator}.- comp
a
CoordinateSequenceComparatorreturn a positive number, 0, or a negative number, depending on whether this object is greater than, equal to, or less thano, as defined in "Normal Form For Geometry" in the JTS Technical Specifications
- def compareToSameClass(other: Geometry): Int
Returns whether this
Geometryis greater than, equal to, or less than anotherGeometryhaving the same class. - def computeEnvelopeInternal: Envelope
Returns the minimum and maximum x and y values in this
Geometry, or a nullEnvelopeif thisGeometryis empty.Returns the minimum and maximum x and y values in this
Geometry, or a nullEnvelopeif thisGeometryis empty. UnlikegetEnvelopeInternal, this method calculates theEnvelopeeach time it is called;getEnvelopeInternalcaches the result of this method.return this
Geometrys bounding box; if theGeometryis empty,Envelope#isNullwill returntrue - def contains(g: Geometry): Boolean
Tests whether this geometry contains the argument geometry.
Tests whether this geometry contains the argument geometry.
The
containspredicate 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 DE-9IM Intersection Matrix for the two geometries matches
the pattern
[T*****FF*] g.within(this) = true
(containsis the converse of {link #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. (As a concrete example, take A to be a LineString which lies in the boundary of a Polygon B.) For a predicate with similar behaviour but avoiding this subtle limitation, see {link #covers}.- g
the
Geometrywith which to compare thisGeometryreturntrueif thisGeometrycontainsg
- Definition Classes
- Geometry
- See also
Geometry#within
Geometry#covers
- def convexHull: Geometry
Computes the smallest convex
Polygonthat contains all the points in theGeometry.Computes the smallest convex
Polygonthat contains all the points in theGeometry. This obviously applies only toGeometrys which contain 3 or more points; the results for degenerate cases are specified as follows: <TABLE> <TR> <TH> Number ofPoints in argumentGeometry</TH> <TH>Geometryclass of result </TH> </TR> <TR> <TD> 0 </TD> <TD> emptyGeometryCollection</TD> </TR> <TR> <TD> 1 </TD> <TD>Point</TD> </TR> <TR> <TD> 2 </TD> <TD>LineString</TD> </TR> <TR> <TD> 3 or more </TD> <TD>Polygon</TD> </TR> </TABLE>return the minimum-area convex polygon containing this
Geometry' s points- Definition Classes
- Geometry
- def copy: Geometry
Creates a deep copy of this {link Geometry} object.
Creates a deep copy of this {link Geometry} object. Coordinate sequences contained in it are copied. All instance fields are copied (i.e.
envelope, SRID and userData).NOTE: the userData object reference (if present) is copied, but the value itself is not copied. If a deep copy is required this must be performed by the caller.
return a deep copy of this geometry
- Definition Classes
- Geometry
- def copyInternal: Point
An internal method to copy subclass-specific geometry data.
- def coveredBy(g: Geometry): Boolean
Tests whether this geometry is covered by the argument geometry.
Tests whether this geometry is covered by the argument geometry.
The
coveredBypredicate has the following equivalent definitions:- Every point of this geometry is a point of the other geometry.
- The DE-9IM Intersection Matrix for the two geometries matches at least one of the following patterns:
[T*F**F***][*TF**F***][**FT*F***][**F*TF***]g.covers(this) = true
(coveredByis the converse of {link #covers})
If either geometry is empty, the value of this predicate is
false.This predicate is similar to {link #within}, but is more inclusive (i.e. returns
truefor more cases).- g
the
Geometrywith which to compare thisGeometryreturntrueif thisGeometryis covered byg
- Definition Classes
- Geometry
- See also
Geometry#within
Geometry#covers
- def covers(g: Geometry): Boolean
Tests whether this geometry covers the argument geometry.
Tests whether this geometry covers the argument geometry.
The
coverspredicate has the following equivalent definitions:- Every point of the other geometry is a point of this geometry.
- The DE-9IM Intersection Matrix for the two geometries matches at least one of the following patterns:
[T*****FF*][*T****FF*][***T**FF*][****T*FF*]g.coveredBy(this) = true
(coversis the converse of {link #coveredBy})
If either geometry is empty, the value of this predicate is
false.This predicate is similar to {link #contains}, but is more inclusive (i.e. returns
truefor more cases). In particular, unlikecontainsit does not distinguish between points in the boundary and in the interior of geometries. For most situations,coversshould be used in preference tocontains. As an added benefit,coversis more amenable to optimization, and hence should be more performant.- g
the
Geometrywith which to compare thisGeometryreturntrueif thisGeometrycoversg
- Definition Classes
- Geometry
- See also
Geometry#contains
Geometry#coveredBy
- def crosses(g: Geometry): Boolean
Tests whether this geometry crosses the argument geometry.
Tests whether this geometry crosses the argument geometry.
The
crossespredicate has the following equivalent definitions:- The geometries have some but not all interior points in common.
- The DE-9IM Intersection Matrix for the two geometries matches one of the following patterns:
[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. In order to make the relation symmetric, JTS extends the definition to apply to L/P, A/P and A/L situations as well.
- g
the
Geometrywith which to compare thisGeometryreturntrueif the twoGeometrys cross.
- Definition Classes
- Geometry
- def difference(other: Geometry): Geometry
Computes a
Geometryrepresenting the closure of the point-set of the points contained in thisGeometrythat are not contained in theotherGeometry.Computes a
Geometryrepresenting the closure of the point-set of the points contained in thisGeometrythat are not contained in theotherGeometry.If the result is empty, it is an atomic geometry with the dimension of the left-hand input.
Non-empty {link GeometryCollection} arguments are not supported.
- other
the
Geometrywith which to compute the difference return a Geometry representing the point-set difference of thisGeometrywithotherthrows TopologyException if a robustness error occurs throws IllegalArgumentException if either input is a non-empty GeometryCollection
- Definition Classes
- Geometry
- def disjoint(g: Geometry): Boolean
Tests whether this geometry is disjoint from the argument geometry.
Tests whether this geometry is disjoint from the argument geometry.
The
disjointpredicate has the following equivalent definitions:- The two geometries have no point in common
- The DE-9IM Intersection Matrix for the two geometries matches
[FF*FF****] ! g.intersects(this) = true
(disjointis the inverse ofintersects)
- g
the
Geometrywith which to compare thisGeometryreturntrueif the twoGeometrys are disjoint
- Definition Classes
- Geometry
- See also
Geometry#intersects
- def distance(g: Geometry): Double
Returns the minimum distance between this
Geometryand anotherGeometry.Returns the minimum distance between this
Geometryand anotherGeometry.- g
the
Geometryfrom which to compute the distance return the distance between the geometries return 0 if either input geometry is empty throws IllegalArgumentException if g is null
- Definition Classes
- Geometry
- var envelope: Envelope
The bounding box of this
Geometry.The bounding box of this
Geometry.- Attributes
- protected
- Definition Classes
- Geometry
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equal(a: Coordinate, b: Coordinate, tolerance: Double): Boolean
- Attributes
- protected
- Definition Classes
- Geometry
- def equals(o: Any): Boolean
Tests whether this geometry is structurally and numerically equal to a given
Object.Tests whether this geometry is structurally and numerically equal to a given
Object. If the argumentObjectis not aGeometry, the result isfalse. Otherwise, the result is computed using {link #equalsExact(Geometry)}.This method is provided to fulfill the Java contract for value-based object equality. In conjunction with {link #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 {link Geometry#norm()} or {link #normalize()} as appropriate).
- o
the Object to compare return true if this geometry is exactly equal to the argument
- Definition Classes
- Geometry → AnyRef → Any
- See also
#equalsExact(Geometry)
#hashCode()
#norm()
#normalize()
- def equals(g: Geometry): Boolean
Tests whether this geometry is topologically equal to the argument geometry.
Tests whether this geometry is topologically equal to the argument geometry.
This method is included for backward compatibility reasons. It has been superseded by the {link #equalsTopo(Geometry)} method, which has been named to clearly denote its functionality.
This method should NOT be confused with the method {link #equals(Object)}, which implements an exact equality comparison.
- g
the
Geometrywith which to compare thisGeometryreturn true if the twoGeometrys are topologically equal
- Definition Classes
- Geometry
- See also
#equalsTopo(Geometry)
- def equalsExact(other: Geometry, tolerance: Double): Boolean
Returns true if the two
Geometrys are exactly equal, up to a specified distance tolerance.Returns true if the two
Geometrys are exactly equal, up to a specified distance tolerance. Two Geometries are exactly equal within a distance tolerance if and only if:- they have the same structure
- they have the same values for their vertices, within the given tolerance distance, in exactly the same order.
This method does not test the values of the
GeometryFactory, theSRID, or theuserDatafields.To properly test equality between different geometries, it is usually necessary to {link #normalize()} them first.
- other
the
Geometrywith which to compare thisGeometry- tolerance
distance at or below which two
Coordinates are considered equal returntrueif this and the otherGeometryhave identical structure and point values, up to the distance tolerance.
- def equalsExact(other: Geometry): Boolean
Returns true if the two
Geometrys are exactly equal.Returns true if the two
Geometrys are exactly equal. Two Geometries are exactly equal iff:- they have the same structure
- they have the same values for their vertices, in exactly the same order.
This provides a stricter test of equality than {link #equalsTopo(Geometry)}, which is more useful in certain situations (such as using geometries as keys in collections).
This method does not test the values of the
GeometryFactory, theSRID, or theuserDatafields.To properly test equality between different geometries, it is usually necessary to {link #normalize()} them first.
- other
the
Geometrywith which to compare thisGeometryreturntrueif this and the otherGeometryhave identical structure and point values.
- Definition Classes
- Geometry
- See also
#equalsExact(Geometry, double)
#normalize()
#norm()
- def equalsNorm(g: Geometry): Boolean
Tests whether two geometries are exactly equal in their normalized forms.
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 {link #equalsExact(Geometry)}.
This method is relatively expensive to compute. For maximum performance, the client should instead perform normalization on the individual geometries at an appropriate point during processing.
- g
a Geometry return true if the input geometries are exactly equal in their normalized form
- Definition Classes
- Geometry
- def equalsTopo(g: Geometry): Boolean
Tests whether this geometry is topologically equal to the argument geometry as defined by the SFS
equalspredicate.Tests whether this geometry is topologically equal to the argument geometry as defined by the SFS
equalspredicate.The SFS
equalspredicate 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 DE-9IM 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 {link #equalsExact(Geometry)}.
- g
the
Geometrywith which to compare thisGeometryreturntrueif the twoGeometrys are topologically equal
- Definition Classes
- Geometry
- See also
#equalsExact(Geometry)
- val factory: GeometryFactory
- Definition Classes
- Geometry
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def geometryChanged(): Unit
Notifies this geometry that its coordinates have been changed by an external party (for example, via a {link CoordinateFilter}).
Notifies this geometry that its coordinates have been changed by an external party (for example, via a {link CoordinateFilter}). When this method is called the geometry will flush and/or update any derived information it has cached (such as its {link Envelope} ). The operation is applied to all component Geometries.
- Definition Classes
- Geometry
- def geometryChangedAction(): Unit
Notifies this Geometry that its Coordinates have been changed by an external party.
Notifies this Geometry that its Coordinates have been changed by an external party. When #geometryChanged is called, this method will be called for this Geometry and its component Geometries.
- Attributes
- protected
- Definition Classes
- Geometry
- See also
#apply(GeometryComponentFilter)
- def getArea: Double
Returns the area of this
Geometry.Returns the area of this
Geometry. Areal Geometries have a non-zero area. They override this function to compute the area. Others return 0.0return the area of the Geometry
- Definition Classes
- Geometry
- def getBoundary: GeometryCollection
Gets the boundary of this geometry.
- def getBoundaryDimension: Int
Returns the dimension of this
Geometrys inherent boundary. - def getCentroid: Point
Computes the centroid of this
Geometry.Computes the centroid of this
Geometry. 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).The centroid of an empty geometry is
POINT EMPTY.return a { @link Point} which is the centroid of this Geometry
- Definition Classes
- Geometry
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getCoordinate: Coordinate
Returns a vertex of this
Geometry(usually, but not necessarily, the first one).Returns a vertex of this
Geometry(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 a { @link Coordinate} which is a vertex of this
Geometry. return null if this Geometry is empty - def getCoordinateSequence: CoordinateSequence
- def getCoordinates: Array[Coordinate]
Returns an array containing the values of all the vertices for this geometry.
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.
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 the vertices of this
Geometry - def getDimension: Int
Returns the dimension of this geometry.
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}.
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 the topological dimension of this geometry.
- def getEnvelope: Geometry
Gets a Geometry representing the envelope (bounding box) of this
Geometry.Gets a Geometry representing the envelope (bounding box) of this
Geometry.If this
Geometryis:- empty, returns an empty
Point. - a point, returns a
Point. - a line parallel to an axis, a two-vertex
LineString - otherwise, returns a
Polygonwhose vertices are (minx miny, maxx miny, maxx maxy, minx maxy, minx miny).
return a Geometry representing the envelope of this Geometry
- Definition Classes
- Geometry
- See also
GeometryFactory#toGeometry(Envelope)
- empty, returns an empty
- def getEnvelopeInternal: Envelope
Gets an {link Envelope} containing the minimum and maximum x and y values in this
Geometry.Gets an {link Envelope} containing the minimum and maximum x and y values in this
Geometry. If the geometry is empty, an emptyEnvelopeis returned.The returned object is a copy of the one maintained internally, to avoid aliasing issues. For best performance, clients which access this envelope frequently should cache the return value.
return the envelope of this
Geometry. return an empty Envelope if this Geometry is empty- Definition Classes
- Geometry
- def getFactory: GeometryFactory
Gets the factory which contains the context in which this geometry was created.
Gets the factory which contains the context in which this geometry was created.
return the factory for this geometry
- Definition Classes
- Geometry
- def getGeometryN(n: Int): Geometry
Returns an element {link Geometry} from a {link GeometryCollection} (or
this, if the geometry is not a collection).Returns an element {link Geometry} from a {link GeometryCollection} (or
this, if the geometry is not a collection).- n
the index of the geometry element return the n'th geometry contained in this geometry
- Definition Classes
- Geometry
- def getGeometryType: String
Returns the name of this Geometry's actual class.
- def getInteriorPoint: Point
Computes an interior point of this
Geometry.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.The interior point of an empty geometry is
POINT EMPTY.return a { @link Point} which is in the interior of this Geometry
- Definition Classes
- Geometry
- def getLength: Double
Returns the length of this
Geometry.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.0return the length of the Geometry
- Definition Classes
- Geometry
- def getNumGeometries: Int
Returns the number of {link Geometry}s in a {link GeometryCollection} (or 1, if the geometry is not a collection).
Returns the number of {link Geometry}s in a {link GeometryCollection} (or 1, if the geometry is not a collection).
return the number of geometries contained in this geometry
- Definition Classes
- Geometry
- def getNumPoints: Int
Returns the count of this
Geometrys vertices. - def getPrecisionModel: PrecisionModel
Returns the
PrecisionModelused by theGeometry.Returns the
PrecisionModelused by theGeometry.return the specification of the grid of allowable points, for this
Geometryand all otherGeometrys- Definition Classes
- Geometry
- def getSRID: Int
Returns the ID of the Spatial Reference System used by the
Geometry.Returns the ID of the Spatial Reference System used by the
Geometry. <P>JTS supports Spatial Reference System information in the simple way defined in the SFS. A Spatial Reference System ID (SRID) is present in each
Geometryobject.Geometryprovides basic accessor operations for this field, but no others. The SRID is represented as an integer.return the ID of the coordinate space in which the
Geometryis defined.- Definition Classes
- Geometry
- def getSortIndex: Int
- def getUserData: AnyRef
Gets the user data object for this geometry, if any.
Gets the user data object for this geometry, if any.
return the user data object, or
nullif none set- Definition Classes
- Geometry
- def getX: Double
- def getY: Double
- def hashCode(): Int
Gets a hash code for the Geometry.
Gets a hash code for the Geometry.
return an integer value suitable for use as a hashcode
- Definition Classes
- Geometry → AnyRef → Any
- def intersection(other: Geometry): Geometry
Computes a
Geometryrepresenting the point-set which is common to both thisGeometryand theotherGeometry.Computes a
Geometryrepresenting the point-set which is common to both thisGeometryand theotherGeometry.The intersection of two geometries of different dimension produces a result geometry of dimension less than or equal to the minimum dimension of the input geometries. The result geometry may be a heterogeneous {link GeometryCollection}. If the result is empty, it is an atomic geometry with the dimension of the lowest input dimension.
Intersection of {link GeometryCollection}s is supported only for homogeneous collection types.
Non-empty heterogeneous {link GeometryCollection} arguments are not supported.
- other
the
Geometrywith which to compute the intersection return a Geometry representing the point-set common to the twoGeometrys throws TopologyException if a robustness error occurs throws IllegalArgumentException if the argument is a non-empty heterogeneousGeometryCollection
- Definition Classes
- Geometry
- def intersects(g: Geometry): Boolean
Tests whether this geometry intersects the argument geometry.
Tests whether this geometry intersects the argument geometry.
The
intersectspredicate has the following equivalent definitions:- The two geometries have at least one point in common
- The DE-9IM Intersection Matrix for the two geometries matches at least one of the patterns
[T********][*T*******][***T*****][****T****]! g.disjoint(this) = true
(intersectsis the inverse ofdisjoint)
- g
the
Geometrywith which to compare thisGeometryreturntrueif the twoGeometrys intersect
- Definition Classes
- Geometry
- See also
Geometry#disjoint
- def isEmpty: Boolean
Tests whether the set of points covered by this
Geometryis empty. - def isEquivalentClass(other: Geometry): Boolean
Returns whether the two
Geometrys are equal, from the point of view of theequalsExactmethod.Returns whether the two
Geometrys are equal, from the point of view of theequalsExactmethod. Called byequalsExact. In general, twoGeometryclasses are considered to be "equivalent" only if they are the same class. An exception isLineString, which is considered to be equivalent to its subclasses.- other
the
Geometrywith which to compare thisGeometryfor equality returntrueif the classes of the twoGeometrys are considered to be equal by theequalsExactmethod.
- Attributes
- protected
- Definition Classes
- Geometry
- def isGeometryCollection: Boolean
Tests whether this is an instance of a general {link GeometryCollection}, rather than a homogeneous subclass.
Tests whether this is an instance of a general {link GeometryCollection}, rather than a homogeneous subclass.
return true if this is a heterogeneous GeometryCollection
- Attributes
- protected
- Definition Classes
- Geometry
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isRectangle: Boolean
Tests whether this is a rectangular {link Polygon}.
Tests whether this is a rectangular {link Polygon}.
return true if the geometry is a rectangle.
- Definition Classes
- Geometry
- def isSimple: Boolean
Tests whether this {link Geometry} is simple.
Tests whether this {link Geometry} is simple. The SFS definition of simplicity follows the general rule that a Geometry is simple if it has no points of self-tangency, self-intersection or other anomalous points.
Simplicity is defined for each {link Geometry} subclass as follows:
- Valid polygonal geometries are simple, since their rings
must not self-intersect.
isSimpletests for this condition and reportsfalseif it is not met. (This is a looser test than checking for validity). - Linear rings have the same semantics.
- Linear geometries are simple iff they do not self-intersect at points other than boundary points.
- Zero-dimensional geometries (points) are simple iff they have no repeated points.
- Empty
Geometrys are always simple.
return
trueif thisGeometryis simple - Valid polygonal geometries are simple, since their rings
must not self-intersect.
- def isValid: Boolean
Tests whether this
Geometryis topologically valid, according to the OGC SFS specification.Tests whether this
Geometryis topologically valid, according to the OGC SFS specification.For validity rules see the Javadoc for the specific Geometry subclass.
return
trueif thisGeometryis valid- Definition Classes
- Geometry
- See also
IsValidOp
- def isWithinDistance(geom: Geometry, distance: Double): Boolean
Tests whether the distance from this
Geometryto another is less than or equal to a specified value.Tests whether the distance from this
Geometryto another is less than or equal to a specified value.- geom
the Geometry to check the distance to
- distance
the distance value to compare return
trueif the geometries are less thandistanceapart.
- Definition Classes
- Geometry
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def norm: Geometry
Creates a new Geometry which is a normalized copy of this Geometry.
Creates a new Geometry which is a normalized copy of this Geometry.
return a normalized copy of this geometry.
- Definition Classes
- Geometry
- See also
#normalize()
- def normalize(): Unit
Converts this
Geometryto normal form (or canonical form ).Converts this
Geometryto normal form (or canonical form ). Normal form is a unique representation forGeometrys. It can be used to test whether twoGeometrys 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.NOTE that this method mutates the value of this geometry in-place. If this is not safe and/or wanted, the geometry should be cloned prior to normalization.
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def overlaps(g: Geometry): Boolean
Tests whether this geometry overlaps the specified geometry.
Tests whether this geometry overlaps the specified geometry.
The
overlapspredicate 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 DE-9IM 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. This predicate is symmetric.- g
the
Geometrywith which to compare thisGeometryreturntrueif the twoGeometrys overlap.
- Definition Classes
- Geometry
- def relate(g: Geometry): IntersectionMatrix
Returns the DE-9IM {link IntersectionMatrix} for the two
Geometrys.Returns the DE-9IM {link IntersectionMatrix} for the two
Geometrys.- g
the
Geometrywith which to compare thisGeometryreturn an { @link IntersectionMatrix} describing the intersections of the interiors, boundaries and exteriors of the twoGeometrys
- Definition Classes
- Geometry
- def relate(g: Geometry, intersectionPattern: String): Boolean
Tests whether the elements in the DE-9IM {link IntersectionMatrix} for the two
Geometrys match the elements inintersectionPattern.Tests whether the elements in the DE-9IM {link IntersectionMatrix} for the two
Geometrys match the elements inintersectionPattern. The pattern is a 9-character string, with symbols drawn from the following set: <UL> <LI> 0 (dimension 0) <LI> 1 (dimension 1) <LI> 2 (dimension 2) <LI> T ( matches 0, 1 or 2) <LI> F ( matches FALSE) <LI> * ( matches any value) </UL> For more information on the DE-9IM, see the OpenGIS Simple Features Specification.- g
the
Geometrywith which to compare thisGeometry- intersectionPattern
the pattern against which to check the intersection matrix for the two
Geometrys returntrueif the DE-9IM intersection matrix for the twoGeometrys matchintersectionPattern
- Definition Classes
- Geometry
- See also
IntersectionMatrix
- def reverseInternal: Point
- def setSRID(SRID: Int): Unit
Sets the ID of the Spatial Reference System used by the
Geometry.Sets the ID of the Spatial Reference System used by the
Geometry.NOTE: This method should only be used for exceptional circumstances or for backwards compatibility. Normally the SRID should be set on the {link GeometryFactory} used to create the geometry. SRIDs set using this method will not be propagated to geometries returned by constructive methods.
- Definition Classes
- Geometry
- See also
GeometryFactory
- def setUserData(userData: AnyRef): Unit
A simple scheme for applications to add their own custom data to a Geometry.
A simple scheme for applications to add their own custom data to a Geometry. An example use might be to add an object representing a Coordinate Reference System.
Note that user data objects are not present in geometries created by construction methods.
- userData
an object, the semantics for which are defined by the application using this Geometry
- Definition Classes
- Geometry
- def symDifference(other: Geometry): Geometry
Computes a
Geometryrepresenting the closure of the point-set which is the union of the points in thisGeometrywhich are not contained in theotherGeometry, with the points in theotherGeometry not contained in thisGeometry.Computes a
Geometryrepresenting the closure of the point-set which is the union of the points in thisGeometrywhich are not contained in theotherGeometry, with the points in theotherGeometry not contained in thisGeometry. If the result is empty, it is an atomic geometry with the dimension of the highest input dimension.Non-empty {link GeometryCollection} arguments are not supported.
- other
the
Geometrywith which to compute the symmetric difference return a Geometry representing the point-set symmetric difference of thisGeometrywithotherthrows TopologyException if a robustness error occurs throws IllegalArgumentException if either input is a non-empty GeometryCollection
- Definition Classes
- Geometry
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- Geometry → AnyRef → Any
- def touches(g: Geometry): Boolean
Tests whether this geometry touches the argument geometry.
Tests whether this geometry touches the argument geometry.
The
touchespredicate has the following equivalent definitions:- The geometries have at least one point in common, but their interiors do not intersect.
- The DE-9IM Intersection Matrix for the two geometries matches at least one of the following patterns
[FT*******][F**T*****][F***T****]
If both geometries have dimension 0, the predicate returns
false, since points have only interiors. This predicate is symmetric.- g
the
Geometrywith which to compare thisGeometryreturntrueif the twoGeometrys touch; Returnsfalseif bothGeometrys are points
- Definition Classes
- Geometry
- def union: Geometry
Computes the union of all the elements of this geometry.
Computes the union of all the elements of this geometry.
This method supports {link GeometryCollection}s (which the other overlay operations currently do not).
The result obeys the following contract:
- Unioning a set of {link LineString}s has the effect of fully noding and dissolving the linework.
- Unioning a set of {link Polygon}s always returns a {link Polygonal} geometry (unlike {link #union(Geometry)}, which may return geometries of lower dimension if a topology collapse occurred).
return the union geometry throws TopologyException if a robustness error occurs
- Definition Classes
- Geometry
- See also
UnaryUnionOp
- def union(other: Geometry): Geometry
Computes a
Geometryrepresenting the point-set which is contained in both thisGeometryand theotherGeometry.Computes a
Geometryrepresenting the point-set which is contained in both thisGeometryand theotherGeometry.The union of two geometries of different dimension produces a result geometry of dimension equal to the maximum dimension of the input geometries. The result geometry may be a heterogeneous {link GeometryCollection}. If the result is empty, it is an atomic geometry with the dimension of the highest input dimension.
Unioning {link LineString}s has the effect of noding and dissolving the input linework. In this context "noding" means that there will be a node or endpoint in the result for every endpoint or line segment crossing in the input. "Dissolving" means that any duplicate (i.e. coincident) line segments or portions of line segments will be reduced to a single line segment in the result. If merged linework is required, the {link LineMerger} class can be used.
Non-empty {link GeometryCollection} arguments are not supported.
- other
the
Geometrywith which to compute the union return a point-set combining the points of thisGeometryand the points ofotherthrows TopologyException if a robustness error occurs throws IllegalArgumentException if either input is a non-empty GeometryCollection
- Definition Classes
- Geometry
- See also
LineMerger
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def within(g: Geometry): Boolean
Tests whether this geometry is within the specified geometry.
Tests whether this geometry is within the specified geometry.
The
withinpredicate 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 DE-9IM Intersection Matrix for the two geometries matches
[T*F**F***] g.contains(this) = true
(withinis the converse of {link #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 geometry B,
A.within(B) = false(As a concrete example, take A to be a LineString which lies in the boundary of a Polygon B.) For a predicate with similar behaviour but avoiding this subtle limitation, see {link #coveredBy}.- g
the
Geometrywith which to compare thisGeometryreturntrueif thisGeometryis withing
- Definition Classes
- Geometry
- See also
Geometry#contains
Geometry#coveredBy