public class JtsSpatialContext extends SpatialContext
SpatialContext
with support for Polygons (and
other geometries) using JTS.
To the extent possible, our JtsGeometry
adds some amount of geodetic support over
vanilla JTS which only has a Euclidean (flat plane) model.Modifier and Type | Field and Description |
---|---|
static JtsSpatialContext |
GEO |
Constructor and Description |
---|
JtsSpatialContext(JtsSpatialContextFactory factory)
Called by
JtsSpatialContextFactory.newSpatialContext() . |
Modifier and Type | Method and Description |
---|---|
DatelineRule |
getDatelineRule()
Deprecated.
|
GeometryFactory |
getGeometryFactory()
Deprecated.
|
Geometry |
getGeometryFrom(Shape shape)
Deprecated.
|
JtsShapeFactory |
getShapeFactory()
A factory for
Shape s. |
ValidationRule |
getValidationRule()
Deprecated.
|
boolean |
isAllowMultiOverlap()
Deprecated.
|
boolean |
isAutoIndex()
Deprecated.
|
Rectangle |
makeRectFromRectangularPoly(Geometry geom)
Deprecated.
|
JtsGeometry |
makeShape(Geometry geom)
Deprecated.
|
JtsGeometry |
makeShape(Geometry geom,
boolean dateline180Check,
boolean allowMultiOverlap)
Deprecated.
|
Shape |
makeShapeFromGeometry(Geometry geom)
Deprecated.
|
String |
toString() |
boolean |
useJtsLineString()
Deprecated.
|
boolean |
useJtsPoint()
Deprecated.
|
calcDistance, calcDistance, getBinaryCodec, getDistCalc, getFormats, getWktShapeParser, getWorldBounds, isGeo, isNormWrapLongitude, makeBufferedLineString, makeCircle, makeCircle, makeCollection, makeLineString, makePoint, makeRectangle, makeRectangle, normX, normY, readShape, readShapeFromWkt, toString, verifyX, verifyY
public static final JtsSpatialContext GEO
public JtsSpatialContext(JtsSpatialContextFactory factory)
JtsSpatialContextFactory.newSpatialContext()
.public JtsShapeFactory getShapeFactory()
SpatialContext
Shape
s.getShapeFactory
in class SpatialContext
@Deprecated public boolean isAllowMultiOverlap()
ShapeCollection.relateContainsShortCircuits()
.@Deprecated public DatelineRule getDatelineRule()
@Deprecated public ValidationRule getValidationRule()
Geometry
, particularly after it has been
read from one of the ShapeReader
s.@Deprecated public boolean isAutoIndex()
ShapeReader
.JtsGeometry.index()
@Deprecated public Geometry getGeometryFrom(Shape shape)
Geometry
for the given Shape
. Some shapes hold a
JTS geometry whereas new ones must be created for the rest.shape
- Not null@Deprecated public boolean useJtsPoint()
SpatialContext.makePoint(double, double)
return JtsPoint
?@Deprecated public boolean useJtsLineString()
SpatialContext.makeLineString(java.util.List)
return JtsGeometry
?@Deprecated public Shape makeShapeFromGeometry(Geometry geom)
ShapeReader
instances.
If given a direct instance of GeometryCollection
then it's contents will be
recursively converted and then the resulting list will be passed to
SpatialContext.makeCollection(List)
and returned.
If given a Point
then SpatialContext.makePoint(double, double)
is called, which will return a JtsPoint
if useJtsPoint()
; otherwise
a standard Spatial4j Point is returned.
If given a LineString
and if useJtsLineString()
is true then
then the geometry's parts are exposed to call SpatialContext.makeLineString(List)
.@Deprecated public JtsGeometry makeShape(Geometry geom, boolean dateline180Check, boolean allowMultiOverlap)
geom
- Non-nulldateline180Check
- if both this is true and SpatialContext.isGeo()
, then JtsGeometry will check
for adjacent coordinates greater than 180 degrees longitude apart, and
it will do tricks to make that line segment (and the shape as a whole)
cross the dateline even though JTS doesn't have geodetic support.allowMultiOverlap
- See isAllowMultiOverlap()
.makeShape(org.locationtech.jts.geom.Geometry)
@Deprecated public JtsGeometry makeShape(Geometry geom)
Shape
from a JTS Geometry
. Generally, this shouldn't be
called when one of the other factory methods are available, such as for points. The caller
needs to have done some verification/normalization of the coordinates by now, if any. Also,
note that direct instances of GeometryCollection
isn't supported.
Instead of calling this method, consider JtsShapeFactory.makeShapeFromGeometry(Geometry)
which@Deprecated public GeometryFactory getGeometryFactory()
public String toString()
toString
in class SpatialContext
@Deprecated public Rectangle makeRectFromRectangularPoly(Geometry geom)
Envelope
(bounding box) of the given geom
. This asserts
that Geometry.isRectangle()
is true. This method reacts to the DatelineRule
setting.geom
- non-nullCopyright © 2020 LocationTech. All rights reserved.