Public Member Functions | Protected 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.
virtual OGRErr importFromWkb (unsigned char *, int=-1, OGRwkbVariant=wkbVariantOldOgc)
 Assign geometry from well known binary data.
virtual OGRErr exportToWkb (OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc) const
 Convert a geometry into well known binary format.
virtual OGRErr importFromWkt (char **)
 Assign geometry from well known text data.
virtual OGRErr exportToWkt (char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const
 Convert a geometry into well known text format.
virtual OGRBoolean IsValid () const
 Test if the geometry is valid.
virtual void getEnvelope (OGREnvelope *psEnvelope) const
 Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure.
virtual void getEnvelope (OGREnvelope3D *psEnvelope) const
 Computes and returns the bounding envelope (3D) for this geometry in the passed psEnvelope structure.
virtual double get_Length () const
 Returns the length of the curve.
virtual OGRLineStringCurveToLine (double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=NULL) const
 Return a linestring from a curve geometry.
virtual void Value (double, OGRPoint *) const
 Fetch point at given distance along curve.
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.
virtual void segmentize (double dfMaxLength)
 Add intermediate vertices to a geometry.
virtual OGRBoolean hasCurveGeometry (int bLookForNonLinear=FALSE) const
virtual OGRGeometrygetLinearGeometry (double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=NULL) const

Protected Member Functions

virtual OGRCurveCasterToLineString GetCasterToLineString () const
virtual OGRCurveCasterToLinearRing GetCasterToLinearRing () const
virtual int ContainsPoint (const OGRPoint *p) const
virtual double get_AreaOfCurveSegments () const
 Get the area of the purely curve portions of a (closed) curve.

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

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:
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.

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:
eByteOrder One of wkbXDR or wkbNDR indicating MSB or LSB byte order respectively.
pabyData a buffer into which the binary representation is written. This buffer must be at least OGRGeometry::WkbSize() byte in size.
eWkbVariant What 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.

virtual 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:
ppszDstText a text buffer is allocated by the program, and assigned to the passed pointer. After use, *ppszDstText should be freed with OGRFree().
eWkbVariant the 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_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.

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:
psEnvelope the 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:
psEnvelope the 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.

OGRwkbGeometryType OGRCircularString::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.

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:
pabyData the binary input data.
nSize the size of pabyData in bytes, or zero if not known.
eWkbVariant if 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:
ppszInput pointer 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.

OGRBoolean OGRCircularString::IsValid (  )  const [virtual]

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.

void OGRCircularString::segmentize ( double  dfMaxLength  )  [virtual]

Add intermediate vertices to a geometry.

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

Parameters:
dfMaxLength maximum length between 2 consecutives 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:
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.

Reimplemented from OGRSimpleCurve.


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

Generated for GDAL by doxygen 1.7.1.