Package io.github.sebasbaumh.postgis
Class CompoundCurve
java.lang.Object
io.github.sebasbaumh.postgis.Geometry
io.github.sebasbaumh.postgis.Curve
io.github.sebasbaumh.postgis.CompoundCurve
- All Implemented Interfaces:
LineBasedGeometry,Serializable,Iterable<LineString>
A compound curve is a single, continuous curve that has both curved (circular) segments and linear segments. That
means that in addition to having well-formed components, the end point of every component (except the last) must be
coincident with the start point of the following component. Just note: here it is treated as a special
MultiCurve where the end points of all contained lines match.- Author:
- Sebastian Baumhekel
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe OGIS geometry type number for single, continuous curves that have both curved (circular) segments and linear segments.Fields inherited from class io.github.sebasbaumh.postgis.Geometry
UNKNOWN_SRID -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an instance.CompoundCurve(Iterable<? extends LineString> geoms) Constructs an instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(LineString geom) Adds a geometry.final voidaddAll(Iterable<? extends LineString> geoms) Adds all given geometries.booleanDo some internal consistency checks on the geometry.voidclose()Closes thisCurveif the last coordinate is not already the same as the first coordinate.booleanjava.lang.Object equals implementationGets the coordinates of thisGeometry.Gets the end point.Gets all geometries.intGets the number of coordinates of thisGeometry.Gets the start point.inthashCode()booleanReturns whether we have a measure (4th dimension)booleanis3d()Checks if thisGeometryis 3d.booleanisEmpty()Checks, if there are no sub-geometries.iterator()doublelength()Gets the length of this line.voidreverse()Reverses this linestring.voidsetSrid(int srid) Recursively sets the srid on this geometry and all contained subgeometriesintsize()Gets the number of contained geometries.Methods inherited from class io.github.sebasbaumh.postgis.Curve
isClockwise, isClosed, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
TYPE
public static final int TYPEThe OGIS geometry type number for single, continuous curves that have both curved (circular) segments and linear segments.- See Also:
-
-
Constructor Details
-
CompoundCurve
public CompoundCurve()Constructs an instance. -
CompoundCurve
Constructs an instance.- Parameters:
geoms- geometries
-
-
Method Details
-
add
Adds a geometry.- Parameters:
geom- geometry
-
addAll
Adds all given geometries.- Parameters:
geoms- geometries
-
checkConsistency
public boolean checkConsistency()Description copied from class:GeometryDo some internal consistency checks on the geometry. Currently, all Geometries must have a valid dimension (2 or 3) and a valid type. Composed geometries must have all equal SRID, dimensionality and measures, as well as that they do not contain NULL or inconsistent subgeometries. BinaryParser and WKTParser should only generate consistent geometries. BinaryWriter may produce invalid results on inconsistent geometries.- Overrides:
checkConsistencyin classGeometry- Returns:
- true if all checks are passed.
-
close
public void close()Closes thisCurveif the last coordinate is not already the same as the first coordinate. -
equals
Description copied from class:Geometryjava.lang.Object equals implementation -
getCoordinates
Description copied from class:GeometryGets the coordinates of thisGeometry.- Specified by:
getCoordinatesin classGeometry- Returns:
- coordinates
-
getEndPoint
Description copied from interface:LineBasedGeometryGets the end point.- Specified by:
getEndPointin interfaceLineBasedGeometry- Returns:
Pointon success, else null
-
getGeometries
Gets all geometries.- Returns:
- geometries
-
getNumberOfCoordinates
public int getNumberOfCoordinates()Description copied from class:GeometryGets the number of coordinates of thisGeometry.- Specified by:
getNumberOfCoordinatesin classGeometry- Returns:
- number of coordinates
-
getStartPoint
Description copied from interface:LineBasedGeometryGets the start point.- Specified by:
getStartPointin interfaceLineBasedGeometry- Returns:
Pointon success, else null
-
hashCode
public int hashCode() -
hasMeasure
public boolean hasMeasure()Description copied from class:GeometryReturns whether we have a measure (4th dimension)- Specified by:
hasMeasurein classGeometry- Returns:
- true if the geometry has a measure, false otherwise
-
is3d
public boolean is3d()Description copied from class:GeometryChecks if thisGeometryis 3d. -
isEmpty
public boolean isEmpty()Checks, if there are no sub-geometries. -
iterator
- Specified by:
iteratorin interfaceIterable<LineString>
-
length
public double length()Description copied from interface:LineBasedGeometryGets the length of this line.- Specified by:
lengthin interfaceLineBasedGeometry- Returns:
- length
-
reverse
public void reverse()Description copied from class:CurveReverses this linestring. -
setSrid
public void setSrid(int srid) Description copied from class:GeometryRecursively sets the srid on this geometry and all contained subgeometries -
size
public int size()Gets the number of contained geometries.- Returns:
- number of contained geometries
-