OGRCurve Class Reference

#include <ogr_geometry.h>

Inheritance diagram for OGRCurve:
OGRGeometry OGRCompoundCurve OGRSimpleCurve OGRCircularString OGRLineString OGRLinearRing

List of all members.

Public Member Functions

OGRCurve & operator= (const OGRCurve &other)
 Assignment operator.
virtual double get_Length () const =0
 Returns the length of the curve.
virtual void StartPoint (OGRPoint *) const =0
 Return the curve start point.
virtual void EndPoint (OGRPoint *) const =0
 Return the curve end point.
virtual int get_IsClosed () const
 Return TRUE if curve is closed.
virtual void Value (double, OGRPoint *) const =0
 Fetch point at given distance along curve.
virtual OGRLineString * CurveToLine (double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=NULL) const =0
 Return a linestring from a curve geometry.
virtual int getDimension () const
 Get the dimension of this object.
virtual int getNumPoints () const =0
 Return the number of points of a curve geometry.
virtual OGRPointIterator * getPointIterator () const =0
 Returns a point iterator over the curve.
virtual OGRBoolean IsConvex () const
 Returns if a (closed) curve forms a convex shape.
virtual double get_Area () const =0
 Get the area of the (closed) curve.

Static Public Member Functions

static OGRCompoundCurve * CastToCompoundCurve (OGRCurve *puCurve)
 Cast to compound curve.
static OGRLineString * CastToLineString (OGRCurve *poCurve)
 Cast to linestring.
static OGRLinearRing * CastToLinearRing (OGRCurve *poCurve)
 Cast to linear ring.

Protected Member Functions

virtual double get_AreaOfCurveSegments () const =0
 Get the area of the purely curve portions of a (closed) curve.

Friends

class OGRCurvePolygon
class OGRCompoundCurve

Detailed Description

Abstract curve base class for OGRLineString, OGRCircularString and OGRCompoundCurve


Member Function Documentation

OGRCompoundCurve * OGRCurve::CastToCompoundCurve ( OGRCurve *  poCurve  )  [static]

Cast to compound curve.

The passed in geometry is consumed and a new one returned (or NULL in case of failure)

Parameters:
poCurve the input geometry - ownership is passed to the method.
Returns:
new geometry
Since:
GDAL 2.0

References OGRCompoundCurve::addCurveDirectly(), OGRGeometry::assignSpatialReference(), CastToLineString(), OGRGeometry::getGeometryType(), OGRGeometry::getSpatialReference(), OGRGeometry::IsEmpty(), and wkbLineString.

Referenced by OGRGeometryFactory::forceTo().

OGRLinearRing * OGRCurve::CastToLinearRing ( OGRCurve *  poCurve  )  [static]

Cast to linear ring.

The passed in geometry is consumed and a new one returned (or NULL in case of failure)

Parameters:
poCurve the input geometry - ownership is passed to the method.
Returns:
new geometry.
Since:
GDAL 2.0

Reimplemented in OGRLineString, and OGRCompoundCurve.

Referenced by OGRCurvePolygon::CastToPolygon(), OGRCurvePolygon::CurvePolyToPoly(), and OGRGeometryFactory::forceToPolygon().

OGRLineString * OGRCurve::CastToLineString ( OGRCurve *  poCurve  )  [static]

Cast to linestring.

The passed in geometry is consumed and a new one returned (or NULL in case of failure)

Parameters:
poCurve the input geometry - ownership is passed to the method.
Returns:
new geometry.
Since:
GDAL 2.0

Reimplemented in OGRLinearRing, and OGRCompoundCurve.

Referenced by CastToCompoundCurve(), OGRMultiCurve::CastToMultiLineString(), OGRGeometryFactory::forceTo(), and OGRGeometryFactory::forceToLineString().

OGRLineString * OGRCurve::CurveToLine ( double  dfMaxAngleStepSizeDegrees = 0,
const char *const *  papszOptions = NULL 
) const [pure virtual]

Return a linestring from a curve geometry.

The returned geometry is a new instance whose ownership belongs to the caller.

If the dfMaxAngleStepSizeDegrees is zero, then a default value will be used. This is currently 4 degrees unless the user has overridden the value with the OGR_ARC_STEPSIZE configuration variable.

This method relates to the ISO SQL/MM Part 3 ICurve::CurveToLine() method.

This function is the same as C function OGR_G_CurveToLine().

Parameters:
dfMaxAngleStepSizeDegrees the largest step in degrees along the arc, zero to use the default setting.
papszOptions options as a null-terminated list of strings or NULL. See OGRGeometryFactory::curveToLineString() for valid options.
Returns:
a line string approximating the curve
Since:
GDAL 2.0

Implemented in OGRLineString, OGRCircularString, and OGRCompoundCurve.

Referenced by OGRCurvePolygon::CurvePolyToPoly().

void OGRCurve::EndPoint ( OGRPoint *  poPoint  )  const [pure virtual]

Return the curve end point.

This method relates to the SF COM ICurve::get_EndPoint() method.

Parameters:
poPoint the point to be assigned the end location.

Implemented in OGRSimpleCurve, and OGRCompoundCurve.

Referenced by OGRCompoundCurve::EndPoint(), and get_IsClosed().

double OGRCurve::get_Area (  )  const [pure virtual]

