Interface ShapeFactory

All Known Implementing Classes:
JtsShapeFactory, ShapeFactoryImpl

public interface ShapeFactory
A factory for Shapes. Stateless and thread-safe, except for any returned builders.
  • Method Details

    • getSpatialContext

      SpatialContext getSpatialContext()
    • isNormWrapLongitude

      boolean isNormWrapLongitude()
      If true then normX(double) will wrap longitudes outside of the standard geodetic boundary into it. Example: 181 will become -179.
    • normX

      double normX(double x)
      Normalize the 'x' dimension. Might reduce precision or wrap it to be within the bounds. This is called by ShapeReaders before creating a shape.
    • normY

      double normY(double y)
      See Also:
    • normZ

      double normZ(double z)
      (disclaimer: the Z dimension isn't fully supported)
      See Also:
    • normDist

      double normDist(double d)
      Called to normalize a value that isn't X or Y or Z. X & Y & Z are normalized via SpatialContext.normX(double) & normY & normZ. This is called by a ShapeReader before creating a shape.
    • verifyX

      void verifyX(double x)
      Ensure fits in the world bounds. It's called by any shape factory method that gets an 'x' dimension.
    • verifyY

      void verifyY(double y)
      See Also:
    • verifyZ

      void verifyZ(double z)
      (disclaimer: the Z dimension isn't fully supported)
      See Also:
    • pointXY

      Point pointXY(double x, double y)
      Construct a point.
    • pointLatLon

      default Point pointLatLon(double latitude, double longitude)
      Construct a point of latitude, longitude coordinates
    • pointXYZ

      Point pointXYZ(double x, double y, double z)
      Construct a point of 3 dimensions. The implementation might ignore unsupported dimensions like 'z' or throw an error.
    • rect

      Rectangle rect(Point lowerLeft, Point upperRight)
      Construct a rectangle.
    • rect

      Rectangle rect(double minX, double maxX, double minY, double maxY)
      Construct a rectangle. If just one longitude is on the dateline (+/- 180) and if SpatialContext.isGeo() then potentially adjust its sign to ensure the rectangle does not cross the dateline (aka anti-meridian).
    • circle

      Circle circle(double x, double y, double distance)
      Construct a circle. The units of "distance" should be the same as x & y.
    • circle

      Circle circle(Point point, double distance)
      Construct a circle. The units of "distance" should be the same as x & y.
    • lineString

      @Deprecated Shape lineString(List<Point> points, double buf)
      Deprecated.
      Constructs a line string with a possible buffer. It's an ordered sequence of connected vertexes, with a buffer distance along the line in all directions. There is no official shape/interface for it so we just return Shape.
    • multiShape

      @Deprecated <S extends Shape> ShapeCollection<S> multiShape(List<S> coll)
      Deprecated.
      Construct a ShapeCollection, analogous to an OGC GeometryCollection.
    • lineString

      (Builder) Constructs a line string, with a possible buffer. It's an ordered sequence of connected vertexes. There is no official shape/interface for it yet so we just return Shape.
    • polygon

      (Builder) Constructs a polygon. There is no official shape/interface for it yet so we just return Shape.
    • multiShape

      <T extends Shape> ShapeFactory.MultiShapeBuilder<T> multiShape(Class<T> shapeClass)
      (Builder) Constructs a Shape aggregate in which each component/member is an instance of the specified class.
    • multiPoint

      (Builder) Constructs a MultiPoint.
    • multiLineString

      (Builder) Constructs a MultiLineString, or possibly the result of that buffered.
    • multiPolygon

      (Builder) Constructs a MultiPolygon.