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 Detail

      • 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.
      • normZ

        double normZ​(double z)
        (disclaimer: the Z dimension isn't fully supported)
        See Also:
        normX(double)
      • 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.
      • verifyZ

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

        Point pointXY​(double x,
                      double y)
        Construct a point.
      • 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​(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.
      • lineString

        ShapeFactory.LineStringBuilder 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

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

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