public class ShapeFactoryImpl extends Object implements ShapeFactory
ShapeFactory
. It does not support polygon shapes.Modifier and Type | Class and Description |
---|---|
protected class |
ShapeFactoryImpl.GeneralShapeMultiShapeBuilder<T extends Shape> |
ShapeFactory.LineStringBuilder, ShapeFactory.MultiLineStringBuilder, ShapeFactory.MultiPointBuilder, ShapeFactory.MultiPolygonBuilder, ShapeFactory.MultiShapeBuilder<T extends Shape>, ShapeFactory.PointsBuilder<T>, ShapeFactory.PolygonBuilder
Modifier and Type | Field and Description |
---|---|
protected SpatialContext |
ctx |
Constructor and Description |
---|
ShapeFactoryImpl(SpatialContext ctx,
SpatialContextFactory factory) |
Modifier and Type | Method and Description |
---|---|
Circle |
circle(double x,
double y,
double distance)
Construct a circle.
|
Circle |
circle(Point point,
double distance)
Construct a circle.
|
SpatialContext |
getSpatialContext() |
boolean |
isNormWrapLongitude()
If true then
ShapeFactory.normX(double) will wrap longitudes outside of the standard
geodetic boundary into it. |
ShapeFactory.LineStringBuilder |
lineString()
(Builder) Constructs a line string, with a possible buffer.
|
Shape |
lineString(List<Point> points,
double buf)
Constructs a line string with a possible buffer.
|
ShapeFactory.MultiLineStringBuilder |
multiLineString()
(Builder) Constructs a MultiLineString, or possibly the result of that buffered.
|
ShapeFactory.MultiPointBuilder |
multiPoint()
(Builder) Constructs a MultiPoint.
|
ShapeFactory.MultiPolygonBuilder |
multiPolygon()
(Builder) Constructs a MultiPolygon.
|
<T extends Shape> |
multiShape(Class<T> shapeClass)
(Builder) Constructs a Shape aggregate in which each component/member
is an instance of the specified class.
|
<S extends Shape> |
multiShape(List<S> coll)
Construct a ShapeCollection, analogous to an OGC GeometryCollection.
|
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)
|
Point |
pointXY(double x,
double y)
Construct a point.
|
Point |
pointXYZ(double x,
double y,
double z)
Construct a point of 3 dimensions.
|
ShapeFactory.PolygonBuilder |
polygon()
(Builder) Constructs a polygon.
|
Rectangle |
rect(double minX,
double maxX,
double minY,
double maxY)
Construct a rectangle.
|
Rectangle |
rect(Point lowerLeft,
Point upperRight)
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)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
pointLatLon
protected final SpatialContext ctx
public ShapeFactoryImpl(SpatialContext ctx, SpatialContextFactory factory)
public SpatialContext getSpatialContext()
getSpatialContext
in interface ShapeFactory
public boolean isNormWrapLongitude()
ShapeFactory
ShapeFactory.normX(double)
will wrap longitudes outside of the standard
geodetic boundary into it. Example: 181 will become -179.isNormWrapLongitude
in interface ShapeFactory
public double normX(double x)
ShapeFactory
ShapeReader
s before creating a shape.normX
in interface ShapeFactory
public double normY(double y)
normY
in interface ShapeFactory
ShapeFactory.normX(double)
public double normZ(double z)
ShapeFactory
normZ
in interface ShapeFactory
ShapeFactory.normX(double)
public double normDist(double d)
ShapeFactory
SpatialContext.normX(double)
& normY & normZ. This
is called by a ShapeReader
before creating a shape.normDist
in interface ShapeFactory
public void verifyX(double x)
ShapeFactory
verifyX
in interface ShapeFactory
public void verifyY(double y)
verifyY
in interface ShapeFactory
ShapeFactory.verifyX(double)
public void verifyZ(double z)
ShapeFactory
verifyZ
in interface ShapeFactory
ShapeFactory.verifyX(double)
public Point pointXY(double x, double y)
ShapeFactory
pointXY
in interface ShapeFactory
public Point pointXYZ(double x, double y, double z)
ShapeFactory
pointXYZ
in interface ShapeFactory
public Rectangle rect(Point lowerLeft, Point upperRight)
ShapeFactory
rect
in interface ShapeFactory
public Rectangle rect(double minX, double maxX, double minY, double maxY)
ShapeFactory
SpatialContext.isGeo()
then potentially adjust its sign to ensure the rectangle does not cross the
dateline (aka anti-meridian).rect
in interface ShapeFactory
public Circle circle(double x, double y, double distance)
ShapeFactory
circle
in interface ShapeFactory
public Circle circle(Point point, double distance)
ShapeFactory
circle
in interface ShapeFactory
public Shape lineString(List<Point> points, double buf)
ShapeFactory
lineString
in interface ShapeFactory
public ShapeFactory.LineStringBuilder lineString()
ShapeFactory
lineString
in interface ShapeFactory
public <S extends Shape> ShapeCollection<S> multiShape(List<S> coll)
ShapeFactory
multiShape
in interface ShapeFactory
public <T extends Shape> ShapeFactory.MultiShapeBuilder<T> multiShape(Class<T> shapeClass)
ShapeFactory
multiShape
in interface ShapeFactory
public ShapeFactory.MultiPointBuilder multiPoint()
ShapeFactory
multiPoint
in interface ShapeFactory
public ShapeFactory.MultiLineStringBuilder multiLineString()
ShapeFactory
multiLineString
in interface ShapeFactory
public ShapeFactory.MultiPolygonBuilder multiPolygon()
ShapeFactory
multiPolygon
in interface ShapeFactory
public ShapeFactory.PolygonBuilder polygon()
ShapeFactory
polygon
in interface ShapeFactory
Copyright © 2020 LocationTech. All rights reserved.