GDAL
|
Concrete representation of a closed ring. More...
#include <ogr_geometry.h>
Public Member Functions | |
OGRLinearRing (OGRLinearRing *) | |
virtual const char * | getGeometryName () const |
Fetch WKT name for geometry type. | |
virtual OGRGeometry * | clone () const |
Make a copy of this object. | |
virtual int | isClockwise () const |
Returns TRUE if the ring has clockwise winding (or less than 2 points) | |
virtual void | reverseWindingOrder () |
virtual void | closeRings () |
Force rings to be closed. | |
OGRBoolean | isPointInRing (const OGRPoint *pt, int bTestEnvelope=TRUE) const |
OGRBoolean | isPointOnRingBoundary (const OGRPoint *pt, int bTestEnvelope=TRUE) const |
virtual int | WkbSize () const |
Returns size of related binary representation. | |
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. | |
Protected Member Functions | |
virtual int | _WkbSize (int b3D) const |
virtual OGRErr | _importFromWkb (OGRwkbByteOrder, int b3D, unsigned char *, int=-1) |
virtual OGRErr | _exportToWkb (OGRwkbByteOrder, int b3D, unsigned char *) const |
virtual OGRCurveCasterToLineString | GetCasterToLineString () const |
virtual OGRCurveCasterToLinearRing | GetCasterToLinearRing () const |
Static Protected Member Functions | |
static OGRLineString * | CastToLineString (OGRLinearRing *poLR) |
Cast to line string. | |
Friends | |
class | OGRPolygon |
Concrete representation of a closed ring.
This class is functionally equivelent to an OGRLineString, but has a separate identity to maintain alignment with the OpenGIS simple feature data model. It exists to serve as a component of an OGRPolygon.
The OGRLinearRing has no corresponding free standing well known binary representation, so importFromWkb() and exportToWkb() will not actually work. There is a non-standard GDAL WKT representation though.
Because OGRLinearRing is not a "proper" free standing simple features object, it cannot be directly used on a feature via SetGeometry(), and cannot genearally be used with GEOS for operations like Intersects(). Instead the polygon should be used, or the OGRLinearRing should be converted to an OGRLineString for such operations.
Note: this class exists in SFSQL 1.2, but not in ISO SQL/MM Part 3.
OGRLineString * OGRLinearRing::CastToLineString | ( | OGRLinearRing * | poLR | ) | [static, protected] |
Cast to line string.
The passed in geometry is consumed and a new one returned .
poLR | the input geometry - ownership is passed to the method. |
OGRGeometry * OGRLinearRing::clone | ( | ) | const [virtual] |
Make a copy of this object.
This method relates to the SFCOM IGeometry::clone() method.
This method is the same as the C function OGR_G_Clone().
Reimplemented from OGRSimpleCurve.
void OGRLinearRing::closeRings | ( | ) | [virtual] |
Force rings to be closed.
If this geometry, or any contained geometries has polygon rings that are not closed, they will be closed by adding the starting point at the end.
Reimplemented from OGRGeometry.
OGRErr OGRLinearRing::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.
const char * OGRLinearRing::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().
Reimplemented from OGRLineString.
OGRErr OGRLinearRing::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.
int OGRLinearRing::isClockwise | ( | ) | const [virtual] |
Returns TRUE if the ring has clockwise winding (or less than 2 points)
int OGRLinearRing::WkbSize | ( | ) | const [virtual] |
Returns size of related binary representation.
This method returns the exact number of bytes required to hold the well known binary representation of this geometry object. Its computation may be slightly expensive for complex geometries.
This method relates to the SFCOM IWks::WkbSize() method.
This method is the same as the C function OGR_G_WkbSize().
Reimplemented from OGRSimpleCurve.