Package org.locationtech.spatial4j.shape
Interface ShapeFactory
- All Known Implementing Classes:
JtsShapeFactory
,ShapeFactoryImpl
public interface ShapeFactory
A factory for
Shape
s.
Stateless and thread-safe, except for any returned builders.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
static interface
static interface
static interface
static interface
ShapeFactory.MultiShapeBuilder<T extends Shape>
static interface
Builds a point and returns the generic specified type (usually whatever "this" is).static interface
-
Method Summary
Modifier and TypeMethodDescriptioncircle
(double x, double y, double distance) Construct a circle.Construct a circle.boolean
If true thennormX(double)
will wrap longitudes outside of the standard geodetic boundary into it.(Builder) Constructs a line string, with a possible buffer.lineString
(List<Point> points, double buf) Deprecated.(Builder) Constructs a MultiLineString, or possibly the result of that buffered.(Builder) Constructs a MultiPoint.(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.double
normDist
(double d) Called to normalize a value that isn't X or Y or Z.double
normX
(double x) Normalize the 'x' dimension.double
normY
(double y) double
normZ
(double z) (disclaimer: the Z dimension isn't fully supported)default Point
pointLatLon
(double latitude, double longitude) Construct a point of latitude, longitude coordinatespointXY
(double x, double y) Construct a point.pointXYZ
(double x, double y, double z) Construct a point of 3 dimensions.polygon()
(Builder) Constructs a polygon.rect
(double minX, double maxX, double minY, double maxY) Construct a rectangle.Construct a rectangle.void
verifyX
(double x) Ensure fits in the world bounds.void
verifyY
(double y) void
verifyZ
(double z) (disclaimer: the Z dimension isn't fully supported)
-
Method Details
-
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 byShapeReader
s 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 viaSpatialContext.normX(double)
& normY & normZ. This is called by aShapeReader
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
Construct a point. -
pointLatLon
Construct a point of latitude, longitude coordinates -
pointXYZ
Construct a point of 3 dimensions. The implementation might ignore unsupported dimensions like 'z' or throw an error. -
rect
Construct a rectangle. -
rect
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
Construct a circle. The units of "distance" should be the same as x & y. -
circle
Construct a circle. The units of "distance" should be the same as x & y. -
lineString
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.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
(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.
-