Class JtsSpatialContext


  • public class JtsSpatialContext
    extends SpatialContext
    Enhances the default 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.
    • Method Detail

      • isAllowMultiOverlap

        @Deprecated
        public boolean isAllowMultiOverlap()
        Deprecated.
        If geom might be a multi geometry of some kind, then might multiple component geometries overlap? Strict OGC says this is invalid but we can accept it by computing the union. Note: Our ShapeCollection mostly doesn't care but it has a method related to this ShapeCollection.relateContainsShortCircuits().
      • getDatelineRule

        @Deprecated
        public DatelineRule getDatelineRule()
        Deprecated.
        Returns the rule used to handle geometry objects that have dateline (aka anti-meridian) crossing considerations.
      • getValidationRule

        @Deprecated
        public ValidationRule getValidationRule()
        Deprecated.
        Returns the rule used to handle errors when creating a JTS Geometry, particularly after it has been read from one of the ShapeReaders.
      • isAutoIndex

        @Deprecated
        public boolean isAutoIndex()
        Deprecated.
        If JtsGeometry shapes should be automatically "prepared" (i.e. optimized) when read via from a ShapeReader.
        See Also:
        JtsGeometry.index()
      • getGeometryFrom

        @Deprecated
        public org.locationtech.jts.geom.Geometry getGeometryFrom​(Shape shape)
        Deprecated.
        Gets a JTS Geometry for the given Shape. Some shapes hold a JTS geometry whereas new ones must be created for the rest.
        Parameters:
        shape - Not null
        Returns:
        Not null
      • makeShape

        @Deprecated
        public JtsGeometry makeShape​(org.locationtech.jts.geom.Geometry geom,
                                     boolean dateline180Check,
                                     boolean allowMultiOverlap)
        Deprecated.
        INTERNAL
        Parameters:
        geom - Non-null
        dateline180Check - 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().
        See Also:
        makeShape(org.locationtech.jts.geom.Geometry)
      • makeShape

        @Deprecated
        public JtsGeometry makeShape​(org.locationtech.jts.geom.Geometry geom)
        Deprecated.
        INTERNAL: Creates a 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
      • getGeometryFactory

        @Deprecated
        public org.locationtech.jts.geom.GeometryFactory getGeometryFactory()
        Deprecated.
      • makeRectFromRectangularPoly

        @Deprecated
        public Rectangle makeRectFromRectangularPoly​(org.locationtech.jts.geom.Geometry geom)
        Deprecated.
        INTERNAL: Returns a Rectangle of the JTS Envelope (bounding box) of the given geom. This asserts that Geometry.isRectangle() is true. This method reacts to the DatelineRule setting.
        Parameters:
        geom - non-null
        Returns:
        null equivalent Rectangle.