Package org.geotools.geometry.jts
Class CircularRing
- Object
-
- Geometry
-
- LineString
-
- LinearRing
-
- CircularRing
-
- All Implemented Interfaces:
Serializable,Cloneable,Comparable,CurvedGeometry<LinearRing>,CurvedRing,SingleCurvedGeometry<LinearRing>,Lineal
public class CircularRing extends LinearRing implements SingleCurvedGeometry<LinearRing>, CurvedRing
A CircularRing is a CircularString whose start and end point coincide. The ring needs to be formed of at least two arc circles, in order to be able to determine its orientation.- Author:
- Andrea Aime - GeoSolutions
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class LinearRing
MINIMUM_VALID_SIZE
-
Fields inherited from class LineString
points
-
Fields inherited from class Geometry
envelope, factory, SRID, TYPECODE_GEOMETRYCOLLECTION, TYPECODE_LINEARRING, TYPECODE_LINESTRING, TYPECODE_MULTILINESTRING, TYPECODE_MULTIPOINT, TYPECODE_MULTIPOLYGON, TYPECODE_POINT, TYPECODE_POLYGON, TYPENAME_GEOMETRYCOLLECTION, TYPENAME_LINEARRING, TYPENAME_LINESTRING, TYPENAME_MULTILINESTRING, TYPENAME_MULTIPOINT, TYPENAME_MULTIPOLYGON, TYPENAME_POINT, TYPENAME_POLYGON
-
-
Constructor Summary
Constructors Constructor Description CircularRing(double[] controlPoints, GeometryFactory factory, double tolerance)CircularRing(CoordinateSequence points, GeometryFactory factory, double tolerance)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(CoordinateFilter filter)voidapply(CoordinateSequenceFilter filter)voidapply(GeometryComponentFilter filter)voidapply(GeometryFilter filter)Geometrybuffer(double distance)Geometrybuffer(double distance, int quadrantSegments)Geometrybuffer(double distance, int quadrantSegments, int endCapStyle)intcompareTo(Object o)intcompareTo(Object o, CoordinateSequenceComparator comp)protected EnvelopecomputeEnvelopeInternal()booleancontains(Geometry g)GeometryconvexHull()CircularRingcopyInternal()booleancoveredBy(Geometry g)booleancovers(Geometry g)booleancrosses(Geometry g)Geometrydifference(Geometry other)booleandisjoint(Geometry g)doubledistance(Geometry g)booleanequals(Object o)booleanequals(Geometry other)booleanequalsExact(Geometry other)booleanequalsExact(Geometry other, double tolerance)booleanequalsNorm(Geometry g)booleanequalsTopo(Geometry other)voidgeometryChanged()CircularArcgetArcN(int arcIndex)Returns the n-th circular arc making up the geometrydoublegetArea()GeometrygetBoundary()intgetBoundaryDimension()PointgetCentroid()double[]getControlPoints()Returns the control points for this string/ring.CoordinategetCoordinate()CoordinategetCoordinateN(int n)Coordinate[]getCoordinates()intgetCoordinatesDimension()Returns the dimension of the geometry without forcing access to the coordinate sequenceCoordinateSequencegetCoordinateSequence()intgetDimension()PointgetEndPoint()GeometrygetEnvelope()EnvelopegetEnvelopeInternal()GeometryFactorygetFactory()GeometrygetGeometryN(int n)StringgetGeometryType()PointgetInteriorPoint()doublegetLength()CoordinateSequencegetLinearizedCoordinateSequence(double tolerance)Returns the linearized coordinates at the given toleranceintgetNumArcs()Number of arc circlesintgetNumGeometries()intgetNumPoints()PointgetPointN(int n)PrecisionModelgetPrecisionModel()intgetSRID()PointgetStartPoint()doublegetTolerance()The default linearization toleranceObjectgetUserData()inthashCode()Geometryintersection(Geometry other)booleanintersects(Geometry g)booleanisClosed()booleanisCoordinate(Coordinate pt)booleanisEmpty()booleanisRectangle()booleanisRing()booleanisSimple()booleanisValid()booleanisWithinDistance(Geometry geom, double distance)LinearRinglinearize()Linearizes the geometry using the built-in linearization toleranceLinearRinglinearize(double tolerance)Linearizes the geometry using the provided tolerance, the result is guaranteed to be less than tolerance away from the curved geometry unless the number of points needed to linearize the geometry exceeds the build-in per quadrant maximum, seeCircularArc.MAX_SEGMENTS_QUADRANTGeometrynorm()voidnormalize()CircularRingnormalizeRing()Returns a normalized ring (one that does not have a single arc closing on itself)booleanoverlaps(Geometry g)IntersectionMatrixrelate(Geometry g)booleanrelate(Geometry g, String intersectionPattern)CircularRingreverse()CircularRingreverseInternal()voidsetSRID(int SRID)voidsetUserData(Object userData)GeometrysymDifference(Geometry other)StringtoCurvedText()Parallel method toGeometry.toText()that will output the geometry as curved instead of as linearStringtoString()StringtoText()booleantouches(Geometry g)Geometryunion()Geometryunion(Geometry other)booleanwithin(Geometry g)-
Methods inherited from class LinearRing
getTypeCode
-
Methods inherited from class LineString
clone, compareToSameClass, compareToSameClass, isEquivalentClass
-
Methods inherited from class Geometry
compare, copy, equal, geometryChangedAction, hasDimension, hasNonEmptyElements, hasNullElements, isGeometryCollection
-
-
-
-
Constructor Detail
-
CircularRing
public CircularRing(CoordinateSequence points, GeometryFactory factory, double tolerance)
-
CircularRing
public CircularRing(double[] controlPoints, GeometryFactory factory, double tolerance)
-
-
Method Detail
-
getNumArcs
public int getNumArcs()
Description copied from interface:SingleCurvedGeometryNumber of arc circles- Specified by:
getNumArcsin interfaceSingleCurvedGeometry<LinearRing>
-
getArcN
public CircularArc getArcN(int arcIndex)
Description copied from interface:SingleCurvedGeometryReturns the n-th circular arc making up the geometry- Specified by:
getArcNin interfaceSingleCurvedGeometry<LinearRing>
-
linearize
public LinearRing linearize()
Description copied from interface:CurvedGeometryLinearizes the geometry using the built-in linearization tolerance- Specified by:
linearizein interfaceCurvedGeometry<LinearRing>
-
linearize
public LinearRing linearize(double tolerance)
Description copied from interface:CurvedGeometryLinearizes the geometry using the provided tolerance, the result is guaranteed to be less than tolerance away from the curved geometry unless the number of points needed to linearize the geometry exceeds the build-in per quadrant maximum, seeCircularArc.MAX_SEGMENTS_QUADRANT- Specified by:
linearizein interfaceCurvedGeometry<LinearRing>- Parameters:
tolerance- Linearization tolerance, should be zero or positive. When zero is used, the maximum number of allowed linearization points will be used, seeCircularArc.MAX_SEGMENTS_QUADRANT
-
getTolerance
public double getTolerance()
Description copied from interface:CurvedGeometryThe default linearization tolerance- Specified by:
getTolerancein interfaceCurvedGeometry<LinearRing>
-
getLinearizedCoordinateSequence
public CoordinateSequence getLinearizedCoordinateSequence(double tolerance)
Description copied from interface:SingleCurvedGeometryReturns the linearized coordinates at the given tolerance- Specified by:
getLinearizedCoordinateSequencein interfaceSingleCurvedGeometry<LinearRing>
-
getControlPoints
public double[] getControlPoints()
Description copied from interface:SingleCurvedGeometryReturns the control points for this string/ring.- Specified by:
getControlPointsin interfaceSingleCurvedGeometry<LinearRing>
-
isClosed
public boolean isClosed()
- Overrides:
isClosedin classLinearRing
-
getDimension
public int getDimension()
- Overrides:
getDimensionin classLineString
-
getBoundaryDimension
public int getBoundaryDimension()
- Overrides:
getBoundaryDimensionin classLinearRing
-
isEmpty
public boolean isEmpty()
- Overrides:
isEmptyin classLineString
-
getGeometryType
public String getGeometryType()
- Overrides:
getGeometryTypein classLinearRing
-
getCoordinatesDimension
public int getCoordinatesDimension()
Description copied from interface:CurvedGeometryReturns the dimension of the geometry without forcing access to the coordinate sequence- Specified by:
getCoordinatesDimensionin interfaceCurvedGeometry<LinearRing>
-
normalizeRing
public CircularRing normalizeRing()
Returns a normalized ring (one that does not have a single arc closing on itself)
-
reverse
public CircularRing reverse()
- Overrides:
reversein classLinearRing
-
reverseInternal
public CircularRing reverseInternal()
- Overrides:
reverseInternalin classLinearRing
-
getNumGeometries
public int getNumGeometries()
- Overrides:
getNumGeometriesin classGeometry
-
getGeometryN
public Geometry getGeometryN(int n)
- Overrides:
getGeometryNin classGeometry
-
setUserData
public void setUserData(Object userData)
- Overrides:
setUserDatain classGeometry
-
getFactory
public GeometryFactory getFactory()
- Overrides:
getFactoryin classGeometry
-
getUserData
public Object getUserData()
- Overrides:
getUserDatain classGeometry
-
getPrecisionModel
public PrecisionModel getPrecisionModel()
- Overrides:
getPrecisionModelin classGeometry
-
isRectangle
public boolean isRectangle()
- Overrides:
isRectanglein classGeometry
-
getInteriorPoint
public Point getInteriorPoint()
- Overrides:
getInteriorPointin classGeometry
-
getEnvelope
public Geometry getEnvelope()
- Overrides:
getEnvelopein classGeometry
-
getEnvelopeInternal
public Envelope getEnvelopeInternal()
- Overrides:
getEnvelopeInternalin classGeometry
-
computeEnvelopeInternal
protected Envelope computeEnvelopeInternal()
- Overrides:
computeEnvelopeInternalin classLineString
-
equalsExact
public boolean equalsExact(Geometry other)
- Overrides:
equalsExactin classGeometry
-
equalsExact
public boolean equalsExact(Geometry other, double tolerance)
- Overrides:
equalsExactin classLineString
-
equalsTopo
public boolean equalsTopo(Geometry other)
- Overrides:
equalsTopoin classGeometry
-
toCurvedText
public String toCurvedText()
Description copied from interface:CurvedGeometryParallel method toGeometry.toText()that will output the geometry as curved instead of as linear- Specified by:
toCurvedTextin interfaceCurvedGeometry<LinearRing>
-
equalsNorm
public boolean equalsNorm(Geometry g)
- Overrides:
equalsNormin classGeometry
-
getCoordinates
public Coordinate[] getCoordinates()
- Overrides:
getCoordinatesin classLineString
-
getCoordinateSequence
public CoordinateSequence getCoordinateSequence()
- Overrides:
getCoordinateSequencein classLineString
-
getCoordinateN
public Coordinate getCoordinateN(int n)
- Overrides:
getCoordinateNin classLineString
-
getCoordinate
public Coordinate getCoordinate()
- Overrides:
getCoordinatein classLineString
-
getNumPoints
public int getNumPoints()
- Overrides:
getNumPointsin classLineString
-
getPointN
public Point getPointN(int n)
- Overrides:
getPointNin classLineString
-
getStartPoint
public Point getStartPoint()
- Overrides:
getStartPointin classLineString
-
getEndPoint
public Point getEndPoint()
- Overrides:
getEndPointin classLineString
-
isRing
public boolean isRing()
- Overrides:
isRingin classLineString
-
getLength
public double getLength()
- Overrides:
getLengthin classLineString
-
getBoundary
public Geometry getBoundary()
- Overrides:
getBoundaryin classLineString
-
isCoordinate
public boolean isCoordinate(Coordinate pt)
- Overrides:
isCoordinatein classLineString
-
apply
public void apply(CoordinateFilter filter)
- Overrides:
applyin classLineString
-
apply
public void apply(CoordinateSequenceFilter filter)
- Overrides:
applyin classLineString
-
apply
public void apply(GeometryFilter filter)
- Overrides:
applyin classLineString
-
apply
public void apply(GeometryComponentFilter filter)
- Overrides:
applyin classLineString
-
copyInternal
public CircularRing copyInternal()
- Overrides:
copyInternalin classLinearRing
-
normalize
public void normalize()
- Overrides:
normalizein classLineString
-
isWithinDistance
public boolean isWithinDistance(Geometry geom, double distance)
- Overrides:
isWithinDistancein classGeometry
-
getCentroid
public Point getCentroid()
- Overrides:
getCentroidin classGeometry
-
geometryChanged
public void geometryChanged()
- Overrides:
geometryChangedin classGeometry
-
intersects
public boolean intersects(Geometry g)
- Overrides:
intersectsin classGeometry
-
relate
public IntersectionMatrix relate(Geometry g)
-
buffer
public Geometry buffer(double distance, int quadrantSegments)
-
buffer
public Geometry buffer(double distance, int quadrantSegments, int endCapStyle)
-
convexHull
public Geometry convexHull()
- Overrides:
convexHullin classGeometry
-
intersection
public Geometry intersection(Geometry other)
- Overrides:
intersectionin classGeometry
-
difference
public Geometry difference(Geometry other)
- Overrides:
differencein classGeometry
-
symDifference
public Geometry symDifference(Geometry other)
- Overrides:
symDifferencein classGeometry
-
compareTo
public int compareTo(Object o)
- Specified by:
compareToin interfaceComparable- Overrides:
compareToin classGeometry
-
compareTo
public int compareTo(Object o, CoordinateSequenceComparator comp)
-
-