Package io.github.sebasbaumh.postgis
Class CircularString
- java.lang.Object
-
- io.github.sebasbaumh.postgis.Geometry
-
- io.github.sebasbaumh.postgis.Curve
-
- io.github.sebasbaumh.postgis.LineString
-
- io.github.sebasbaumh.postgis.CircularString
-
- All Implemented Interfaces:
LineBasedGeometry
,java.io.Serializable
,java.lang.Iterable<Point>
@NonNullByDefault public class CircularString extends LineString
The CIRCULARSTRING is the basic curve type, similar to a LINESTRING in the linear world. A single segment required three points, the start and end points (first and third) and any other point on the arc. The exception to this is for a closed circle, where the start and end points are the same. In this case the second point MUST be the center of the arc, ie the opposite side of the circle. To chain arcs together, the last point of the previous arc becomes the first point of the next arc, just like in LINESTRING. This means that a valid circular string must have an odd number of points greater than 1.- Author:
- Sebastian Baumhekel
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
TYPE
The OGIS geometry type number for arcs/circles.-
Fields inherited from class io.github.sebasbaumh.postgis.Geometry
UNKNOWN_SRID
-
-
Constructor Summary
Constructors Constructor Description CircularString()
Constructs an instance.CircularString(java.lang.Iterable<Point> points)
Constructs an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
length()
Gets the length of this line.-
Methods inherited from class io.github.sebasbaumh.postgis.LineString
add, addAll, checkConsistency, close, equals, getCoordinates, getEndPoint, getNumberOfCoordinates, getStartPoint, hasMeasure, is3d, isEmpty, iterator, reverse
-
Methods inherited from class io.github.sebasbaumh.postgis.Curve
isClockwise, isClosed
-
Methods inherited from class io.github.sebasbaumh.postgis.Geometry
getDimension, getSrid, getType, hashCode, numPoints, setSrid
-
-
-
-
Field Detail
-
TYPE
public static final int TYPE
The OGIS geometry type number for arcs/circles.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CircularString
public CircularString()
Constructs an instance.
-
CircularString
public CircularString(java.lang.Iterable<Point> points)
Constructs an instance.- Parameters:
points
- points
-
-
Method Detail
-
length
public double length()
Description copied from interface:LineBasedGeometry
Gets the length of this line.- Specified by:
length
in interfaceLineBasedGeometry
- Overrides:
length
in classLineString
- Returns:
- length
-
-