GDAL
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends
OGRCurve Class Reference

Abstract curve base class for OGRLineString, OGRCircularString and OGRCompoundCurve. More...

#include <ogr_geometry.h>

Inheritance diagram for OGRCurve:
OGRGeometry OGRCompoundCurve OGRSimpleCurve OGRCircularString OGRLineString OGRLinearRing

List of all members.

Public Member Functions

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 OGRLineStringCurveToLine (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 OGRPointIteratorgetPointIterator () 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 OGRCompoundCurveCastToCompoundCurve (OGRCurve *puCurve)
 Cast to compound curve.
static OGRLineStringCastToLineString (OGRCurve *poCurve)
 Cast to linestring.
static OGRLinearRingCastToLinearRing (OGRCurve *poCurve)
 Cast to linear ring.

Protected Member Functions

virtual OGRCurveCasterToLineString GetCasterToLineString () const =0
virtual OGRCurveCasterToLinearRing GetCasterToLinearRing () const =0
virtual int ContainsPoint (const OGRPoint *p) const
 Returns if a point is contained in a (closed) curve.
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

Cast to compound curve.

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

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

Cast to linear ring.

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

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

Cast to linestring.

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

Parameters:
poCurvethe input geometry - ownership is passed to the method.
Returns:
new geometry.
Since:
GDAL 2.0
int OGRCurve::ContainsPoint ( const OGRPoint p) const [protected, virtual]

Returns if a point is contained in a (closed) curve.

Final users should use OGRGeometry::Contains() instead.

Parameters:
pthe point to test
Returns:
TRUE if it is inside the curve, FALSE otherwise or -1 if unknown.
Since:
GDAL 2.0

Reimplemented in OGRCircularString.

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:
dfMaxAngleStepSizeDegreesthe largest step in degrees along the arc, zero to use the default setting.
papszOptionsoptions 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 OGRCompoundCurve, OGRCircularString, and OGRLineString.

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:
poPointthe point to be assigned the end location.

Implemented in OGRCompoundCurve, and OGRSimpleCurve.

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 OGRCompoundCurve, OGRCircularString, and OGRLineString.

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 OGRCompoundCurve, OGRCircularString, and OGRLineString.

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.
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 OGRCompoundCurve, OGRCircularString, and OGRSimpleCurve.

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 OGRCompoundCurve, and OGRSimpleCurve.

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 OGRCompoundCurve, and OGRSimpleCurve.

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
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:
poPointthe point to be assigned the start location.

Implemented in OGRCompoundCurve, and OGRSimpleCurve.

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:
dfDistancedistance along the curve at which to sample position. This distance should be between zero and get_Length() for this curve.
poPointthe point to be assigned the curve position.

Implemented in OGRCompoundCurve, OGRCircularString, and OGRSimpleCurve.


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

Generated for GDAL by doxygen 1.7.6.1.