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 void
apply(CoordinateFilter filter)
void
apply(CoordinateSequenceFilter filter)
void
apply(GeometryComponentFilter filter)
void
apply(GeometryFilter filter)
Geometry
buffer(double distance)
Geometry
buffer(double distance, int quadrantSegments)
Geometry
buffer(double distance, int quadrantSegments, int endCapStyle)
int
compareTo(Object o)
int
compareTo(Object o, CoordinateSequenceComparator comp)
protected Envelope
computeEnvelopeInternal()
boolean
contains(Geometry g)
Geometry
convexHull()
CircularRing
copyInternal()
boolean
coveredBy(Geometry g)
boolean
covers(Geometry g)
boolean
crosses(Geometry g)
Geometry
difference(Geometry other)
boolean
disjoint(Geometry g)
double
distance(Geometry g)
boolean
equals(Object o)
boolean
equals(Geometry other)
boolean
equalsExact(Geometry other)
boolean
equalsExact(Geometry other, double tolerance)
boolean
equalsNorm(Geometry g)
boolean
equalsTopo(Geometry other)
void
geometryChanged()
CircularArc
getArcN(int arcIndex)
Returns the n-th circular arc making up the geometrydouble
getArea()
Geometry
getBoundary()
int
getBoundaryDimension()
Point
getCentroid()
double[]
getControlPoints()
Returns the control points for this string/ring.Coordinate
getCoordinate()
Coordinate
getCoordinateN(int n)
Coordinate[]
getCoordinates()
int
getCoordinatesDimension()
Returns the dimension of the geometry without forcing access to the coordinate sequenceCoordinateSequence
getCoordinateSequence()
int
getDimension()
Point
getEndPoint()
Geometry
getEnvelope()
Envelope
getEnvelopeInternal()
GeometryFactory
getFactory()
Geometry
getGeometryN(int n)
String
getGeometryType()
Point
getInteriorPoint()
double
getLength()
CoordinateSequence
getLinearizedCoordinateSequence(double tolerance)
Returns the linearized coordinates at the given toleranceint
getNumArcs()
Number of arc circlesint
getNumGeometries()
int
getNumPoints()
Point
getPointN(int n)
PrecisionModel
getPrecisionModel()
int
getSRID()
Point
getStartPoint()
double
getTolerance()
The default linearization toleranceObject
getUserData()
int
hashCode()
Geometry
intersection(Geometry other)
boolean
intersects(Geometry g)
boolean
isClosed()
boolean
isCoordinate(Coordinate pt)
boolean
isEmpty()
boolean
isRectangle()
boolean
isRing()
boolean
isSimple()
boolean
isValid()
boolean
isWithinDistance(Geometry geom, double distance)
LinearRing
linearize()
Linearizes the geometry using the built-in linearization toleranceLinearRing
linearize(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_QUADRANT
Geometry
norm()
void
normalize()
CircularRing
normalizeRing()
Returns a normalized ring (one that does not have a single arc closing on itself)boolean
overlaps(Geometry g)
IntersectionMatrix
relate(Geometry g)
boolean
relate(Geometry g, String intersectionPattern)
CircularRing
reverse()
CircularRing
reverseInternal()
void
setSRID(int SRID)
void
setUserData(Object userData)
Geometry
symDifference(Geometry other)
String
toCurvedText()
Parallel method toGeometry.toText()
that will output the geometry as curved instead of as linearString
toString()
String
toText()
boolean
touches(Geometry g)
Geometry
union()
Geometry
union(Geometry other)
boolean
within(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:SingleCurvedGeometry
Number of arc circles- Specified by:
getNumArcs
in interfaceSingleCurvedGeometry<LinearRing>
-
getArcN
public CircularArc getArcN(int arcIndex)
Description copied from interface:SingleCurvedGeometry
Returns the n-th circular arc making up the geometry- Specified by:
getArcN
in interfaceSingleCurvedGeometry<LinearRing>
-
linearize
public LinearRing linearize()
Description copied from interface:CurvedGeometry
Linearizes the geometry using the built-in linearization tolerance- Specified by:
linearize
in interfaceCurvedGeometry<LinearRing>
-
linearize
public LinearRing linearize(double tolerance)
Description copied from interface:CurvedGeometry
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_QUADRANT
- Specified by:
linearize
in 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:CurvedGeometry
The default linearization tolerance- Specified by:
getTolerance
in interfaceCurvedGeometry<LinearRing>
-
getLinearizedCoordinateSequence
public CoordinateSequence getLinearizedCoordinateSequence(double tolerance)
Description copied from interface:SingleCurvedGeometry
Returns the linearized coordinates at the given tolerance- Specified by:
getLinearizedCoordinateSequence
in interfaceSingleCurvedGeometry<LinearRing>
-
getControlPoints
public double[] getControlPoints()
Description copied from interface:SingleCurvedGeometry
Returns the control points for this string/ring.- Specified by:
getControlPoints
in interfaceSingleCurvedGeometry<LinearRing>
-
isClosed
public boolean isClosed()
- Overrides:
isClosed
in classLinearRing
-
getDimension
public int getDimension()
- Overrides:
getDimension
in classLineString
-
getBoundaryDimension
public int getBoundaryDimension()
- Overrides:
getBoundaryDimension
in classLinearRing
-
isEmpty
public boolean isEmpty()
- Overrides:
isEmpty
in classLineString
-
getGeometryType
public String getGeometryType()
- Overrides:
getGeometryType
in classLinearRing
-
getCoordinatesDimension
public int getCoordinatesDimension()
Description copied from interface:CurvedGeometry
Returns the dimension of the geometry without forcing access to the coordinate sequence- Specified by:
getCoordinatesDimension
in 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:
reverse
in classLinearRing
-
reverseInternal
public CircularRing reverseInternal()
- Overrides:
reverseInternal
in classLinearRing
-
getNumGeometries
public int getNumGeometries()
- Overrides:
getNumGeometries
in classGeometry
-
getGeometryN
public Geometry getGeometryN(int n)
- Overrides:
getGeometryN
in classGeometry
-
setUserData
public void setUserData(Object userData)
- Overrides:
setUserData
in classGeometry
-
getFactory
public GeometryFactory getFactory()
- Overrides:
getFactory
in classGeometry
-
getUserData
public Object getUserData()
- Overrides:
getUserData
in classGeometry
-
getPrecisionModel
public PrecisionModel getPrecisionModel()
- Overrides:
getPrecisionModel
in classGeometry
-
isRectangle
public boolean isRectangle()
- Overrides:
isRectangle
in classGeometry
-
getInteriorPoint
public Point getInteriorPoint()
- Overrides:
getInteriorPoint
in classGeometry
-
getEnvelope
public Geometry getEnvelope()
- Overrides:
getEnvelope
in classGeometry
-
getEnvelopeInternal
public Envelope getEnvelopeInternal()
- Overrides:
getEnvelopeInternal
in classGeometry
-
computeEnvelopeInternal
protected Envelope computeEnvelopeInternal()
- Overrides:
computeEnvelopeInternal
in classLineString
-
equalsExact
public boolean equalsExact(Geometry other)
- Overrides:
equalsExact
in classGeometry
-
equalsExact
public boolean equalsExact(Geometry other, double tolerance)
- Overrides:
equalsExact
in classLineString
-
equalsTopo
public boolean equalsTopo(Geometry other)
- Overrides:
equalsTopo
in classGeometry
-
toCurvedText
public String toCurvedText()
Description copied from interface:CurvedGeometry
Parallel method toGeometry.toText()
that will output the geometry as curved instead of as linear- Specified by:
toCurvedText
in interfaceCurvedGeometry<LinearRing>
-
equalsNorm
public boolean equalsNorm(Geometry g)
- Overrides:
equalsNorm
in classGeometry
-
getCoordinates
public Coordinate[] getCoordinates()
- Overrides:
getCoordinates
in classLineString
-
getCoordinateSequence
public CoordinateSequence getCoordinateSequence()
- Overrides:
getCoordinateSequence
in classLineString
-
getCoordinateN
public Coordinate getCoordinateN(int n)
- Overrides:
getCoordinateN
in classLineString
-
getCoordinate
public Coordinate getCoordinate()
- Overrides:
getCoordinate
in classLineString
-
getNumPoints
public int getNumPoints()
- Overrides:
getNumPoints
in classLineString
-
getPointN
public Point getPointN(int n)
- Overrides:
getPointN
in classLineString
-
getStartPoint
public Point getStartPoint()
- Overrides:
getStartPoint
in classLineString
-
getEndPoint
public Point getEndPoint()
- Overrides:
getEndPoint
in classLineString
-
isRing
public boolean isRing()
- Overrides:
isRing
in classLineString
-
getLength
public double getLength()
- Overrides:
getLength
in classLineString
-
getBoundary
public Geometry getBoundary()
- Overrides:
getBoundary
in classLineString
-
isCoordinate
public boolean isCoordinate(Coordinate pt)
- Overrides:
isCoordinate
in classLineString
-
apply
public void apply(CoordinateFilter filter)
- Overrides:
apply
in classLineString
-
apply
public void apply(CoordinateSequenceFilter filter)
- Overrides:
apply
in classLineString
-
apply
public void apply(GeometryFilter filter)
- Overrides:
apply
in classLineString
-
apply
public void apply(GeometryComponentFilter filter)
- Overrides:
apply
in classLineString
-
copyInternal
public CircularRing copyInternal()
- Overrides:
copyInternal
in classLinearRing
-
normalize
public void normalize()
- Overrides:
normalize
in classLineString
-
isWithinDistance
public boolean isWithinDistance(Geometry geom, double distance)
- Overrides:
isWithinDistance
in classGeometry
-
getCentroid
public Point getCentroid()
- Overrides:
getCentroid
in classGeometry
-
geometryChanged
public void geometryChanged()
- Overrides:
geometryChanged
in classGeometry
-
intersects
public boolean intersects(Geometry g)
- Overrides:
intersects
in 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:
convexHull
in classGeometry
-
intersection
public Geometry intersection(Geometry other)
- Overrides:
intersection
in classGeometry
-
difference
public Geometry difference(Geometry other)
- Overrides:
difference
in classGeometry
-
symDifference
public Geometry symDifference(Geometry other)
- Overrides:
symDifference
in classGeometry
-
compareTo
public int compareTo(Object o)
- Specified by:
compareTo
in interfaceComparable
- Overrides:
compareTo
in classGeometry
-
compareTo
public int compareTo(Object o, CoordinateSequenceComparator comp)
-
-