GDAL
Public Member Functions
OGRCircularString Class Reference

Concrete representation of a circular string, that is to say a curve made of one or several arc circles. More...

#include <ogr_geometry.h>

Inheritance diagram for OGRCircularString:
OGRSimpleCurve OGRCurve OGRGeometry

List of all members.

Public Member Functions

 OGRCircularString ()
 Create an empty circular string.
 OGRCircularString (const OGRCircularString &other)
 Copy constructor.
OGRCircularStringoperator= (const OGRCircularString &other)
 Assignment operator.
virtual OGRErr importFromWkb (unsigned char *, int=-1, OGRwkbVariant=wkbVariantOldOgc) CPL_OVERRIDE
 Assign geometry from well known binary data.
virtual OGRErr exportToWkb (OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc) const CPL_OVERRIDE
 Convert a geometry into well known binary format.
virtual OGRErr importFromWkt (char **) CPL_OVERRIDE
 Assign geometry from well known text data.
virtual OGRErr exportToWkt (char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const CPL_OVERRIDE
 Convert a geometry into well known text format.
virtual OGRBoolean IsValid () const CPL_OVERRIDE
 Test if the geometry is valid.
virtual void getEnvelope (OGREnvelope *psEnvelope) const CPL_OVERRIDE
 Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure.
virtual void getEnvelope (OGREnvelope3D *psEnvelope) const CPL_OVERRIDE
 Computes and returns the bounding envelope (3D) for this geometry in the passed psEnvelope structure.
virtual double get_Length () const CPL_OVERRIDE
 Returns the length of the curve.
virtual OGRLineStringCurveToLine (double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=NULL) const CPL_OVERRIDE
 Return a linestring from a curve geometry.
virtual void Value (double, OGRPoint *) const CPL_OVERRIDE
 Fetch point at given distance along curve.
virtual double get_Area () const CPL_OVERRIDE
 Get the area of the (closed) curve.
virtual OGRwkbGeometryType getGeometryType () const CPL_OVERRIDE
 Fetch geometry type.
virtual const char * getGeometryName () const CPL_OVERRIDE
 Fetch WKT name for geometry type.
virtual void segmentize (double dfMaxLength) CPL_OVERRIDE
 Modify the geometry such it has no segment longer then the given distance.
virtual OGRBoolean hasCurveGeometry (int bLookForNonLinear=FALSE) const CPL_OVERRIDE
 Returns if this geometry is or has curve geometry.
virtual OGRGeometrygetLinearGeometry (double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=NULL) const CPL_OVERRIDE
 Return, possibly approximate, non-curve version of this geometry.

Detailed Description

Concrete representation of a circular string, that is to say a curve made of one or several arc circles.

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

Compatibility: ISO SQL/MM Part 3.

Since:
GDAL 2.0

Constructor & Destructor Documentation

Copy constructor.

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

Since:
GDAL 2.1

Member Function Documentation

OGRLineString * OGRCircularString::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:
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

Implements OGRCurve.

OGRErr OGRCircularString::exportToWkb ( OGRwkbByteOrder  eByteOrder,
unsigned char *  pabyData,
OGRwkbVariant  eWkbVariant = wkbVariantOldOgc 
) const [virtual]

Convert a geometry into well known binary format.

This method relates to the SFCOM IWks::ExportToWKB() method.

This method is the same as the C function OGR_G_ExportToWkb() or OGR_G_ExportToIsoWkb(), depending on the value of eWkbVariant.

Parameters:
eByteOrderOne of wkbXDR or wkbNDR indicating MSB or LSB byte order respectively.
pabyDataa buffer into which the binary representation is written. This buffer must be at least OGRGeometry::WkbSize() byte in size.
eWkbVariantWhat standard to use when exporting geometries with three dimensions (or more). The default wkbVariantOldOgc is the historical OGR variant. wkbVariantIso is the variant defined in ISO SQL/MM and adopted by OGC for SFSQL 1.2.
Returns:
Currently OGRERR_NONE is always returned.

Reimplemented from OGRSimpleCurve.

OGRErr OGRCircularString::exportToWkt ( char **  ppszDstText,
OGRwkbVariant  eWkbVariant = wkbVariantOldOgc 
) const [virtual]

Convert a geometry into well known text format.

This method relates to the SFCOM IWks::ExportToWKT() method.

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

Parameters:
ppszDstTexta text buffer is allocated by the program, and assigned to the passed pointer. After use, *ppszDstText should be freed with CPLFree().
eWkbVariantthe specification that must be conformed too :
  • wbkVariantOgc for old-style 99-402 extended dimension (Z) WKB types
  • wbkVariantIso for SFSQL 1.2 and ISO SQL/MM Part 3
Returns:
Currently OGRERR_NONE is always returned.

Reimplemented from OGRSimpleCurve.

double OGRCircularString::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 OGRCircularString::get_Length ( ) const [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.

Reimplemented from OGRSimpleCurve.

void OGRCircularString::getEnvelope ( OGREnvelope *  psEnvelope) const [virtual]

Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure.

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

Parameters:
psEnvelopethe structure in which to place the results.

Reimplemented from OGRSimpleCurve.

void OGRCircularString::getEnvelope ( OGREnvelope3D *  psEnvelope) const [virtual]

Computes and returns the bounding envelope (3D) for this geometry in the passed psEnvelope structure.

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

Parameters:
psEnvelopethe structure in which to place the results.
Since:
OGR 1.9.0

Reimplemented from OGRSimpleCurve.

const char * OGRCircularString::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.

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.

OGRGeometry * OGRCircularString::getLinearGeometry ( double  dfMaxAngleStepSizeDegrees = 0,
const char *const *  papszOptions = NULL 
) const [virtual]

Return, possibly approximate, non-curve version of this geometry.

Returns a geometry that has no CIRCULARSTRING, COMPOUNDCURVE, CURVEPOLYGON, MULTICURVE or MULTISURFACE in it, by approximating curve geometries.

The ownership of the returned geometry belongs to the caller.

The reverse method is OGRGeometry::getCurveGeometry().

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

Parameters:
dfMaxAngleStepSizeDegreesthe largest step in degrees along the arc, zero to use the default setting.
papszOptionsoptions as a null-terminated list of strings. See OGRGeometryFactory::curveToLineString() for valid options.
Returns:
a new geometry.
Since:
GDAL 2.0

Reimplemented from OGRGeometry.

OGRBoolean OGRCircularString::hasCurveGeometry ( int  bLookForNonLinear = FALSE) const [virtual]

Returns if this geometry is or has curve geometry.

Returns if a geometry is, contains or may contain a CIRCULARSTRING, COMPOUNDCURVE, CURVEPOLYGON, MULTICURVE or MULTISURFACE.

If bLookForNonLinear is set to TRUE, it will be actually looked if the geometry or its subgeometries are or contain a non-linear geometry in them. In which case, if the method returns TRUE, it means that getLinearGeometry() would return an approximate version of the geometry. Otherwise, getLinearGeometry() would do a conversion, but with just converting container type, like COMPOUNDCURVE -> LINESTRING, MULTICURVE -> MULTILINESTRING or MULTISURFACE -> MULTIPOLYGON, resulting in a "loss-less" conversion.

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

Parameters:
bLookForNonLinearset it to TRUE to check if the geometry is or contains a CIRCULARSTRING.
Returns:
TRUE if this geometry is or has curve geometry.
Since:
GDAL 2.0

Reimplemented from OGRGeometry.

OGRErr OGRCircularString::importFromWkb ( unsigned char *  pabyData,
int  nSize = -1,
OGRwkbVariant  eWkbVariant = wkbVariantOldOgc 
) [virtual]

Assign geometry from well known binary data.

The object must have already been instantiated as the correct derived type of geometry object to match the binaries type. This method is used by the OGRGeometryFactory class, but not normally called by application code.

This method relates to the SFCOM IWks::ImportFromWKB() method.

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

Parameters:
pabyDatathe binary input data.
nSizethe size of pabyData in bytes, or zero if not known.
eWkbVariantif wkbVariantPostGIS1, special interpretation is done for curve geometries code
Returns:
OGRERR_NONE if all goes well, otherwise any of OGRERR_NOT_ENOUGH_DATA, OGRERR_UNSUPPORTED_GEOMETRY_TYPE, or OGRERR_CORRUPT_DATA may be returned.

Reimplemented from OGRSimpleCurve.

OGRErr OGRCircularString::importFromWkt ( char **  ppszInput) [virtual]

Assign geometry from well known text data.

The object must have already been instantiated as the correct derived type of geometry object to match the text type. This method is used by the OGRGeometryFactory class, but not normally called by application code.

This method relates to the SFCOM IWks::ImportFromWKT() method.

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

Parameters:
ppszInputpointer to a pointer to the source text. The pointer is updated to pointer after the consumed text.
Returns:
OGRERR_NONE if all goes well, otherwise any of OGRERR_NOT_ENOUGH_DATA, OGRERR_UNSUPPORTED_GEOMETRY_TYPE, or OGRERR_CORRUPT_DATA may be returned.

Reimplemented from OGRSimpleCurve.

Test if the geometry is valid.

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

This method is built on the GEOS library, check it for the definition of the geometry operation. If OGR is built without the GEOS library, this method will always return FALSE.

Returns:
TRUE if the geometry has no points, otherwise FALSE.

Reimplemented from OGRGeometry.

OGRCircularString & OGRCircularString::operator= ( const OGRCircularString 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
void OGRCircularString::segmentize ( double  dfMaxLength) [virtual]

Modify the geometry such it has no segment longer then the given distance.

Add intermediate vertices to a geometry.

Interpolated points will have Z and M values (if needed) set to 0. Distance computation is performed in 2d only

This function is the same as the C function OGR_G_Segmentize()

Parameters:
dfMaxLengththe maximum distance between 2 points after segmentization

This method modifies the geometry to add intermediate vertices if necessary so that the maximum length between 2 consecutive vertices is lower than dfMaxLength.

Parameters:
dfMaxLengthmaximum length between 2 consecutive vertices.

Reimplemented from OGRSimpleCurve.

void OGRCircularString::Value ( double  dfDistance,
OGRPoint poPoint 
) const [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.

Reimplemented from OGRSimpleCurve.


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

Generated for GDAL by doxygen 1.7.6.1.