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:

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 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 OGRCurveCasterToLineString | GetCasterToLineString () const =0
virtual OGRCurveCasterToLinearRing | GetCasterToLinearRing () const =0
virtual int | ContainsPoint (const OGRPoint *p) const
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

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

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

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.

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.

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.

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.

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

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.

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.

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:

  | poPoint | the point to be assigned the start location.

Implemented in OGRSimpleCurve, and OGRCompoundCurve.

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.

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

- ogr_geometry.h
- ogrcurve.cpp

Generated for GDAL by 1.7.1.