Public Member Functions | Protected Member Functions | Static Protected Member Functions

# OGRLineString Class Reference

Concrete representation of a multi-vertex line. More...

`#include <ogr_geometry.h>`

Inheritance diagram for OGRLineString:

List of all members.

## Public Member Functions
| OGRLineString ()
| Create an empty line string.
virtual OGRLineString * | CurveToLine (double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=NULL) const
| Return a linestring from a curve geometry.
virtual OGRGeometry * | getCurveGeometry (const char *const *papszOptions=NULL) const
virtual double | get_Area () const
| Get the area of the (closed) curve.
virtual OGRwkbGeometryType | getGeometryType () const
| Fetch geometry type.
virtual const char * | getGeometryName () const
| Fetch WKT name for geometry type.
## Protected Member Functions
virtual OGRCurveCasterToLineString | GetCasterToLineString () const
virtual OGRCurveCasterToLinearRing | GetCasterToLinearRing () const
virtual double | get_AreaOfCurveSegments () const
| Get the area of the purely curve portions of a (closed) curve.
## Static Protected Member Functions
static OGRLineString * | TransferMembersAndDestroy (OGRLineString *poSrc, OGRLineString *poDst)
static OGRLinearRing * | CastToLinearRing (OGRLineString *poLS)
| Cast to linear ring.

## Detailed Description

Concrete representation of a multi-vertex line.

Note: for implementation convenience, we make it inherit from OGRSimpleCurve whereas SFSQL and SQL/MM only make it inherits from OGRCurve.

## Member Function Documentation

OGRLinearRing * OGRLineString::CastToLinearRing | ( | OGRLineString * | poLS | ) | `[static, protected]`

Cast to linear ring.

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

Parameters:

  | poLS | the input geometry - ownership is passed to the method.

Returns:
  new geometry.

virtual OGRLineString* OGRLineString::CurveToLine | ( | double | dfMaxAngleStepSizeDegrees = `0`,
|  | const char *const * | papszOptions = `NULL` |
| ) |  |  | const`[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

Implements OGRCurve.

double OGRLineString::get_Area | ( |  | ) | const`[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

Implements OGRCurve.

double OGRLineString::get_AreaOfCurveSegments | ( |  | ) | const`[protected, 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

Implements OGRCurve.

const char * OGRLineString::getGeometryName | ( |  | ) | const`[virtual]`

Fetch WKT name for geometry type.

There is no SFCOM analog to this method.

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

Returns:
  name used for this geometry type in well known text format. The returned pointer is to a static internal string and should not be modified or freed.

Implements OGRGeometry.

Reimplemented in OGRLinearRing.

OGRwkbGeometryType OGRLineString::getGeometryType | ( |  | ) | const`[virtual]`

Fetch geometry type.

Note that the geometry type may include the 2.5D flag. To get a 2D flattened version of the geometry type apply the wkbFlatten() macro to the return result.

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

Returns:
  the geometry type code.

Implements OGRGeometry.

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

- ogr_geometry.h
- ogrlinestring.cpp

Generated for GDAL by 1.7.1.