Represents a polyline that is closed, i.e., the first point and the last point coincide.
More...
#include <luciad/geometries/PolylineRing.h>
|
| size_t | getHash () const override |
| | Returns the hash value for this geometry.
|
Represents a polyline that is closed, i.e., the first point and the last point coincide.
- See also
- GeometryFactory::createPolylineRing
◆ ~PolylineRing()
| luciad::PolylineRing::~PolylineRing |
( |
| ) |
|
|
override |
◆ computePoint()
| Coordinate luciad::PolylineRing::computePoint |
( |
double | parameter | ) |
const |
|
overridevirtual |
Computes a point of the curve, defined by the given parameter.
- At parameter 0, the point is the start point of the curve.
- At parameter 1, the point is the end point of the curve.
- Parameters
-
| parameter | the parameter value, within [0,1], to compute the point location for. |
- Returns
- the computed point location.
- Exceptions
-
| luciad::InvalidArgumentException | if parameter is not within [0,1], or if the point could not be computed. For example, when the curve is defined by invalid points. |
Reimplemented from luciad::CompositeRing.
◆ getArea()
| double luciad::PolylineRing::getArea |
( |
| ) |
const |
Returns the 2D area enclosed by this polyline ring.
The calculations are performed in the coordinate reference of this geometry. This means that
- for geodetic references, the curvature of the line segments are taken into account (depending on the
interpolation type).
- for other references, the calculations are cartesian.
The returned value is expressed in the unit of measure of the reference of this geometry.
- for geodetic references, this is always meters.
- or other references this is typically meters, but depending on the reference the unit of measure can also be something else like millimeters or feet.
Limitations:
- The area calculation is performed in 2D. For 3D polyline rings, the z value will be ignored and considered as 0.
- For this reason, geometries with a geocentric reference are not supported at all. In this case, an exception is thrown.
- Geometries with a
rhumb line interpolation type are not supported. In this case, an exception is thrown.
- The calculations are only correct for non-self-intersecting polyline rings. If a polyline ring does self-intersect, one of the parts of ring may be considered as interior instead of exterior during this calculation, and the area will be smaller than it actually is.
- Returns
- the 2D area enclosed by this polyline ring.
- Exceptions
-
- Since
- 2025.0
◆ getBounds()
| Bounds luciad::PolylineRing::getBounds |
( |
| ) |
const |
|
overridevirtual |
Returns the bounds for the geometry object.
- Returns
- the bounds for the geometry object.
- Exceptions
-
Reimplemented from luciad::CompositeRing.
◆ getCurveAt()
| std::shared_ptr< Curve > luciad::PolylineRing::getCurveAt |
( |
size_t | index | ) |
const |
|
overridevirtual |
◆ getCurveCount()
| size_t luciad::PolylineRing::getCurveCount |
( |
| ) |
const |
|
overridevirtual |
Returns the number of curves in this composite.
- Returns
- the number of curves in this composite.
- See also
- getCurveAt
Reimplemented from luciad::CompositeRing.
◆ getHash()
| size_t luciad::PolylineRing::getHash |
( |
| ) |
const |
|
overrideprotectedvirtual |
Returns the hash value for this geometry.
- Returns
- the hash value for this geometry.
Reimplemented from luciad::CompositeRing.
◆ getInterpolationType()
Returns the interpolation type of the line segment.
One of
- Returns
- the interpolation type of the line segment.
◆ getLength2D()
| double luciad::PolylineRing::getLength2D |
( |
| ) |
const |
|
overridevirtual |
Returns the length of the curve.
- Returns
- the length of the curve.
- Exceptions
-
Reimplemented from luciad::CompositeRing.
◆ getOrientation()
Returns the orientation of this polyline ring.
The calculations are performed in the coordinate reference of this geometry. This means that
- for geodetic references, the curvature of the line segments are taken into account (depending on the
interpolation type).
- for other references, the calculations are cartesian.
Limitations:
- The calculation is performed in 2D. For 3D polyline rings, the z value will be ignored and considered as 0.
- For this reason, geometries with a geocentric reference are not supported at all. In this case, an exception is thrown.
- Geometries with a
rhumb line interpolation type are not supported. In this case, an exception is thrown.
- The orientation is not well-defined for polyline rings that self-intersect. This function will then return the orientation of the largest sub-part of the polyline ring.
- Returns
- the orientation of this polyline ring.
- Exceptions
-
- Since
- 2025.0
◆ getPoint()
| Coordinate luciad::PolylineRing::getPoint |
( |
size_t | index | ) |
const |
Returns the coordinate for the requested index.
- Parameters
-
| index | the index of the requested point. |
- Returns
- the point at the index.
- Exceptions
-
◆ getPointCount()
| size_t luciad::PolylineRing::getPointCount |
( |
| ) |
const |
Returns the number of points in the polyline ring.
- Returns
- the number of points in the polyline ring.
◆ getPoints()
| const std::vector< Coordinate > & luciad::PolylineRing::getPoints |
( |
| ) |
const |
Returns the list of points of this polyline ring.
- Returns
- the list of points of this polyline ring.
◆ getReference()
Returns the coordinate reference of the geometry.
- Returns
- the coordinate reference of the geometry.
Reimplemented from luciad::CompositeRing.
◆ insertPoint()
| std::shared_ptr< PolylineRing > luciad::PolylineRing::insertPoint |
( |
size_t | index, |
|
|
Coordinate | newLocation ) const |
Creates a new PolylineRing with an newly inserted control point.
- Parameters
-
| index | the index of the newly inserted control point. Should be in [0, getPointCount()]. For index 0, a new point will be added at the start of the Polyline ring. For index getPointCount(), a new point is added at the end of the Polyline ring. For other index values, a new point will be added between the point at specified (index-1) and the point at the index position. |
| newLocation | the location of the new point |
- Returns
- a new geometry
- Exceptions
-
- Since
- 2020.1
◆ movePoint()
| std::shared_ptr< PolylineRing > luciad::PolylineRing::movePoint |
( |
size_t | index, |
|
|
Coordinate | newLocation ) const |
Creates a new PolylineRing with a moved control point.
- Parameters
-
| index | the index of the point to move. Should be in [0, getPointCount() - 1]. |
| newLocation | the new location of the point |
- Returns
- a new geometry
- Exceptions
-
- Since
- 2020.1
◆ removePoint()
| std::shared_ptr< PolylineRing > luciad::PolylineRing::removePoint |
( |
size_t | index | ) |
const |
Creates a new PolylineRing with a control point removed.
This methods returns a copy of the polyline ring if its point count is less or equal to 3.
- Parameters
-
| index | the index of the point to be removed. Should be in [0, getPointCount() - 1]. |
- Returns
- a new geometry
- Exceptions
-
- Since
- 2020.1
◆ translate()
Translates the entire polyline ring.
Note: when the polyline ring is defined in a geodetic reference and uses geodetic interpolation, the translation is not performed by translating the points one by one. Instead, a translation method is used that better preserves the shape of the polyline ring when moving it towards (or away from) the poles.
- Parameters
-
| translation | the translation vector |
- Returns
- a new, translated geometry
- Since
- 2020.1