Package org.locationtech.jts.geom.prep
Class PreparedPoint
- java.lang.Object
-
- org.locationtech.jts.geom.prep.PreparedPoint
-
- All Implemented Interfaces:
PreparedGeometry
public class PreparedPoint extends java.lang.Object
A prepared version forPuntal
geometries.Instances of this class are thread-safe.
- Author:
- Martin Davis
-
-
Constructor Summary
Constructors Constructor Description PreparedPoint(Puntal point)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(Geometry g)
Default implementation.boolean
containsProperly(Geometry g)
Default implementation.boolean
coveredBy(Geometry g)
Default implementation.boolean
covers(Geometry g)
Default implementation.boolean
crosses(Geometry g)
Default implementation.boolean
disjoint(Geometry g)
Standard implementation for all geometries.Geometry
getGeometry()
Gets the originalGeometry
which has been prepared.java.util.List
getRepresentativePoints()
Gets the list of representative points for this geometry.boolean
intersects(Geometry g)
Tests whether this point intersects aGeometry
.boolean
isAnyTargetComponentInTest(Geometry testGeom)
Tests whether any representative of the target geometry intersects the test geometry.boolean
overlaps(Geometry g)
Default implementation.java.lang.String
toString()
boolean
touches(Geometry g)
Default implementation.boolean
within(Geometry g)
Default implementation.
-
-
-
Constructor Detail
-
PreparedPoint
public PreparedPoint(Puntal point)
-
-
Method Detail
-
intersects
public boolean intersects(Geometry g)
Tests whether this point intersects aGeometry
.The optimization here is that computing topology for the test geometry is avoided. This can be significant for large geometries.
- Specified by:
intersects
in interfacePreparedGeometry
- Parameters:
g
- the Geometry to test- Returns:
- true if this Geometry intersects the given Geometry
- See Also:
Geometry.intersects(Geometry)
-
getGeometry
public Geometry getGeometry()
Description copied from interface:PreparedGeometry
Gets the originalGeometry
which has been prepared.- Specified by:
getGeometry
in interfacePreparedGeometry
- Returns:
- the base geometry
-
getRepresentativePoints
public java.util.List getRepresentativePoints()
Gets the list of representative points for this geometry. One vertex is included for every component of the geometry (i.e. including one for every ring of polygonal geometries). Do not modify the returned list!- Returns:
- a List of Coordinate
-
isAnyTargetComponentInTest
public boolean isAnyTargetComponentInTest(Geometry testGeom)
Tests whether any representative of the target geometry intersects the test geometry. This is useful in A/A, A/L, A/P, L/P, and P/P cases.- Parameters:
testGeom
- the test geometry- Returns:
- true if any component intersects the areal test geometry
-
contains
public boolean contains(Geometry g)
Default implementation.- Specified by:
contains
in interfacePreparedGeometry
- Parameters:
g
- the Geometry to test- Returns:
- true if this Geometry contains the given Geometry
- See Also:
Geometry.contains(Geometry)
-
containsProperly
public boolean containsProperly(Geometry g)
Default implementation.- Specified by:
containsProperly
in interfacePreparedGeometry
- Parameters:
g
- the Geometry to test- Returns:
- true if this Geometry properly contains the given Geometry
- See Also:
Geometry.contains(org.locationtech.jts.geom.Geometry)
-
coveredBy
public boolean coveredBy(Geometry g)
Default implementation.- Specified by:
coveredBy
in interfacePreparedGeometry
- Parameters:
g
- the Geometry to test- Returns:
- true if this Geometry is covered by the given Geometry
- See Also:
Geometry.coveredBy(Geometry)
-
covers
public boolean covers(Geometry g)
Default implementation.- Specified by:
covers
in interfacePreparedGeometry
- Parameters:
g
- the Geometry to test- Returns:
- true if this Geometry covers the given Geometry
- See Also:
Geometry.covers(Geometry)
-
crosses
public boolean crosses(Geometry g)
Default implementation.- Specified by:
crosses
in interfacePreparedGeometry
- Parameters:
g
- the Geometry to test- Returns:
- true if this Geometry crosses the given Geometry
- See Also:
Geometry.crosses(Geometry)
-
disjoint
public boolean disjoint(Geometry g)
Standard implementation for all geometries. SupportsGeometryCollection
s as input.- Specified by:
disjoint
in interfacePreparedGeometry
- Parameters:
g
- the Geometry to test- Returns:
- true if this Geometry is disjoint from the given Geometry
- See Also:
Geometry.disjoint(Geometry)
-
overlaps
public boolean overlaps(Geometry g)
Default implementation.- Specified by:
overlaps
in interfacePreparedGeometry
- Parameters:
g
- the Geometry to test- Returns:
- true if this Geometry overlaps the given Geometry
- See Also:
Geometry.overlaps(Geometry)
-
touches
public boolean touches(Geometry g)
Default implementation.- Specified by:
touches
in interfacePreparedGeometry
- Parameters:
g
- the Geometry to test- Returns:
- true if this Geometry touches the given Geometry
- See Also:
Geometry.touches(Geometry)
-
within
public boolean within(Geometry g)
Default implementation.- Specified by:
within
in interfacePreparedGeometry
- Parameters:
g
- the Geometry to test- Returns:
- true if this Geometry is within the given Geometry
- See Also:
Geometry.within(Geometry)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-