Get the area of the (closed) curve.

This method is designed to be used by OGRCurvePolygon::get_Area().

Returns:
the area of the feature in square units of the spatial reference system in use.
Since:
GDAL 2.0

Implemented in OGRLineString, OGRCircularString, and OGRCompoundCurve.

Referenced by OGRCurvePolygon::get_Area().

double OGRCurve::get_AreaOfCurveSegments (  )  const [protected, pure virtual]

Get the area of the purely curve portions of a (closed) curve.

This method is designed to be used on a closed convex curve.

Returns:
the area of the feature in square units of the spatial reference system in use.
Since:
GDAL 2.0

Implemented in OGRLineString, OGRCircularString, and OGRCompoundCurve.

Referenced by OGRCompoundCurve::get_AreaOfCurveSegments().

int OGRCurve::get_IsClosed (  )  const [virtual]

Return TRUE if curve is closed.

Tests if a curve is closed. A curve is closed if its start point is equal to its end point.

This method relates to the SFCOM ICurve::get_IsClosed() method.

Returns:
TRUE if closed, else FALSE.

References EndPoint(), OGRPoint::getX(), OGRPoint::getY(), and StartPoint().

Referenced by OGRLineString::CastToLinearRing(), OGRGeometryFactory::forceTo(), OGRCompoundCurve::get_Area(), and OGRCircularString::get_Area().

double OGRCurve::get_Length (  )  const [pure virtual]

Returns the length of the curve.

This method relates to the SFCOM ICurve::get_Length() method.

Returns:
the length of the curve, zero if the curve hasn't been initialized.

Implemented in OGRSimpleCurve, OGRCircularString, and OGRCompoundCurve.

Referenced by OGRCompoundCurve::get_Length(), and OGRCompoundCurve::Value().

int OGRCurve::getDimension (  )  const [virtual]

Get the dimension of this object.

This method corresponds to the SFCOM IGeometry::GetDimension() method. It indicates the dimension of the object, but does not indicate the dimension of the underlying space (as indicated by OGRGeometry::getCoordinateDimension()).

This method is the same as the C function OGR_G_GetDimension().

Returns:
0 for points, 1 for lines and 2 for surfaces.

Implements OGRGeometry.

int OGRCurve::getNumPoints (  )  const [pure virtual]

Return the number of points of a curve geometry.

This method, as a method of OGRCurve, does not relate to a standard. For circular strings or linestrings, it returns the number of points, conforming to SF COM NumPoints(). For compound curves, it returns the sum of the number of points of each of its components (non including intermediate starting/ending points of the different parts).

Returns:
the number of points of the curve.
Since:
GDAL 2.0

Implemented in OGRSimpleCurve, and OGRCompoundCurve.

Referenced by OGRGeometry::dumpReadable(), OGRGeometryFactory::forceTo(), and OGRCompoundCurve::getNumPoints().

OGRPointIterator * OGRCurve::getPointIterator (  )  const [pure virtual]

Returns a point iterator over the curve.

The curve must not be modified while an iterator exists on it.

The iterator must be destroyed with OGRPointIterator::destroy().

Returns:
a point iterator over the curve.
Since:
GDAL 2.0

Implemented in OGRSimpleCurve, and OGRCompoundCurve.

Referenced by OGRCompoundCurvePointIterator::getNextPoint(), and IsConvex().

OGRBoolean OGRCurve::IsConvex (  )  const [virtual]

Returns if a (closed) curve forms a convex shape.

Returns:
TRUE if the curve forms a convex shape.
Since:
GDAL 2.0

References OGRPointIterator::getNextPoint(), getPointIterator(), OGRPoint::getX(), OGRPoint::getY(), OGRPoint::setX(), and OGRPoint::setY().

Referenced by OGRCompoundCurve::get_Area(), and OGRCircularString::get_Area().

OGRCurve & OGRCurve::operator= ( const OGRCurve &  other  ) 

Assignment operator.

Note: before GDAL 2.1, only the default implementation of the operator existed, which could be unsafe to use.

Since:
GDAL 2.1

Reimplemented from OGRGeometry.

Reimplemented in OGRSimpleCurve, OGRLineString, OGRLinearRing, OGRCircularString, and OGRCompoundCurve.

void OGRCurve::StartPoint ( OGRPoint *  poPoint  )  const [pure virtual]

Return the curve start point.

This method relates to the SF COM ICurve::get_StartPoint() method.

Parameters:
poPoint the point to be assigned the start location.

Implemented in OGRSimpleCurve, and OGRCompoundCurve.

Referenced by get_IsClosed(), and OGRCompoundCurve::StartPoint().

void OGRCurve::Value ( double  dfDistance,
OGRPoint *  poPoint 
) const [pure virtual]

Fetch point at given distance along curve.

This method relates to the SF COM ICurve::get_Value() method.

This function is the same as the C function OGR_G_Value().

Parameters:
dfDistance distance along the curve at which to sample position. This distance should be between zero and get_Length() for this curve.
poPoint the point to be assigned the curve position.

Implemented in OGRSimpleCurve, OGRCircularString, and OGRCompoundCurve.

Referenced by OGRCompoundCurve::Value().


The documentation for this class was generated from the following files:

Generated for GDAL by doxygen 1.6.1.