GDAL
|
Concrete representation of a circular string, that is to say a curve made of one or several arc circles. More...
#include <ogr_geometry.h>
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 OGRLineString * | CurveToLine (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) |
Modify the geometry such it has no segment longer then the given distance. | |
virtual OGRBoolean | hasCurveGeometry (int bLookForNonLinear=FALSE) const |
Returns if this geometry is or has curve geometry. | |
virtual OGRGeometry * | getLinearGeometry (double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=NULL) const |
Return, possibly approximate, non-curve version of this geometry. | |
Protected Member Functions | |
virtual OGRCurveCasterToLineString | GetCasterToLineString () const |
virtual OGRCurveCasterToLinearRing | GetCasterToLinearRing () const |
virtual int | ContainsPoint (const OGRPoint *p) const |
Returns if a point is contained in a (closed) curve. | |
virtual double | get_AreaOfCurveSegments () const |
Get the area of the purely curve portions of a (closed) curve. |
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.
int OGRCircularString::ContainsPoint | ( | const OGRPoint * | p | ) | const [protected, virtual] |
Returns if a point is contained in a (closed) curve.
Final users should use OGRGeometry::Contains() instead.
p | the point to test |
Reimplemented from OGRCurve.
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().
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. |
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.
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. |
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().
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 :
|
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().
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.
Implements OGRCurve.
double OGRCircularString::get_Length | ( | ) | const [virtual] |
Returns the length of the curve.
This method relates to the SFCOM ICurve::get_Length() method.
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().
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().
psEnvelope | the structure in which to place the results. |
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().
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().
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().
dfMaxAngleStepSizeDegrees | the largest step in degrees along the arc, zero to use the default setting. |
papszOptions | options as a null-terminated list of strings. See OGRGeometryFactory::curveToLineString() for valid options. |
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().
bLookForNonLinear | set it to TRUE to check if the geometry is or contains a CIRCULARSTRING. |
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().
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 |
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().
ppszInput | pointer to a pointer to the source text. The pointer is updated to pointer after the consumed text. |
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.
Reimplemented from OGRGeometry.
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()
dfMaxLength | the 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 consecutives vertices is lower than dfMaxLength.
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().
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.