Package org.locationtech.spatial4j.shape
Interface ShapeFactory
-
- All Known Subinterfaces:
S2ShapeFactory
- All Known Implementing Classes:
JtsShapeFactory,ShapeFactoryImpl
public interface ShapeFactoryA factory forShapes. Stateless and thread-safe, except for any returned builders.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceShapeFactory.LineStringBuilderstatic interfaceShapeFactory.MultiLineStringBuilderstatic interfaceShapeFactory.MultiPointBuilderstatic interfaceShapeFactory.MultiPolygonBuilderstatic interfaceShapeFactory.MultiShapeBuilder<T extends Shape>static interfaceShapeFactory.PointsBuilder<T>Builds a point and returns the generic specified type (usually whatever "this" is).static interfaceShapeFactory.PolygonBuilder
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Circlecircle(double x, double y, double distance)Construct a circle.Circlecircle(Point point, double distance)Construct a circle.SpatialContextgetSpatialContext()booleanisNormWrapLongitude()If true thennormX(double)will wrap longitudes outside of the standard geodetic boundary into it.ShapeFactory.LineStringBuilderlineString()(Builder) Constructs a line string, with a possible buffer.ShapelineString(List<Point> points, double buf)Deprecated.ShapeFactory.MultiLineStringBuildermultiLineString()(Builder) Constructs a MultiLineString, or possibly the result of that buffered.ShapeFactory.MultiPointBuildermultiPoint()(Builder) Constructs a MultiPoint.ShapeFactory.MultiPolygonBuildermultiPolygon()(Builder) Constructs a MultiPolygon.<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.<S extends Shape>
ShapeCollection<S>multiShape(List<S> coll)Deprecated.doublenormDist(double d)Called to normalize a value that isn't X or Y or Z.doublenormX(double x)Normalize the 'x' dimension.doublenormY(double y)doublenormZ(double z)(disclaimer: the Z dimension isn't fully supported)PointpointXY(double x, double y)Construct a point.PointpointXYZ(double x, double y, double z)Construct a point of 3 dimensions.ShapeFactory.PolygonBuilderpolygon()(Builder) Constructs a polygon.Rectanglerect(double minX, double maxX, double minY, double maxY)Construct a rectangle.Rectanglerect(Point lowerLeft, Point upperRight)Construct a rectangle.voidverifyX(double x)Ensure fits in the world bounds.voidverifyY(double y)voidverifyZ(double z)(disclaimer: the Z dimension isn't fully supported)
-
-
-
Method Detail
-
getSpatialContext
SpatialContext getSpatialContext()
-
isNormWrapLongitude
boolean isNormWrapLongitude()
If true thennormX(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 byShapeReaders before creating a shape.
-
normY
double normY(double y)
- See Also:
normX(double)
-
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 viaSpatialContext.normX(double)& normY & normZ. This is called by aShapeReaderbefore 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:
verifyX(double)
-
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 ifSpatialContext.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
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 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
ShapeFactory.MultiPointBuilder multiPoint()
(Builder) Constructs a MultiPoint.
-
multiLineString
ShapeFactory.MultiLineStringBuilder multiLineString()
(Builder) Constructs a MultiLineString, or possibly the result of that buffered.
-
multiPolygon
ShapeFactory.MultiPolygonBuilder multiPolygon()
(Builder) Constructs a MultiPolygon.
-
-