class MultiPolygon extends GeometryCollection with Polygonal

Models a collection of {link Polygon}s.

As per the OGC SFS specification, the Polygons in a MultiPolygon may not overlap, and may only touch at single points. This allows the topological point-set semantics to be well-defined.

Annotations
@SerialVersionUID()
Version

1.7

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MultiPolygon
  2. Polygonal
  3. GeometryCollection
  4. Geometry
  5. Serializable
  6. Comparable
  7. Cloneable
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new MultiPolygon(polygons: Array[Polygon], factory: GeometryFactory)
  2. new MultiPolygon(polygons: Array[Polygon], precisionModel: PrecisionModel, SRID: Int)

    Constructs a MultiPolygon.

    Constructs a MultiPolygon.

    polygons

    the Polygons for this MultiPolygon , or null or an empty array to create the empty geometry. Elements may be empty Polygons, but not null s. The polygons must conform to the assertions specified in the <A HREF="http://www.opengis.org/techno/specs.htm">OpenGIS Simple Features Specification for SQL</A> .

    precisionModel

    the specification of the grid of allowable points for this MultiPolygon

    SRID

    the ID of the Spatial Reference System used by this MultiPolygon

    Deprecated

    Use GeometryFactory instead

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. var SRID: Int

    The ID of the Spatial Reference System used by this Geometry

    The ID of the Spatial Reference System used by this Geometry

    Attributes
    protected
    Definition Classes
    Geometry
  5. def applyF(filter: GeometryComponentFilter): Unit

    Performs an operation with or on this Geometry and its component Geometry's.

    Performs an operation with or on this Geometry and its component Geometry's. Only GeometryCollections and Polygons have component Geometry's; for Polygons they are the LinearRings of the shell and holes.

    filter

    the filter to apply to this Geometry.

    Definition Classes
    GeometryCollectionGeometry
  6. def applyF(filter: GeometryFilter): Unit

    Performs an operation with or on this Geometry and its subelement Geometrys (if any).

    Performs an operation with or on this Geometry and its subelement Geometrys (if any). Only GeometryCollections and subclasses have subelement Geometry's.

    filter

    the filter to apply to this Geometry (and its children, if it is a GeometryCollection).

    Definition Classes
    GeometryCollectionGeometry
  7. def applyF(filter: CoordinateSequenceFilter): Unit

    Performs an operation on the coordinates in this Geometry's {link CoordinateSequence}s.

    Performs an operation on the coordinates in this Geometry's {link CoordinateSequence}s. If the filter reports that a coordinate value has been changed, {link #geometryChanged} will be called automatically.

    filter

    the filter to apply

    Definition Classes
    GeometryCollectionGeometry
  8. 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

    Definition Classes
    GeometryCollectionGeometry
  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. 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 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 semi-circle
    • BufferOp.CAP_BUTT - a straight line perpendicular to the end segment
    • BufferOp.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

  11. 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 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 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)

  12. 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)

  13. def compare[A](a: Collection[A], b: Collection[A], comparator: Comparator[A]): Int

    Returns the first non-zero result of compareTo encountered as the two Collections are iterated over.

    Returns the first non-zero result of compareTo encountered as the two Collections 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. If b completes before a, a positive number is returned; if a before b, a negative number.

    a

    a Collection of Comparables

    b

    a Collection of Comparables return the first non-zero compareTo result, if any; otherwise, zero

    Definition Classes
    Geometry
  14. def compareTo(other: Geometry, comp: CoordinateSequenceComparator): Int

    Returns whether this Geometry is greater than, equal to, or less than another Geometry, using the given {link CoordinateSequenceComparator}.

    Returns whether this Geometry is greater than, equal to, or less than another Geometry, 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 CoordinateSequenceComparator return 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

    Definition Classes
    Geometry
  15. def compareTo(other: Geometry): Int

    Returns whether this Geometry is greater than, equal to, or less than another Geometry.

    Returns whether this Geometry is greater than, equal to, or less than another Geometry. <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
  16. def compareToSameClass(o: Geometry, comp: CoordinateSequenceComparator): Int

    Returns whether this Geometry is greater than, equal to, or less than another Geometry of the same class.

    Returns whether this Geometry is greater than, equal to, or less than another Geometry of the same class. using the given {link CoordinateSequenceComparator}.

    o

    a Geometry having the same class as this Geometry

    comp

    a CoordinateSequenceComparator return 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

    Definition Classes
    GeometryCollectionGeometry
  17. def compareToSameClass(o: Geometry): Int

    Returns whether this Geometry is greater than, equal to, or less than another Geometry having the same class.

    Returns whether this Geometry is greater than, equal to, or less than another Geometry having the same class.

    o

    a Geometry having the same class as this Geometry return 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

    Attributes
    protected
    Definition Classes
    GeometryCollectionGeometry
  18. def computeEnvelopeInternal: Envelope

    Returns the minimum and maximum x and y values in this Geometry , or a null Envelope if this Geometry is empty.

    Returns the minimum and maximum x and y values in this Geometry , or a null Envelope if this Geometry is empty. Unlike getEnvelopeInternal, this method calculates the Envelope each time it is called; getEnvelopeInternal caches the result of this method.

    return this Geometrys bounding box; if the Geometry is empty, Envelope#isNull will return true

    Attributes
    protected
    Definition Classes
    GeometryCollectionGeometry
  19. def contains(g: Geometry): Boolean

    Tests whether this geometry contains the argument geometry.

    Tests whether this geometry contains the argument 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 DE-9IM Intersection Matrix for the two geometries matches the pattern [T*****FF*]
    • g.within(this) = true
      (contains is 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 Geometry with which to compare this Geometry return true if this Geometry contains g

    Definition Classes
    Geometry
    See also

    Geometry#within

    Geometry#covers

  20. def convexHull: Geometry

    Computes the smallest convex Polygon that contains all the points in the 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: <TABLE> <TR> <TH> Number of Points in argument Geometry </TH> <TH> Geometry class of result </TH> </TR> <TR> <TD> 0 </TD> <TD> empty GeometryCollection </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
  21. 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
  22. def copyInternal: MultiPolygon

    An internal method to copy subclass-specific geometry data.

    An internal method to copy subclass-specific geometry data.

    return a copy of the target geometry object.

    Attributes
    protected
    Definition Classes
    MultiPolygonGeometryCollectionGeometry
  23. 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 coveredBy predicate 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
      (coveredBy is 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 true for more cases).

    g

    the Geometry with which to compare this Geometry return true if this Geometry is covered by g

    Definition Classes
    Geometry
    See also

    Geometry#within

    Geometry#covers

  24. def covers(g: Geometry): Boolean

    Tests whether this geometry covers the argument geometry.

    Tests whether this geometry covers the argument geometry.

    The covers predicate 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
      (covers is 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 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.

    g

    the Geometry with which to compare this Geometry return true if this Geometry covers g

    Definition Classes
    Geometry
    See also

    Geometry#contains

    Geometry#coveredBy

  25. def crosses(g: Geometry): Boolean

    Tests whether this geometry crosses the argument geometry.

    Tests whether this geometry crosses the argument geometry.

    The crosses predicate 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 Geometry with which to compare this Geometry return true if the two Geometrys cross.

    Definition Classes
    Geometry
  26. def difference(other: Geometry): Geometry

    Computes a Geometry representing the closure of the point-set of the points contained in this Geometry that are not contained in the other Geometry.

    Computes a Geometry representing the closure of the point-set of the points contained in this Geometry that are not contained in the other Geometry.

    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 Geometry with which to compute the difference return a Geometry representing the point-set difference of this Geometry with other throws TopologyException if a robustness error occurs throws IllegalArgumentException if either input is a non-empty GeometryCollection

    Definition Classes
    Geometry
  27. 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 disjoint predicate 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
      (disjoint is the inverse of intersects)
    g

    the Geometry with which to compare this Geometry return true if the two Geometrys are disjoint

    Definition Classes
    Geometry
    See also

    Geometry#intersects

  28. def distance(g: Geometry): Double

    Returns the minimum distance between this Geometry and another Geometry.

    Returns the minimum distance between this Geometry and another Geometry.

    g

    the Geometry from 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
  29. var envelope: Envelope

    The bounding box of this Geometry.

    The bounding box of this Geometry.

    Attributes
    protected
    Definition Classes
    Geometry
  30. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  31. def equal(a: Coordinate, b: Coordinate, tolerance: Double): Boolean
    Attributes
    protected
    Definition Classes
    Geometry
  32. 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 argument Object is not a Geometry, the result is false. 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()

  33. 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 Geometry with which to compare this Geometry return true if the two Geometrys are topologically equal

    Definition Classes
    Geometry
    See also

    #equalsTopo(Geometry)

  34. 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, the SRID, or the userData fields.

    To properly test equality between different geometries, it is usually necessary to {link #normalize()} them first.

    other

    the Geometry with which to compare this Geometry

    tolerance

    distance at or below which two Coordinates are considered equal return true if this and the other Geometry have identical structure and point values, up to the distance tolerance.

    Definition Classes
    MultiPolygonGeometryCollectionGeometry
    See also

    #equalsExact(Geometry)

    #normalize()

    #norm()

  35. 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, the SRID, or the userData fields.

    To properly test equality between different geometries, it is usually necessary to {link #normalize()} them first.

    other

    the Geometry with which to compare this Geometry return true if this and the other Geometry have identical structure and point values.

    Definition Classes
    Geometry
    See also

    #equalsExact(Geometry, double)

    #normalize()

    #norm()

  36. 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
  37. def equalsTopo(g: Geometry): Boolean

    Tests whether this geometry is topologically equal to the argument geometry as defined by the SFS equals predicate.

    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 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 Geometry with which to compare this Geometry return true if the two Geometrys are topologically equal

    Definition Classes
    Geometry
    See also

    #equalsExact(Geometry)

  38. val factory: GeometryFactory
    Definition Classes
    MultiPolygonGeometryCollectionGeometry
  39. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  40. var geometries: Array[Geometry]
    Definition Classes
    GeometryCollection
  41. 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
  42. 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)

  43. def getArea: Double

    Returns the area of this GeometryCollection

    Returns the area of this GeometryCollection

    return the area of the polygon

    Definition Classes
    GeometryCollectionGeometry
  44. def getBoundary: Geometry

    Computes the boundary of this geometry

    Computes the boundary of this geometry

    return a lineal geometry (which may be empty)

    Definition Classes
    MultiPolygonGeometryCollectionGeometry
    See also

    Geometry#getBoundary

  45. def getBoundaryDimension: Int

    Returns the dimension of this Geometrys inherent boundary.

    Returns the dimension of this Geometrys inherent boundary.

    return 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.

    Definition Classes
    MultiPolygonGeometryCollectionGeometry
  46. 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
  47. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  48. 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

    Definition Classes
    GeometryCollectionGeometry
  49. def getCoordinates: Array[Coordinate]

    Collects all coordinates of all subgeometries into an Array.

    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.

    return the collected coordinates

    Definition Classes
    GeometryCollectionGeometry
  50. 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.

    Definition Classes
    MultiPolygonGeometryCollectionGeometry
  51. 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 Geometry is:

    • empty, returns an empty Point.
    • a point, returns a Point.
    • a line parallel to an axis, a two-vertex LineString
    • otherwise, returns a Polygon whose 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)

  52. 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 empty Envelope is 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
  53. 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
  54. 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
    GeometryCollectionGeometry
  55. def getGeometryType: String

    Returns the name of this Geometry's actual class.

    Returns the name of this Geometry's actual class.

    return the name of this Geometrys actual class

    Definition Classes
    MultiPolygonGeometryCollectionGeometry
  56. 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
  57. 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.0

    return the length of the Geometry

    Definition Classes
    GeometryCollectionGeometry
  58. 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
    GeometryCollectionGeometry
  59. def getNumPoints: Int

    Returns the count of this Geometrys vertices.

    Returns the count of this Geometrys vertices. The Geometry s contained by composite Geometrys must be Geometry's; that is, they must implement getNumPoints

    return the number of vertices in this Geometry

    Definition Classes
    GeometryCollectionGeometry
  60. def getPrecisionModel: PrecisionModel

    Returns the PrecisionModel used by the Geometry.

    Returns the PrecisionModel used by the Geometry.

    return the specification of the grid of allowable points, for this Geometry and all other Geometrys

    Definition Classes
    Geometry
  61. 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 Geometry object. Geometry provides 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 Geometry is defined.

    Definition Classes
    Geometry
  62. def getSortIndex: Int
    Attributes
    protected
    Definition Classes
    MultiPolygonGeometryCollectionGeometry
  63. 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 null if none set

    Definition Classes
    Geometry
  64. 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
  65. def intersection(other: Geometry): Geometry

    Computes a Geometry representing the point-set which is common to both this Geometry and the other Geometry.

    Computes a Geometry representing the point-set which is common to both this Geometry and the other Geometry.

    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 Geometry with which to compute the intersection return a Geometry representing the point-set common to the two Geometrys throws TopologyException if a robustness error occurs throws IllegalArgumentException if the argument is a non-empty heterogeneous GeometryCollection

    Definition Classes
    Geometry
  66. def intersects(g: Geometry): Boolean

    Tests whether this geometry intersects the argument geometry.

    Tests whether this geometry intersects the argument geometry.

    The intersects predicate 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
      (intersects is the inverse of disjoint)
    g

    the Geometry with which to compare this Geometry return true if the two Geometrys intersect

    Definition Classes
    Geometry
    See also

    Geometry#disjoint

  67. def isEmpty: Boolean

    Tests whether the set of points covered by this Geometry is empty.

    Tests whether the set of points covered by this Geometry is empty.

    return true if this Geometry does not cover any points

    Definition Classes
    GeometryCollectionGeometry
  68. def isEquivalentClass(other: Geometry): Boolean

    Returns whether the two Geometrys are equal, from the point of view of the equalsExact method.

    Returns whether the two Geometrys 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.

    other

    the Geometry with which to compare this Geometry for equality return true if the classes of the two Geometry s are considered to be equal by the equalsExact method.

    Attributes
    protected
    Definition Classes
    Geometry
  69. 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
  70. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  71. 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
  72. 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. isSimple tests for this condition and reports false if 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 true if this Geometry is simple

    Definition Classes
    Geometry
    See also

    #isValid

  73. def isValid: Boolean

    Tests whether this Geometry is topologically valid, according to the OGC SFS specification.

    Tests whether this Geometry is topologically valid, according to the OGC SFS specification.

    For validity rules see the Javadoc for the specific Geometry subclass.

    return true if this Geometry is valid

    Definition Classes
    Geometry
    See also

    IsValidOp

  74. def isWithinDistance(geom: Geometry, distance: Double): Boolean

    Tests whether the distance from this Geometry to another is less than or equal to a specified value.

    Tests whether the distance from this Geometry to 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 true if the geometries are less than distance apart.

    Definition Classes
    Geometry
  75. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  76. 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()

  77. def normalize(): Unit

    Converts this Geometry to normal form (or canonical form ).

    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 Geometrys 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.

    Definition Classes
    GeometryCollectionGeometry
  78. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  79. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  80. def overlaps(g: Geometry): Boolean

    Tests whether this geometry overlaps the specified geometry.

    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 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 Geometry with which to compare this Geometry return true if the two Geometrys overlap.

    Definition Classes
    Geometry
  81. val polygons: Array[Polygon]
  82. 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 Geometry with which to compare this Geometry return an { @link IntersectionMatrix} describing the intersections of the interiors, boundaries and exteriors of the two Geometrys

    Definition Classes
    Geometry
  83. def relate(g: Geometry, intersectionPattern: String): Boolean

    Tests whether the elements in the DE-9IM {link IntersectionMatrix} for the two Geometrys match the elements in intersectionPattern.

    Tests whether the elements in the DE-9IM {link IntersectionMatrix} for the two Geometrys match the elements in intersectionPattern. 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 Geometry with which to compare this Geometry

    intersectionPattern

    the pattern against which to check the intersection matrix for the two Geometrys return true if the DE-9IM intersection matrix for the two Geometrys match intersectionPattern

    Definition Classes
    Geometry
    See also

    IntersectionMatrix

  84. def reverseInternal: Geometry
    Attributes
    protected
    Definition Classes
    GeometryCollectionGeometry
  85. 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

  86. 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
  87. def symDifference(other: Geometry): Geometry

    Computes a Geometry representing the closure of the point-set which is the union of the points in this Geometry which are not contained in the other Geometry, with the points in the other Geometry not contained in this Geometry.

    Computes a Geometry representing the closure of the point-set which is the union of the points in this Geometry which are not contained in the other Geometry, with the points in the other Geometry not contained in this Geometry. 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 Geometry with which to compute the symmetric difference return a Geometry representing the point-set symmetric difference of this Geometry with other throws TopologyException if a robustness error occurs throws IllegalArgumentException if either input is a non-empty GeometryCollection

    Definition Classes
    Geometry
  88. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  89. def toString(): String
    Definition Classes
    Geometry → AnyRef → Any
  90. def touches(g: Geometry): Boolean

    Tests whether this geometry touches the argument geometry.

    Tests whether this geometry touches the argument 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 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 Geometry with which to compare this Geometry return true if the two Geometrys touch; Returns false if both Geometrys are points

    Definition Classes
    Geometry
  91. 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

  92. def union(other: Geometry): Geometry

    Computes a Geometry representing the point-set which is contained in both this Geometry and the other Geometry.

    Computes a Geometry representing the point-set which is contained in both this Geometry and the other Geometry.

    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 Geometry with which to compute the union return a point-set combining the points of this Geometry and the points of other throws TopologyException if a robustness error occurs throws IllegalArgumentException if either input is a non-empty GeometryCollection

    Definition Classes
    Geometry
    See also

    LineMerger

  93. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  94. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  95. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  96. def within(g: Geometry): Boolean

    Tests whether this geometry is within the specified geometry.

    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 DE-9IM Intersection Matrix for the two geometries matches [T*F**F***]
    • g.contains(this) = true
      (within is 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 Geometry with which to compare this Geometry return true if this Geometry is within g

    Definition Classes
    Geometry
    See also

    Geometry#contains

    Geometry#coveredBy

Deprecated Value Members

  1. def clone(): AnyRef

    Creates and returns a full copy of this {link GeometryCollection} object.

    Creates and returns a full copy of this {link GeometryCollection} object. (including all coordinates contained by it).

    return a clone of this instance

    Definition Classes
    GeometryCollectionGeometry → AnyRef
    Deprecated
  2. def reverse: Geometry

    Creates a {link MultiPolygon} with every component reversed.

    Creates a {link MultiPolygon} with every component reversed. The order of the components in the collection are not reversed.

    return a MultiPolygon in the reverse order

    Definition Classes
    MultiPolygonGeometryCollectionGeometry
    Deprecated

Inherited from Polygonal

Inherited from GeometryCollection

Inherited from Geometry

Inherited from Serializable

Inherited from Comparable[Geometry]

Inherited from Cloneable

Inherited from AnyRef

Inherited from Any

Ungrouped