16#ifndef OGR_GEOMETRY_H_INCLUDED
17#define OGR_GEOMETRY_H_INCLUDED
22#include "ogr_geomcoordinateprecision.h"
36#ifndef DEFINEH_OGRGeometryH
37#define DEFINEH_OGRGeometryH
67 bool round = getDefaultRound();
73 : xyPrecision(getDefaultPrecision()), zPrecision(xyPrecision),
74 mPrecision(zPrecision)
82 static int getDefaultPrecision();
83 static bool getDefaultRound();
308 int nXYBitPrecision =
367 friend class OGRCurveCollection;
369 unsigned int flags = 0;
371 OGRErr importPreambleFromWkt(
const char **ppszInput,
int *pbHasZ,
372 int *pbHasM,
bool *pbIsEmpty);
373 OGRErr importCurveCollectionFromWkt(
374 const char **ppszInput,
int bAllowEmptyComponent,
int bAllowLineString,
375 int bAllowCurve,
int bAllowCompoundCurve,
377 OGRErr importPreambleFromWkb(
const unsigned char *pabyData,
size_t nSize,
380 OGRErr importPreambleOfCollectionFromWkb(
const unsigned char *pabyData,
381 size_t &nSize,
size_t &nDataOffset,
383 size_t nMinSubGeomSize,
389 void HomogenizeDimensionalityWith(
OGRGeometry *poOtherGeom);
403 static const unsigned int OGR_G_NOT_EMPTY_POINT = 0x1;
404 static const unsigned int OGR_G_3D = 0x2;
405 static const unsigned int OGR_G_MEASURED = 0x4;
417 return CPL_TO_BOOL(Equals(&other));
423 return !CPL_TO_BOOL(Equals(&other));
428 virtual int getCoordinateDimension()
const;
429 int CoordinateDimension()
const;
439 return (flags & OGR_G_3D) != 0;
445 return (flags & OGR_G_MEASURED) != 0;
455 virtual
size_t WkbSize() const = 0;
456 OGRErr importFromWkb(const
GByte *,
size_t = static_cast<
size_t>(-1),
459 size_t &nBytesConsumedOut) = 0;
462 virtual
OGRErr exportToWkb(
unsigned char *,
464 virtual
OGRErr importFromWkt(const
char **ppszInput) = 0;
472 CPL_WARN_DEPRECATED(
"Use importFromWkt(const char**) instead")
475 return importFromWkt(
const_cast<const char **
>(ppszInput));
479 OGRErr exportToWkt(
char **ppszDstText,
487 OGRErr *err =
nullptr)
const = 0;
493 void dumpReadable(FILE *,
const char * =
nullptr,
495 std::string dumpReadable(
const char * =
nullptr,
498 virtual char *exportToGML(
const char *
const *papszOptions =
nullptr)
const;
499 virtual char *exportToKML()
const;
500 virtual char *exportToJson(
CSLConstList papszOptions =
nullptr)
const;
513 virtual
OGRBoolean hasCurveGeometry(
int bLookForNonLinear = FALSE) const;
517 double dfMaxAngleStepSizeDegrees = 0,
529 virtual
void closeRings();
531 virtual
bool setCoordinateDimension(
int nDimension);
533 virtual
bool setMeasured(
OGRBoolean bIsMeasured);
545 virtual bool segmentize(
double dfMaxLength);
562 virtual
double Distance(const
OGRGeometry *) const;
569 BufferEx(
double dfDistance,
587 DelaunayTriangulation(
double dfTolerance,
592 virtual
double Distance3D(const
OGRGeometry *poOtherGeom) const;
594 OGRGeometry *SetPrecision(
double dfGridSize,
int nFlags) const;
596 virtual
bool hasEmptyParts() const;
597 virtual
void removeEmptyParts();
602 CPL_WARN_DEPRECATED("Non standard method. "
603 "Use Intersects() instead");
605 CPL_WARN_DEPRECATED("Non standard method. "
606 "Use Equals() instead");
608 CPL_WARN_DEPRECATED("Non standard method. "
609 "Use SymDifference() instead");
611 CPL_WARN_DEPRECATED("Non standard method. "
612 "Use Boundary() instead");
617 static
int bGenerate_DB2_V72_BYTE_ORDER;
620 virtual
void swapXY();
622 bool IsRectangle() const;
656 return cpl::down_cast<OGRPoint *>(
this);
665 return cpl::down_cast<const OGRPoint *>(
this);
675 return cpl::down_cast<OGRCurve *>(
this);
685 return cpl::down_cast<const OGRCurve *>(
this);
695 return cpl::down_cast<OGRSimpleCurve *>(
this);
705 return cpl::down_cast<const OGRSimpleCurve *>(
this);
715 return cpl::down_cast<OGRLineString *>(
this);
725 return cpl::down_cast<const OGRLineString *>(
this);
734 return cpl::down_cast<OGRLinearRing *>(
this);
743 return cpl::down_cast<const OGRLinearRing *>(
this);
753 return cpl::down_cast<OGRCircularString *>(
this);
763 return cpl::down_cast<const OGRCircularString *>(
this);
773 return cpl::down_cast<OGRCompoundCurve *>(
this);
783 return cpl::down_cast<const OGRCompoundCurve *>(
this);
793 return cpl::down_cast<OGRSurface *>(
this);
803 return cpl::down_cast<const OGRSurface *>(
this);
813 return cpl::down_cast<OGRPolygon *>(
this);
823 return cpl::down_cast<const OGRPolygon *>(
this);
832 return cpl::down_cast<OGRTriangle *>(
this);
841 return cpl::down_cast<const OGRTriangle *>(
this);
851 return cpl::down_cast<OGRCurvePolygon *>(
this);
861 return cpl::down_cast<const OGRCurvePolygon *>(
this);
871 return cpl::down_cast<OGRGeometryCollection *>(
this);
881 return cpl::down_cast<const OGRGeometryCollection *>(
this);
891 return cpl::down_cast<OGRMultiPoint *>(
this);
901 return cpl::down_cast<const OGRMultiPoint *>(
this);
911 return cpl::down_cast<OGRMultiLineString *>(
this);
921 return cpl::down_cast<const OGRMultiLineString *>(
this);
931 return cpl::down_cast<OGRMultiPolygon *>(
this);
941 return cpl::down_cast<const OGRMultiPolygon *>(
this);
951 return cpl::down_cast<OGRMultiCurve *>(
this);
961 return cpl::down_cast<const OGRMultiCurve *>(
this);
971 return cpl::down_cast<OGRMultiSurface *>(
this);
981 return cpl::down_cast<const OGRMultiSurface *>(
this);
991 return cpl::down_cast<OGRPolyhedralSurface *>(
this);
1001 return cpl::down_cast<const OGRPolyhedralSurface *>(
this);
1010 return cpl::down_cast<OGRTriangulatedSurface *>(
this);
1019 return cpl::down_cast<const OGRTriangulatedSurface *>(
this);
1024struct CPL_DLL OGRGeometryUniquePtrDeleter
1034typedef std::unique_ptr<OGRGeometry, OGRGeometryUniquePtrDeleter>
1038#define OGR_FORBID_DOWNCAST_TO(name) \
1039 inline OGR##name *to##name() = delete; \
1040 inline const OGR##name *to##name() const = delete;
1042#define OGR_FORBID_DOWNCAST_TO_POINT OGR_FORBID_DOWNCAST_TO(Point)
1043#define OGR_FORBID_DOWNCAST_TO_CURVE OGR_FORBID_DOWNCAST_TO(Curve)
1044#define OGR_FORBID_DOWNCAST_TO_SIMPLE_CURVE OGR_FORBID_DOWNCAST_TO(SimpleCurve)
1045#define OGR_FORBID_DOWNCAST_TO_LINESTRING OGR_FORBID_DOWNCAST_TO(LineString)
1046#define OGR_FORBID_DOWNCAST_TO_LINEARRING OGR_FORBID_DOWNCAST_TO(LinearRing)
1047#define OGR_FORBID_DOWNCAST_TO_CIRCULARSTRING \
1048 OGR_FORBID_DOWNCAST_TO(CircularString)
1049#define OGR_FORBID_DOWNCAST_TO_COMPOUNDCURVE \
1050 OGR_FORBID_DOWNCAST_TO(CompoundCurve)
1051#define OGR_FORBID_DOWNCAST_TO_SURFACE OGR_FORBID_DOWNCAST_TO(Surface)
1052#define OGR_FORBID_DOWNCAST_TO_CURVEPOLYGON OGR_FORBID_DOWNCAST_TO(CurvePolygon)
1053#define OGR_FORBID_DOWNCAST_TO_POLYGON OGR_FORBID_DOWNCAST_TO(Polygon)
1054#define OGR_FORBID_DOWNCAST_TO_TRIANGLE OGR_FORBID_DOWNCAST_TO(Triangle)
1055#define OGR_FORBID_DOWNCAST_TO_MULTIPOINT OGR_FORBID_DOWNCAST_TO(MultiPoint)
1056#define OGR_FORBID_DOWNCAST_TO_MULTICURVE OGR_FORBID_DOWNCAST_TO(MultiCurve)
1057#define OGR_FORBID_DOWNCAST_TO_MULTILINESTRING \
1058 OGR_FORBID_DOWNCAST_TO(MultiLineString)
1059#define OGR_FORBID_DOWNCAST_TO_MULTISURFACE OGR_FORBID_DOWNCAST_TO(MultiSurface)
1060#define OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON OGR_FORBID_DOWNCAST_TO(MultiPolygon)
1061#define OGR_FORBID_DOWNCAST_TO_GEOMETRYCOLLECTION \
1062 OGR_FORBID_DOWNCAST_TO(GeometryCollection)
1063#define OGR_FORBID_DOWNCAST_TO_POLYHEDRALSURFACE \
1064 OGR_FORBID_DOWNCAST_TO(PolyhedralSurface)
1065#define OGR_FORBID_DOWNCAST_TO_TIN OGR_FORBID_DOWNCAST_TO(TriangulatedSurface)
1067#define OGR_ALLOW_UPCAST_TO(name) \
1068 inline OGR##name *to##name() \
1072 inline const OGR##name *to##name() const \
1077#ifndef SUPPRESS_OGR_ALLOW_CAST_TO_THIS_WARNING
1078#define CAST_TO_THIS_WARNING CPL_WARN_DEPRECATED("Casting to this is useless")
1080#define CAST_TO_THIS_WARNING
1083#define OGR_ALLOW_CAST_TO_THIS(name) \
1084 inline OGR##name *to##name() CAST_TO_THIS_WARNING \
1088 inline const OGR##name *to##name() const CAST_TO_THIS_WARNING \
1093#define OGR_FORBID_DOWNCAST_TO_ALL_CURVES \
1094 OGR_FORBID_DOWNCAST_TO_CURVE \
1095 OGR_FORBID_DOWNCAST_TO_SIMPLE_CURVE \
1096 OGR_FORBID_DOWNCAST_TO_LINESTRING \
1097 OGR_FORBID_DOWNCAST_TO_LINEARRING \
1098 OGR_FORBID_DOWNCAST_TO_CIRCULARSTRING \
1099 OGR_FORBID_DOWNCAST_TO_COMPOUNDCURVE
1101#define OGR_FORBID_DOWNCAST_TO_ALL_SURFACES \
1102 OGR_FORBID_DOWNCAST_TO_SURFACE \
1103 OGR_FORBID_DOWNCAST_TO_CURVEPOLYGON \
1104 OGR_FORBID_DOWNCAST_TO_POLYGON \
1105 OGR_FORBID_DOWNCAST_TO_TRIANGLE \
1106 OGR_FORBID_DOWNCAST_TO_POLYHEDRALSURFACE \
1107 OGR_FORBID_DOWNCAST_TO_TIN
1109#define OGR_FORBID_DOWNCAST_TO_ALL_SINGLES \
1110 OGR_FORBID_DOWNCAST_TO_POINT \
1111 OGR_FORBID_DOWNCAST_TO_ALL_CURVES \
1112 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1114#define OGR_FORBID_DOWNCAST_TO_ALL_MULTI \
1115 OGR_FORBID_DOWNCAST_TO_GEOMETRYCOLLECTION \
1116 OGR_FORBID_DOWNCAST_TO_MULTIPOINT \
1117 OGR_FORBID_DOWNCAST_TO_MULTICURVE \
1118 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING \
1119 OGR_FORBID_DOWNCAST_TO_MULTISURFACE \
1120 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
1144 OGRPoint(
double x,
double y,
double z);
1145 OGRPoint(
double x,
double y,
double z,
double m);
1147 static OGRPoint *createXYM(
double x,
double y,
double m);
1152 size_t WkbSize()
const override;
1154 size_t &nBytesConsumedOut)
override;
1155 OGRErr exportToWkb(
unsigned char *,
1162 OGRErr importFromWkt(
const char **)
override;
1173 OGRErr *err =
nullptr)
const override;
1176 virtual int getDimension()
const override;
1177 virtual OGRPoint *clone()
const override;
1178 virtual void empty()
override;
1179 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
1180 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
1184 return !(flags & OGR_G_NOT_EMPTY_POINT);
1213 virtual bool setCoordinateDimension(
int nDimension)
override;
1221 if (std::isnan(x) || std::isnan(y))
1222 flags &= ~OGR_G_NOT_EMPTY_POINT;
1224 flags |= OGR_G_NOT_EMPTY_POINT;
1233 if (std::isnan(x) || std::isnan(y))
1234 flags &= ~OGR_G_NOT_EMPTY_POINT;
1236 flags |= OGR_G_NOT_EMPTY_POINT;
1254 flags |= OGR_G_MEASURED;
1263 virtual const char *getGeometryName()
const override;
1266 virtual void flattenTo2D()
override;
1270 visitor->
visit(
this);
1275 visitor->
visit(
this);
1278 virtual void swapXY()
override;
1280 OGR_ALLOW_CAST_TO_THIS(Point)
1281 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
1282 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1283 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
1321 virtual OGRCurveCasterToLineString GetCasterToLineString()
const = 0;
1322 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const = 0;
1327 virtual int ContainsPoint(
const OGRPoint *p)
const;
1328 virtual int IntersectsPoint(
const OGRPoint *p)
const;
1332 class CPL_DLL ConstIterator
1335 std::unique_ptr<Private> m_poPrivate;
1338 ConstIterator(
const OGRCurve *poSelf,
bool bStart);
1339 ConstIterator(ConstIterator &&oOther)
noexcept;
1340 ConstIterator &operator=(ConstIterator &&oOther);
1343 ConstIterator &operator++();
1344 bool operator!=(
const ConstIterator &it)
const;
1348 friend inline ConstIterator
end(
const OGRCurve *);
1366 ConstIterator
begin()
const;
1368 ConstIterator
end()
const;
1377 virtual int get_IsClosed()
const;
1381 const char *
const *papszOptions =
nullptr)
const = 0;
1382 virtual int getDimension()
const override;
1393 virtual int isClockwise()
const;
1401 return cpl::down_cast<OGRSimpleCurve *>(
this);
1409 return cpl::down_cast<const OGRSimpleCurve *>(
this);
1416 OGR_FORBID_DOWNCAST_TO_POINT
1417 OGR_ALLOW_CAST_TO_THIS(Curve)
1418 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1419 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
1424inline OGRCurve::ConstIterator
begin(
const OGRCurve *poCurve)
1426 return poCurve->begin();
1430inline OGRCurve::ConstIterator
end(
const OGRCurve *poCurve)
1432 return poCurve->end();
1478 void setX(
double xIn);
1482 void setY(
double yIn);
1486 void setZ(
double zIn);
1490 void setM(
double mIn);
1512 int nPointCount = 0;
1513 int m_nPointCapacity = 0;
1515 double *padfZ =
nullptr;
1516 double *padfM =
nullptr;
1523 OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
int bHasM,
1528 virtual double get_LinearArea()
const;
1536 class CPL_DLL Iterator
1539 std::unique_ptr<Private> m_poPrivate;
1544 Iterator(Iterator &&oOther)
noexcept;
1548 Iterator &operator++();
1549 bool operator!=(
const Iterator &it)
const;
1555 class CPL_DLL ConstIterator
1558 std::unique_ptr<Private> m_poPrivate;
1563 ConstIterator &&oOther)
noexcept;
1567 ConstIterator &operator++();
1568 bool operator!=(
const ConstIterator &it)
const;
1601 ConstIterator
begin()
const;
1603 ConstIterator
end()
const;
1606 virtual size_t WkbSize()
const override;
1608 size_t &nBytesConsumedOut)
override;
1610 exportToWkb(
unsigned char *,
1617 OGRErr importFromWkt(
const char **)
override;
1628 OGRErr *err =
nullptr)
const override;
1631 virtual void empty()
override;
1632 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
1633 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
1638 virtual double get_Length()
const override;
1639 virtual void StartPoint(
OGRPoint *)
const override;
1640 virtual void EndPoint(
OGRPoint *)
const override;
1641 virtual void Value(
double,
OGRPoint *)
const override;
1642 virtual double Project(
const OGRPoint *)
const;
1643 virtual OGRLineString *getSubLine(
double,
double,
int)
const;
1651 void getPoint(
int,
OGRPoint *)
const;
1655 return paoPoints[i].
x;
1660 return paoPoints[i].
y;
1663 double getZ(
int i)
const;
1664 double getM(
int i)
const;
1670 virtual bool setCoordinateDimension(
int nDimension)
override;
1671 virtual bool set3D(
OGRBoolean bIs3D)
override;
1672 virtual bool setMeasured(
OGRBoolean bIsMeasured)
override;
1673 bool setNumPoints(
int nNewPointCount,
int bZeroizeNewContent = TRUE);
1675 bool setPoint(
int,
double,
double);
1676 bool setZ(
int,
double);
1677 bool setM(
int,
double);
1678 bool setPoint(
int,
double,
double,
double);
1679 bool setPointM(
int,
double,
double,
double);
1680 bool setPoint(
int,
double,
double,
double,
double);
1681 bool setPoints(
int,
const OGRRawPoint *,
const double * =
nullptr);
1682 bool setPointsM(
int,
const OGRRawPoint *,
const double *);
1683 bool setPoints(
int,
const OGRRawPoint *,
const double *,
const double *);
1684 bool setPoints(
int,
const double *padfX,
const double *padfY,
1685 const double *padfZIn =
nullptr);
1686 bool setPointsM(
int,
const double *padfX,
const double *padfY,
1687 const double *padfMIn =
nullptr);
1688 bool setPoints(
int,
const double *padfX,
const double *padfY,
1689 const double *padfZIn,
const double *padfMIn);
1691 bool addPoint(
double,
double);
1692 bool addPoint(
double,
double,
double);
1693 bool addPointM(
double,
double,
double);
1694 bool addPoint(
double,
double,
double,
double);
1696 bool removePoint(
int);
1698 void getPoints(
OGRRawPoint *,
double * =
nullptr)
const;
1699 void getPoints(
void *pabyX,
int nXStride,
void *pabyY,
int nYStride,
1700 void *pabyZ =
nullptr,
int nZStride = 0,
1701 void *pabyM =
nullptr,
int nMStride = 0)
const;
1703 void addSubLineString(
const OGRLineString *,
int nStartVertex = 0,
1704 int nEndVertex = -1);
1705 void reversePoints()
override;
1710 virtual void flattenTo2D()
override;
1711 virtual bool segmentize(
double dfMaxLength)
override;
1713 virtual void swapXY()
override;
1715 OGR_ALLOW_UPCAST_TO(Curve)
1716 OGR_ALLOW_CAST_TO_THIS(SimpleCurve)
1723 return poCurve->begin();
1729 return poCurve->end();
1735 return poCurve->begin();
1741 return poCurve->end();
1767 virtual OGRCurveCasterToLineString GetCasterToLineString()
const override;
1768 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1770 virtual double get_AreaOfCurveSegments()
const override;
1784 CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
1785 const char *
const *papszOptions =
nullptr)
const override;
1787 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
1796 virtual const char *getGeometryName()
const override;
1813 visitor->
visit(
this);
1818 visitor->
visit(
this);
1821 OGR_ALLOW_UPCAST_TO(SimpleCurve)
1822 OGR_ALLOW_CAST_TO_THIS(LineString)
1856 virtual size_t WkbSize()
const override;
1858 size_t &nBytesConsumedOut)
override;
1859 OGRErr exportToWkb(
unsigned char *,
1868 virtual size_t _WkbSize(
int _flags)
const;
1870 const unsigned char *,
size_t,
1871 size_t &nBytesConsumedOut);
1872 virtual OGRErr _exportToWkb(
int _flags,
unsigned char *,
1875 virtual OGRCurveCasterToLineString GetCasterToLineString()
const override;
1876 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1890 virtual const char *getGeometryName()
const override;
1894 void reverseWindingOrder()
1895 CPL_WARN_DEPRECATED("Use reversePoints() instead");
1898 virtual
void closeRings() override;
1900 int bTestEnvelope = TRUE) const;
1902 int bTestEnvelope = TRUE) const;
1919 visitor->
visit(
this);
1924 visitor->
visit(
this);
1927 OGR_ALLOW_UPCAST_TO(LineString)
1928 OGR_ALLOW_CAST_TO_THIS(LinearRing)
1950 void ExtendEnvelopeWithCircular(
OGREnvelope *psEnvelope)
const;
1952 int IsFullCircle(
double &cx,
double &cy,
double &square_R)
const;
1956 virtual OGRCurveCasterToLineString GetCasterToLineString()
const override;
1957 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1958 virtual int IntersectsPoint(
const OGRPoint *p)
const override;
1959 virtual int ContainsPoint(
const OGRPoint *p)
const override;
1960 virtual double get_AreaOfCurveSegments()
const override;
1973 size_t &nBytesConsumedOut)
override;
1974 OGRErr exportToWkb(
unsigned char *,
1981 OGRErr importFromWkt(
const char **)
override;
1992 OGRErr *err =
nullptr)
const override;
1996 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
1997 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
2001 virtual double get_Length()
const override;
2003 CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
2004 const char *
const *papszOptions =
nullptr)
const override;
2005 virtual void Value(
double,
OGRPoint *)
const override;
2006 virtual double get_Area()
const override;
2007 virtual double get_GeodesicArea(
2009 virtual double get_GeodesicLength(
2014 virtual const char *getGeometryName()
const override;
2015 virtual bool segmentize(
double dfMaxLength)
override;
2017 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2019 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2020 const char *
const *papszOptions =
nullptr)
const override;
2036 visitor->
visit(
this);
2041 visitor->
visit(
this);
2044 OGR_ALLOW_UPCAST_TO(SimpleCurve)
2045 OGR_ALLOW_CAST_TO_THIS(CircularString)
2063class CPL_DLL OGRCurveCollection
2071 int nCurveCount = 0;
2075 OGRCurveCollection() =
default;
2076 OGRCurveCollection(
const OGRCurveCollection &other);
2077 ~OGRCurveCollection();
2079 OGRCurveCollection &operator=(
const OGRCurveCollection &other);
2095 return papoCurves + nCurveCount;
2109 return papoCurves + nCurveCount;
2119 size_t WkbSize()
const;
2121 const unsigned char *pabyData,
size_t &nSize,
2122 size_t &nDataOffset,
2124 size_t nMinSubGeomSize,
2127 importBodyFromWkb(
OGRGeometry *poGeom,
const unsigned char *pabyData,
2128 size_t nSize,
bool bAcceptCompoundCurve,
2136 OGRBoolean Equals(
const OGRCurveCollection *poOCC)
const;
2137 bool setCoordinateDimension(
OGRGeometry *poGeom,
int nNewDimension);
2142 int getNumCurves()
const;
2144 const OGRCurve *getCurve(
int)
const;
2147 OGRErr removeCurve(
int iIndex,
bool bDelete =
true);
2149 bool hasEmptyParts()
const;
2150 void removeEmptyParts();
2152 void reversePoints();
2156 bool segmentize(
double dfMaxLength);
2158 OGRBoolean hasCurveGeometry(
int bLookForNonLinear)
const;
2180 OGRCurveCollection oCC{};
2182 OGRErr addCurveDirectlyInternal(
OGRCurve *poCurve,
double dfToleranceEps,
2188 OGRLineString *CurveToLineInternal(
double dfMaxAngleStepSizeDegrees,
2189 const char *
const *papszOptions,
2190 int bIsLinearRing)
const;
2201 virtual OGRCurveCasterToLineString GetCasterToLineString()
const override;
2202 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
2245 virtual size_t WkbSize()
const override;
2247 size_t &nBytesConsumedOut)
override;
2248 OGRErr exportToWkb(
unsigned char *,
2255 OGRErr importFromWkt(
const char **)
override;
2266 OGRErr *err =
nullptr)
const override;
2270 virtual void empty()
override;
2271 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
2272 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
2276 virtual double get_Length()
const override;
2277 virtual void StartPoint(
OGRPoint *)
const override;
2278 virtual void EndPoint(
OGRPoint *)
const override;
2279 virtual void Value(
double,
OGRPoint *)
const override;
2281 CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
2282 const char *
const *papszOptions =
nullptr)
const override;
2284 virtual int getNumPoints()
const override;
2285 virtual double get_AreaOfCurveSegments()
const override;
2286 virtual double get_Area()
const override;
2287 virtual double get_GeodesicArea(
2289 virtual double get_GeodesicLength(
2296 int getNumCurves()
const;
2298 const OGRCurve *getCurve(
int)
const;
2301 virtual bool setCoordinateDimension(
int nDimension)
override;
2302 virtual bool set3D(
OGRBoolean bIs3D)
override;
2303 virtual bool setMeasured(
OGRBoolean bIsMeasured)
override;
2311 static constexpr double DEFAULT_TOLERANCE_EPSILON = 1e-14;
2314 double dfToleranceEps = DEFAULT_TOLERANCE_EPSILON);
2316 double dfToleranceEps = DEFAULT_TOLERANCE_EPSILON);
2317 OGRErr addCurve(std::unique_ptr<OGRCurve>,
2318 double dfToleranceEps = DEFAULT_TOLERANCE_EPSILON);
2321 void reversePoints()
override;
2325 virtual const char *getGeometryName()
const override;
2327 virtual void flattenTo2D()
override;
2328 virtual bool segmentize(
double dfMaxLength)
override;
2330 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2332 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2333 const char *
const *papszOptions =
nullptr)
const override;
2337 visitor->
visit(
this);
2342 visitor->
visit(
this);
2345 virtual void swapXY()
override;
2347 bool hasEmptyParts()
const override;
2348 void removeEmptyParts()
override;
2350 OGR_ALLOW_UPCAST_TO(Curve)
2351 OGR_ALLOW_CAST_TO_THIS(CompoundCurve)
2359 return poCurve->
begin();
2366 return poCurve->
end();
2372 return poCurve->
begin();
2378 return poCurve->
end();
2396 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const = 0;
2397 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
const = 0;
2410 return PointOnSurfaceInternal(poPoint);
2420 OGR_FORBID_DOWNCAST_TO_POINT
2421 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
2422 OGR_ALLOW_CAST_TO_THIS(Surface)
2423 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
2451 virtual bool isRingCorrectType(
const OGRCurve *poRing)
const;
2453 virtual bool checkRing(
const OGRCurve *poNewRing)
const;
2454 OGRErr addRingDirectlyInternal(
OGRCurve *poCurve,
int bNeedRealloc);
2464 OGRCurveCollection oCC{};
2466 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2467 virtual OGRSurfaceCasterToCurvePolygon
2468 GetCasterToCurvePolygon()
const override;
2514 virtual const char *getGeometryName()
const override;
2517 virtual void empty()
override;
2519 virtual void flattenTo2D()
override;
2521 virtual bool segmentize(
double dfMaxLength)
override;
2523 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2525 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2526 const char *
const *papszOptions =
nullptr)
const override;
2527 virtual double get_GeodesicArea(
2529 virtual double get_GeodesicLength(
2533 virtual double get_Area()
const override;
2535 virtual double get_Length()
const override;
2538 virtual size_t WkbSize()
const override;
2540 size_t &nBytesConsumedOut)
override;
2541 OGRErr exportToWkb(
unsigned char *,
2548 OGRErr importFromWkt(
const char **)
override;
2559 OGRErr *err =
nullptr)
const override;
2562 virtual int getDimension()
const override;
2563 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
2564 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
2568 CurvePolyToPoly(
double dfMaxAngleStepSizeDegrees = 0,
2569 const char *
const *papszOptions =
nullptr)
const;
2577 virtual bool setCoordinateDimension(
int nDimension)
override;
2578 virtual bool set3D(
OGRBoolean bIs3D)
override;
2579 virtual bool setMeasured(
OGRBoolean bIsMeasured)
override;
2586 OGRErr addRing(std::unique_ptr<OGRCurve>);
2589 const OGRCurve *getExteriorRingCurve()
const;
2590 int getNumInteriorRings()
const;
2591 OGRCurve *getInteriorRingCurve(
int);
2592 const OGRCurve *getInteriorRingCurve(
int)
const;
2594 OGRCurve *stealExteriorRingCurve();
2596 OGRErr removeRing(
int iIndex,
bool bDelete =
true);
2600 visitor->
visit(
this);
2605 visitor->
visit(
this);
2608 virtual void swapXY()
override;
2610 bool hasEmptyParts()
const override;
2611 void removeEmptyParts()
override;
2613 OGR_ALLOW_UPCAST_TO(Surface)
2614 OGR_ALLOW_CAST_TO_THIS(CurvePolygon)
2622 return poGeom->
begin();
2629 return poGeom->
end();
2635 return poGeom->
begin();
2641 return poGeom->
end();
2669 virtual bool isRingCorrectType(
const OGRCurve *poRing)
const override;
2671 virtual bool checkRing(
const OGRCurve *poNewRing)
const override;
2672 virtual OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
2674 int &nMaxPoints,
double *&padfZ);
2678 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2679 virtual OGRSurfaceCasterToCurvePolygon
2680 GetCasterToCurvePolygon()
const override;
2699 return reinterpret_cast<ChildType **
>(oCC.begin());
2705 return reinterpret_cast<ChildType **
>(oCC.end());
2713 return reinterpret_cast<const ChildType *
const *
>(oCC.begin());
2719 return reinterpret_cast<const ChildType *
const *
>(oCC.end());
2723 virtual const char *getGeometryName()
const override;
2727 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2729 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
2731 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2732 const char *
const *papszOptions =
nullptr)
const override;
2735 virtual size_t WkbSize()
const override;
2737 size_t &nBytesConsumedOut)
override;
2738 OGRErr exportToWkb(
unsigned char *,
2745 OGRErr importFromWkt(
const char **)
override;
2756 OGRErr *err =
nullptr)
const override;
2760 CurvePolyToPoly(
double dfMaxAngleStepSizeDegrees = 0,
2761 const char *
const *papszOptions =
nullptr)
const override;
2787 visitor->
visit(
this);
2792 visitor->
visit(
this);
2795 virtual void closeRings()
override;
2797 OGR_ALLOW_UPCAST_TO(CurvePolygon)
2798 OGR_ALLOW_CAST_TO_THIS(Polygon)
2805 return poGeom->
begin();
2811 return poGeom->
end();
2817 return poGeom->
begin();
2823 return poGeom->
end();
2843 bool quickValidityCheck()
const;
2847 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2848 virtual OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
2851 double *&padfZ)
override;
2862 virtual const char *getGeometryName()
const override;
2868 size_t &nBytesConsumedOut)
override;
2887 visitor->
visit(
this);
2892 visitor->
visit(
this);
2899 OGR_ALLOW_UPCAST_TO(Polygon)
2900 OGR_ALLOW_CAST_TO_THIS(Triangle)
2916 OGRErr importFromWktInternal(
const char **ppszInput,
int nRecLevel);
2925 const std::string &exclude = std::string())
const;
2930 OGRErr importFromWkbInternal(
const unsigned char *pabyData,
size_t nSize,
2932 size_t &nBytesConsumedOut);
2959 return papoGeoms + nGeomCount;
2973 return papoGeoms + nGeomCount;
2977 virtual const char *getGeometryName()
const override;
2980 virtual void empty()
override;
2982 virtual void flattenTo2D()
override;
2984 virtual bool segmentize(
double dfMaxLength)
override;
2986 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2988 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
2990 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2991 const char *
const *papszOptions =
nullptr)
const override;
2994 virtual double get_GeodesicLength(
2998 virtual size_t WkbSize()
const override;
3000 size_t &nBytesConsumedOut)
override;
3001 OGRErr exportToWkb(
unsigned char *,
3008 OGRErr importFromWkt(
const char **)
override;
3019 OGRErr *err =
nullptr)
const override;
3021 virtual double get_Length()
const;
3022 virtual double get_Area()
const;
3025 virtual int getDimension()
const override;
3026 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
3027 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
3030 int getNumGeometries()
const;
3038 virtual bool setCoordinateDimension(
int nDimension)
override;
3039 virtual bool set3D(
OGRBoolean bIs3D)
override;
3040 virtual bool setMeasured(
OGRBoolean bIsMeasured)
override;
3043 OGRErr addGeometry(std::unique_ptr<OGRGeometry> geom);
3044 virtual OGRErr removeGeometry(
int iIndex,
int bDelete = TRUE);
3045 std::unique_ptr<OGRGeometry> stealGeometry(
int iIndex);
3047 bool hasEmptyParts()
const override;
3048 void removeEmptyParts()
override;
3053 void closeRings()
override;
3055 virtual void swapXY()
override;
3059 visitor->
visit(
this);
3064 visitor->
visit(
this);
3070 OGR_FORBID_DOWNCAST_TO_POINT
3071 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
3072 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
3073 OGR_ALLOW_CAST_TO_THIS(GeometryCollection)
3081 return poGeom->
begin();
3088 return poGeom->
end();
3094 return poGeom->
begin();
3100 return poGeom->
end();
3136 return reinterpret_cast<ChildType **
>(papoGeoms);
3142 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3150 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3156 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3161 virtual const char *getGeometryName()
const override;
3169 OGRErr importFromWkt(
const char **)
override;
3180 OGRErr *err =
nullptr)
const override;
3186 virtual int getDimension()
const override;
3203 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3219 visitor->
visit(
this);
3224 visitor->
visit(
this);
3229 OGR_ALLOW_CAST_TO_THIS(MultiSurface)
3230 OGR_ALLOW_UPCAST_TO(GeometryCollection)
3231 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
3232 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING
3233 OGR_FORBID_DOWNCAST_TO_MULTICURVE
3241 return poGeom->
begin();
3248 return poGeom->
end();
3254 return poGeom->
begin();
3260 return poGeom->
end();
3282 OGRErr _addGeometryWithExpectedSubGeometryType(
3284 OGRErr _addGeometryDirectlyWithExpectedSubGeometryType(
3304 return reinterpret_cast<ChildType **
>(papoGeoms);
3310 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3318 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3324 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3342 virtual const char *getGeometryName()
const override;
3351 size_t &nBytesConsumedOut)
override;
3358 OGRErr *err =
nullptr)
const override;
3362 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3378 visitor->
visit(
this);
3383 visitor->
visit(
this);
3388 OGR_ALLOW_CAST_TO_THIS(MultiPolygon)
3389 OGR_ALLOW_UPCAST_TO(MultiSurface)
3397 return poGeom->
begin();
3404 return poGeom->
end();
3410 return poGeom->
begin();
3416 return poGeom->
end();
3437 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
3438 virtual OGRSurfaceCasterToCurvePolygon
3439 GetCasterToCurvePolygon()
const override;
3441 virtual const char *getSubGeometryName()
const;
3446 virtual OGRPolyhedralSurfaceCastToMultiPolygon
3447 GetCasterToMultiPolygon()
const;
3491 virtual size_t WkbSize()
const override;
3492 virtual const char *getGeometryName()
const override;
3495 size_t &nBytesConsumedOut)
override;
3496 OGRErr exportToWkb(
unsigned char *,
3503 OGRErr importFromWkt(
const char **)
override;
3514 OGRErr *err =
nullptr)
const override;
3517 virtual int getDimension()
const override;
3519 virtual void empty()
override;
3522 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
3523 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
3525 virtual void flattenTo2D()
override;
3528 virtual double get_Area()
const override;
3529 virtual double get_GeodesicArea(
3531 virtual double get_Length()
const override;
3532 virtual double get_GeodesicLength(
3539 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3542 OGRErr addGeometry(std::unique_ptr<OGRGeometry> poNewGeom);
3544 int getNumGeometries()
const;
3546 const OGRPolygon *getGeometryRef(
int i)
const;
3549 virtual bool setCoordinateDimension(
int nDimension)
override;
3550 virtual bool set3D(
OGRBoolean bIs3D)
override;
3551 virtual bool setMeasured(
OGRBoolean bIsMeasured)
override;
3552 virtual void swapXY()
override;
3553 OGRErr removeGeometry(
int iIndex,
int bDelete = TRUE);
3555 bool hasEmptyParts()
const override;
3556 void removeEmptyParts()
override;
3560 visitor->
visit(
this);
3565 visitor->
visit(
this);
3571 OGR_ALLOW_CAST_TO_THIS(PolyhedralSurface)
3572 OGR_ALLOW_UPCAST_TO(Surface)
3580 return poGeom->
begin();
3587 return poGeom->
end();
3593 return poGeom->
begin();
3599 return poGeom->
end();
3619 virtual const char *getSubGeometryName()
const override;
3622 virtual OGRPolyhedralSurfaceCastToMultiPolygon
3623 GetCasterToMultiPolygon()
const override;
3641 return reinterpret_cast<ChildType **
>(oMP.begin());
3647 return reinterpret_cast<ChildType **
>(oMP.end());
3655 return reinterpret_cast<const ChildType *
const *
>(oMP.begin());
3661 return reinterpret_cast<const ChildType *
const *
>(oMP.end());
3665 virtual const char *getGeometryName()
const override;
3702 visitor->
visit(
this);
3707 visitor->
visit(
this);
3713 OGR_ALLOW_CAST_TO_THIS(TriangulatedSurface)
3714 OGR_ALLOW_UPCAST_TO(PolyhedralSurface)
3722 return poGeom->
begin();
3729 return poGeom->
end();
3735 return poGeom->
begin();
3741 return poGeom->
end();
3757 OGRErr importFromWkt_Bracketed(
const char **,
int bHasM,
int bHasZ);
3778 return reinterpret_cast<ChildType **
>(papoGeoms);
3784 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3792 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3798 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3816 virtual const char *getGeometryName()
const override;
3824 OGRErr importFromWkt(
const char **)
override;
3835 OGRErr *err =
nullptr)
const override;
3838 virtual int getDimension()
const override;
3854 visitor->
visit(
this);
3859 visitor->
visit(
this);
3864 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3866 OGR_ALLOW_CAST_TO_THIS(MultiPoint)
3867 OGR_ALLOW_UPCAST_TO(GeometryCollection)
3868 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING
3869 OGR_FORBID_DOWNCAST_TO_MULTICURVE
3870 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
3871 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
3878 return poGeom->
begin();
3884 return poGeom->
end();
3890 return poGeom->
begin();
3896 return poGeom->
end();
3936 return reinterpret_cast<ChildType **
>(papoGeoms);
3942 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3950 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3956 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3974 virtual const char *getGeometryName()
const override;
3982 OGRErr importFromWkt(
const char **)
override;
3993 OGRErr *err =
nullptr)
const override;
3996 virtual int getDimension()
const override;
4000 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
4016 visitor->
visit(
this);
4021 visitor->
visit(
this);
4026 OGR_ALLOW_CAST_TO_THIS(MultiCurve)
4027 OGR_ALLOW_UPCAST_TO(GeometryCollection)
4028 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
4029 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
4030 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
4037 return poGeom->
begin();
4043 return poGeom->
end();
4049 return poGeom->
begin();
4055 return poGeom->
end();
4089 return reinterpret_cast<ChildType **
>(papoGeoms);
4095 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
4103 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
4109 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
4127 virtual const char *getGeometryName()
const override;
4136 size_t &nBytesConsumedOut)
override;
4143 OGRErr *err =
nullptr)
const override;
4147 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
4163 visitor->
visit(
this);
4168 visitor->
visit(
this);
4173 OGR_ALLOW_CAST_TO_THIS(MultiLineString)
4174 OGR_ALLOW_UPCAST_TO(MultiCurve)
4175 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
4176 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
4177 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
4185 return poGeom->
begin();
4192 return poGeom->
end();
4198 return poGeom->
begin();
4204 return poGeom->
end();
4219 static OGRErr createFromFgfInternal(
const unsigned char *pabyData,
4222 int *pnBytesConsumed,
int nRecLevel);
4227 size_t =
static_cast<size_t>(-1),
4229 static OGRErr createFromWkb(
const void *pabyData,
4232 size_t &nBytesConsumedOut);
4244 CPL_WARN_DEPRECATED(
"Use createFromWkt(const char**, ...) instead")
4246 return createFromWkt(
const_cast<const char **
>(ppszInput), poSRS,
4254 static OGRGeometry *createFromGeoJson(
const char *,
int = -1);
4262 bool bOnlyInOrder =
true);
4269 const char *
const *papszOptions =
nullptr);
4275 int *pbResultValidGeometry,
4276 const char **papszOptions =
nullptr);
4277 static bool haveGEOS();
4284 std::unique_ptr<Private> d;
4292 static bool isTransformWithOptionsRegularTransform(
4299 char **papszOptions,
4303 approximateArcAngles(
double dfX,
double dfY,
double dfZ,
4304 double dfPrimaryRadius,
double dfSecondaryAxis,
4305 double dfRotation,
double dfStartAngle,
4306 double dfEndAngle,
double dfMaxAngleStepSizeDegrees,
4307 const bool bUseMaxGap =
false);
4309 static int GetCurveParameters(
double x0,
double y0,
double x1,
double y1,
4310 double x2,
double y2,
double &R,
double &cx,
4311 double &cy,
double &alpha0,
double &alpha1,
4314 curveToLineString(
double x0,
double y0,
double z0,
double x1,
double y1,
4315 double z1,
double x2,
double y2,
double z2,
int bHasZ,
4316 double dfMaxAngleStepSizeDegrees,
4317 const char *
const *papszOptions =
nullptr);
4320 const char *
const *papszOptions =
nullptr);
4325 bool bCamelCase =
false,
4326 bool bAddZM =
false,
4327 bool bSpaceBeforeZM =
false);
4330typedef struct _OGRPreparedGeometry OGRPreparedGeometry;
4332struct CPL_DLL OGRPreparedGeometryUniquePtrDeleter
4334 void operator()(OGRPreparedGeometry *)
const;
4342typedef std::unique_ptr<OGRPreparedGeometry,
4343 OGRPreparedGeometryUniquePtrDeleter>
The CPLJSONArray class holds JSON object from CPLJSONDocument.
Definition cpl_json.h:41
OGRGeometry visitor interface.
Definition ogr_geometry.h:226
virtual void visit(const OGRCurvePolygon *)=0
Visit OGRCurvePolygon.
virtual void visit(const OGRPolyhedralSurface *)=0
Visit OGRPolyhedralSurface.
virtual void visit(const OGRCompoundCurve *)=0
Visit OGRCompoundCurve.
virtual void visit(const OGRMultiLineString *)=0
Visit OGRMultiLineString.
virtual void visit(const OGRTriangulatedSurface *)=0
Visit OGRTriangulatedSurface.
virtual void visit(const OGRPolygon *)=0
Visit OGRPolygon.
virtual void visit(const OGRMultiPolygon *)=0
Visit OGRMultiPolygon.
virtual void visit(const OGRTriangle *)=0
Visit OGRTriangle.
virtual void visit(const OGRLineString *)=0
Visit OGRLineString.
virtual void visit(const OGRMultiPoint *)=0
Visit OGRMultiPoint.
virtual void visit(const OGRMultiCurve *)=0
Visit OGRMultiCurve.
virtual void visit(const OGRGeometryCollection *)=0
Visit OGRGeometryCollection.
virtual void visit(const OGRPoint *)=0
Visit OGRPoint.
virtual ~IOGRConstGeometryVisitor()=default
Destructor/.
virtual void visit(const OGRMultiSurface *)=0
Visit OGRMultiSurface.
virtual void visit(const OGRLinearRing *)=0
Visit OGRLinearRing.
virtual void visit(const OGRCircularString *)=0
Visit OGRCircularString.
OGRGeometry visitor interface.
Definition ogr_geometry.h:150
virtual void visit(OGRMultiSurface *)=0
Visit OGRMultiSurface.
virtual void visit(OGRLinearRing *)=0
Visit OGRLinearRing.
virtual void visit(OGRTriangle *)=0
Visit OGRTriangle.
virtual void visit(OGRCircularString *)=0
Visit OGRCircularString.
virtual void visit(OGRPolygon *)=0
Visit OGRPolygon.
virtual void visit(OGRLineString *)=0
Visit OGRLineString.
virtual void visit(OGRCompoundCurve *)=0
Visit OGRCompoundCurve.
virtual void visit(OGRTriangulatedSurface *)=0
Visit OGRTriangulatedSurface.
virtual void visit(OGRPoint *)=0
Visit OGRPoint.
virtual void visit(OGRCurvePolygon *)=0
Visit OGRCurvePolygon.
virtual void visit(OGRGeometryCollection *)=0
Visit OGRGeometryCollection.
virtual void visit(OGRPolyhedralSurface *)=0
Visit OGRPolyhedralSurface.
virtual void visit(OGRMultiPolygon *)=0
Visit OGRMultiPolygon.
virtual ~IOGRGeometryVisitor()=default
Destructor/.
virtual void visit(OGRMultiLineString *)=0
Visit OGRMultiLineString.
virtual void visit(OGRMultiPoint *)=0
Visit OGRMultiPoint.
virtual void visit(OGRMultiCurve *)=0
Visit OGRMultiCurve.
Concrete representation of a circular string, that is to say a curve made of one or several arc circl...
Definition ogr_geometry.h:1948
OGRCircularString()=default
Create an empty circular string.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2034
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:2029
OGRCircularString(const OGRCircularString &other)
Copy constructor.
OGRSimpleCurve * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:2023
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2039
Utility class to store a collection of curves.
Definition ogr_geometry.h:2178
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2340
const ChildType *const * end() const
Return end of curve iterator.
Definition ogr_geometry.h:2239
OGRCompoundCurve()=default
Create an empty compound curve.
const ChildType *const * begin() const
Return begin of curve iterator.
Definition ogr_geometry.h:2233
OGRCompoundCurve(const OGRCompoundCurve &other)
Copy constructor.
OGRCurve ChildType
Type of child elements.
Definition ogr_geometry.h:2214
ChildType ** end()
Return end of curve iterator.
Definition ogr_geometry.h:2225
ChildType ** begin()
Return begin of curve iterator.
Definition ogr_geometry.h:2219
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2335
Concrete class representing curve polygons.
Definition ogr_geometry.h:2444
OGRCurvePolygon()=default
Create an empty curve polygon.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2598
OGRCurve ChildType
Type of child elements.
Definition ogr_geometry.h:2483
const ChildType *const * end() const
Return end of curve iterator.
Definition ogr_geometry.h:2508
const ChildType *const * begin() const
Return begin of curve iterator.
Definition ogr_geometry.h:2502
ChildType ** begin()
Return begin of curve iterator.
Definition ogr_geometry.h:2488
ChildType ** end()
Return end of curve iterator.
Definition ogr_geometry.h:2494
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2603
OGRCurvePolygon(const OGRCurvePolygon &)
Copy constructor.
Abstract curve base class for OGRLineString, OGRCircularString and OGRCompoundCurve.
Definition ogr_geometry.h:1315
virtual OGRLineString * CurveToLine(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const =0
Return a linestring from a curve geometry.
virtual double get_Length() const =0
Returns the length of the curve.
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:1407
virtual void StartPoint(OGRPoint *) const =0
Return the curve start point.
virtual void EndPoint(OGRPoint *) const =0
Return the curve end point.
virtual int getNumPoints() const =0
Return the number of points of a curve geometry.
OGRPoint ChildType
Type of child elements.
Definition ogr_geometry.h:1356
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:1399
virtual void Value(double, OGRPoint *) const =0
Fetch point at given distance along curve.
virtual OGRPointIterator * getPointIterator() const =0
Returns a point iterator over the curve.
virtual double get_GeodesicArea(const OGRSpatialReference *poSRSOverride=nullptr) const =0
Get the area of the (closed) curve, considered as a surface on the underlying ellipsoid of the SRS at...
virtual double get_AreaOfCurveSegments() const =0
Get the area of the purely curve portions of a (closed) curve.
virtual double get_Area() const =0
Get the area of the (closed) curve.
virtual void reversePoints()=0
Reverse point order.
virtual OGRCurve * clone() const override=0
Make a copy of this object.
virtual double get_GeodesicLength(const OGRSpatialReference *poSRSOverride=nullptr) const =0
Get the length of the curve, considered as a geodesic line on the underlying ellipsoid of the SRS att...
OGRGeometry visitor default implementation.
Definition ogr_geometry.h:273
void visit(const OGRPoint *) override
Visit OGRPoint.
Definition ogr_geometry.h:277
OGRGeometry visitor default implementation.
Definition ogr_geometry.h:197
void visit(OGRPoint *) override
Visit OGRPoint.
Definition ogr_geometry.h:201
Simple container for a bounding region in 3D.
Definition ogr_core.h:200
Simple container for a bounding region (rectangle)
Definition ogr_core.h:45
A collection of 1 or more geometry objects.
Definition ogr_geometry.h:2915
ChildType ** end()
Return end of sub-geometry iterator.
Definition ogr_geometry.h:2957
OGRGeometryCollection()=default
Create an empty geometry collection.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3057
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3062
const ChildType *const * begin() const
Return begin of sub-geometry iterator.
Definition ogr_geometry.h:2965
const ChildType *const * end() const
Return end of sub-geometry iterator.
Definition ogr_geometry.h:2971
ChildType ** begin()
Return begin of sub-geometry iterator.
Definition ogr_geometry.h:2951
OGRGeometry * getGeometryRef(int)
Fetch geometry from container.
Definition ogrgeometrycollection.cpp:249
OGRGeometry ChildType
Type of child elements.
Definition ogr_geometry.h:2946
Create geometry objects from well known text/binary.
Definition ogr_geometry.h:4218
static OGRErr createFromWkt(char **ppszInput, const OGRSpatialReference *poSRS, OGRGeometry **ppoGeom)
Deprecated.
Definition ogr_geometry.h:4241
Abstract base class for all geometry classes.
Definition ogr_geometry.h:361
const OGRSurface * toSurface() const
Down-cast to OGRSurface*.
Definition ogr_geometry.h:801
const OGRCurvePolygon * toCurvePolygon() const
Down-cast to OGRCurvePolygon*.
Definition ogr_geometry.h:859
const OGRMultiCurve * toMultiCurve() const
Down-cast to OGRMultiCurve*.
Definition ogr_geometry.h:959
const OGRPolyhedralSurface * toPolyhedralSurface() const
Down-cast to OGRPolyhedralSurface*.
Definition ogr_geometry.h:999
const OGRMultiPoint * toMultiPoint() const
Down-cast to OGRMultiPoint*.
Definition ogr_geometry.h:899
virtual void empty()=0
Clear geometry information.
const OGRMultiPolygon * toMultiPolygon() const
Down-cast to OGRMultiPolygon*.
Definition ogr_geometry.h:939
virtual OGRBoolean Equals(const OGRGeometry *) const =0
Returns TRUE if two geometries are equivalent.
OGRPolyhedralSurface * toPolyhedralSurface()
Down-cast to OGRPolyhedralSurface*.
Definition ogr_geometry.h:989
const OGRMultiSurface * toMultiSurface() const
Down-cast to OGRMultiSurface*.
Definition ogr_geometry.h:979
OGRPoint * toPoint()
Down-cast to OGRPoint*.
Definition ogr_geometry.h:654
bool operator!=(const OGRGeometry &other) const
Returns if two geometries are different.
Definition ogr_geometry.h:421
OGRTriangle * toTriangle()
Down-cast to OGRTriangle*.
Definition ogr_geometry.h:830
OGRLineString * toLineString()
Down-cast to OGRLineString*.
Definition ogr_geometry.h:713
const OGRLinearRing * toLinearRing() const
Down-cast to OGRLinearRing*.
Definition ogr_geometry.h:741
const OGRPoint * toPoint() const
Down-cast to OGRPoint*.
Definition ogr_geometry.h:663
OGRMultiLineString * toMultiLineString()
Down-cast to OGRMultiLineString*.
Definition ogr_geometry.h:909
OGRMultiSurface * toMultiSurface()
Down-cast to OGRMultiSurface*.
Definition ogr_geometry.h:969
static OGRGeometry * FromHandle(OGRGeometryH hGeom)
Convert a OGRGeometryH to a OGRGeometry*.
Definition ogr_geometry.h:645
virtual OGRwkbGeometryType getGeometryType() const =0
Fetch geometry type.
virtual void accept(IOGRConstGeometryVisitor *visitor) const =0
Accept a visitor.
const OGRGeometryCollection * toGeometryCollection() const
Down-cast to OGRGeometryCollection*.
Definition ogr_geometry.h:879
const OGRMultiLineString * toMultiLineString() const
Down-cast to OGRMultiLineString*.
Definition ogr_geometry.h:919
const OGRCircularString * toCircularString() const
Down-cast to OGRCircularString*.
Definition ogr_geometry.h:761
OGRPolygon * toPolygon()
Down-cast to OGRPolygon*.
Definition ogr_geometry.h:811
bool operator==(const OGRGeometry &other) const
Returns if two geometries are equal.
Definition ogr_geometry.h:415
OGRLinearRing * toLinearRing()
Down-cast to OGRLinearRing*.
Definition ogr_geometry.h:732
OGRBoolean IsMeasured() const
Definition ogr_geometry.h:443
virtual void accept(IOGRGeometryVisitor *visitor)=0
Accept a visitor.
OGRMultiCurve * toMultiCurve()
Down-cast to OGRMultiCurve*.
Definition ogr_geometry.h:949
const OGRCompoundCurve * toCompoundCurve() const
Down-cast to OGRCompoundCurve*.
Definition ogr_geometry.h:781
virtual OGRErr transform(OGRCoordinateTransformation *poCT)=0
Apply arbitrary coordinate transformation to geometry.
virtual void flattenTo2D()=0
Convert geometry to strictly 2D.
virtual int getDimension() const =0
Get the dimension of this object.
OGRGeometryCollection * toGeometryCollection()
Down-cast to OGRGeometryCollection*.
Definition ogr_geometry.h:869
virtual const char * getGeometryName() const =0
Fetch WKT name for geometry type.
OGRMultiPolygon * toMultiPolygon()
Down-cast to OGRMultiPolygon*.
Definition ogr_geometry.h:929
const OGRPolygon * toPolygon() const
Down-cast to OGRPolygon*.
Definition ogr_geometry.h:821
OGRCompoundCurve * toCompoundCurve()
Down-cast to OGRCompoundCurve*.
Definition ogr_geometry.h:771
OGRErr importFromWkt(char **ppszInput)
Deprecated.
Definition ogr_geometry.h:470
virtual OGRBoolean IsEmpty() const =0
Returns TRUE (non-zero) if the object has no points.
const OGRLineString * toLineString() const
Down-cast to OGRLineString*.
Definition ogr_geometry.h:723
OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const
Convert a geometry into well known text format.
Definition ogrgeometry.cpp:1946
OGRCircularString * toCircularString()
Down-cast to OGRCircularString*.
Definition ogr_geometry.h:751
const OGRCurve * toCurve() const
Down-cast to OGRCurve*.
Definition ogr_geometry.h:683
OGRCurvePolygon * toCurvePolygon()
Down-cast to OGRCurvePolygon*.
Definition ogr_geometry.h:849
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:703
static OGRGeometryH ToHandle(OGRGeometry *poGeom)
Convert a OGRGeometry* to a OGRGeometryH.
Definition ogr_geometry.h:637
OGRBoolean Is3D() const
Definition ogr_geometry.h:437
OGRMultiPoint * toMultiPoint()
Down-cast to OGRMultiPoint*.
Definition ogr_geometry.h:889
const OGRTriangulatedSurface * toTriangulatedSurface() const
Down-cast to OGRTriangulatedSurface*.
Definition ogr_geometry.h:1017
const OGRTriangle * toTriangle() const
Down-cast to OGRTriangle*.
Definition ogr_geometry.h:839
virtual OGRErr importFromWkt(const char **ppszInput)=0
Assign geometry from well known text data.
virtual OGRGeometry * clone() const =0
Make a copy of this object.
OGRSurface * toSurface()
Down-cast to OGRSurface*.
Definition ogr_geometry.h:791
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:693
OGRTriangulatedSurface * toTriangulatedSurface()
Down-cast to OGRTriangulatedSurface*.
Definition ogr_geometry.h:1008
virtual std::string exportToWkt(const OGRWktOptions &opts=OGRWktOptions(), OGRErr *err=nullptr) const =0
Export a WKT geometry.
OGRCurve * toCurve()
Down-cast to OGRCurve*.
Definition ogr_geometry.h:673
Definition ogr_geometry.h:1463
Concrete representation of a multi-vertex line.
Definition ogr_geometry.h:1758
virtual double get_GeodesicLength(const OGRSpatialReference *poSRSOverride=nullptr) const override
Get the length of the curve, considered as a geodesic line on the underlying ellipsoid of the SRS att...
OGRSimpleCurve * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:1800
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:1816
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:1811
OGRLineString(const OGRLineString &other)
Copy constructor.
virtual double get_GeodesicArea(const OGRSpatialReference *poSRSOverride=nullptr) const override
Get the area of the (closed) curve, considered as a surface on the underlying ellipsoid of the SRS at...
virtual int isClockwise() const override
Returns TRUE if the ring has clockwise winding (or less than 2 points)
virtual double get_Area() const override
Get the area of the (closed) curve.
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:1806
OGRLineString()=default
Create an empty line string.
Concrete representation of a closed ring.
Definition ogr_geometry.h:1850
OGRLinearRing()=default
Constructor.
const OGRLineString * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:1912
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:1922
OGRLinearRing(const OGRLinearRing &other)
Copy constructor.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:1917
A collection of OGRCurve.
Definition ogr_geometry.h:3912
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3948
OGRMultiCurve()=default
Create an empty multi curve collection.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3954
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:4019
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3940
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:4009
const OGRCurve * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3968
OGRCurve * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3962
OGRMultiCurve(const OGRMultiCurve &other)
Copy constructor.
OGRCurve ChildType
Type of child elements.
Definition ogr_geometry.h:3929
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3934
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:4003
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:4014
A collection of OGRLineString.
Definition ogr_geometry.h:4069
OGRLineString ChildType
Type of child elements.
Definition ogr_geometry.h:4082
OGRLineString * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:4115
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:4150
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:4093
OGRMultiLineString()=default
Create an empty multi line string collection.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:4107
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:4166
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:4101
const OGRLineString * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:4121
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:4161
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:4087
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:4156
OGRMultiLineString(const OGRMultiLineString &other)
Copy constructor.
A collection of OGRPoint.
Definition ogr_geometry.h:3755
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3841
OGRMultiPoint()=default
Create an empty multi point collection.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3852
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3796
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3776
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3857
OGRMultiPoint(const OGRMultiPoint &other)
Copy constructor.
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3790
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3847
OGRPoint ChildType
Type of child elements.
Definition ogr_geometry.h:3771
const OGRPoint * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3810
OGRPoint * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3804
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3782
A collection of non-overlapping OGRPolygon.
Definition ogr_geometry.h:3274
OGRPolygon ChildType
Type of child elements.
Definition ogr_geometry.h:3297
OGRMultiPolygon(const OGRMultiPolygon &other)
Copy constructor.
OGRPolygon * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3330
OGRMultiPolygon()=default
Create an empty multi polygon collection.
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3381
const OGRPolygon * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3336
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3322
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3308
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3376
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3302
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3365
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3316
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3371
A collection of non-overlapping OGRSurface.
Definition ogr_geometry.h:3116
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3217
const OGRSurface * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3196
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3134
OGRSurface ChildType
Type of child elements.
Definition ogr_geometry.h:3129
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3212
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3148
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3154
OGRMultiSurface(const OGRMultiSurface &other)
Copy constructor.
OGRMultiSurface()=default
Create an empty multi surface collection.
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3140
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3222
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3206
OGRSurface * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3190
Interface for a point iterator.
Definition ogr_geometry.h:1297
virtual OGRBoolean getNextPoint(OGRPoint *p)=0
Returns the next point followed by the iterator.
Point class.
Definition ogr_geometry.h:1135
double getM() const
Return m.
Definition ogr_geometry.h:1207
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:1268
void setX(double xIn)
Set x.
Definition ogr_geometry.h:1218
OGRPoint(const OGRPoint &other)
Copy constructor.
void setZ(double zIn)
Set z.
Definition ogr_geometry.h:1242
void setM(double mIn)
Set m.
Definition ogr_geometry.h:1251
double getX() const
Return x.
Definition ogr_geometry.h:1189
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:1273
void setY(double yIn)
Set y.
Definition ogr_geometry.h:1230
virtual OGRBoolean IsEmpty() const override
Returns TRUE (non-zero) if the object has no points.
Definition ogr_geometry.h:1182
double getZ() const
Return z.
Definition ogr_geometry.h:1201
double getY() const
Return y.
Definition ogr_geometry.h:1195
Concrete class representing polygons.
Definition ogr_geometry.h:2660
OGRLinearRing ChildType
Type of child elements.
Definition ogr_geometry.h:2692
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:2697
const OGRCurvePolygon * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:2780
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:2703
OGRPolygon(const OGRPolygon &other)
Copy constructor.
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:2711
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2790
OGRPolygon()=default
Create an empty polygon.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:2717
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2785
OGRCurvePolygon * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:2774
PolyhedralSurface class.
Definition ogr_geometry.h:3432
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3471
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3485
OGRPolygon * getGeometryRef(int i)
Fetch geometry from container.
Definition ogrpolyhedralsurface.cpp:863
OGRPolyhedralSurface(const OGRPolyhedralSurface &poGeom)
Copy constructor.
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3479
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3465
OGRPolyhedralSurface()=default
Create an empty PolyhedralSurface.
virtual OGRErr addGeometry(const OGRGeometry *)
Add a new geometry to a collection.
Definition ogrpolyhedralsurface.cpp:745
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3558
OGRPolygon ChildType
Type of child elements.
Definition ogr_geometry.h:3460
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3563
Simple container for a position.
Definition ogr_geometry.h:90
OGRRawPoint(double xIn, double yIn)
Constructor.
Definition ogr_geometry.h:98
double x
x
Definition ogr_geometry.h:103
double y
y
Definition ogr_geometry.h:105
OGRRawPoint()
Constructor.
Definition ogr_geometry.h:93
Abstract curve base class for OGRLineString and OGRCircularString.
Definition ogr_geometry.h:1507
double getY(int i) const
Get Y at vertex.
Definition ogr_geometry.h:1658
double getX(int i) const
Get X at vertex.
Definition ogr_geometry.h:1653
OGRSimpleCurve()=default
Constructor.
OGRPoint ChildType
Type of child elements.
Definition ogr_geometry.h:1580
virtual OGRSimpleCurve * clone() const override=0
Make a copy of this object.
virtual int getNumPoints() const override
Fetch vertex count.
Definition ogr_geometry.h:1646
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition ogr_spatialref.h:153
Abstract base class for 2 dimensional objects like polygons or curve polygons.
Definition ogr_geometry.h:2393
virtual double get_Area() const =0
Get the area of the surface object.
virtual double get_Length() const =0
Get the length of the surface.
virtual double get_GeodesicArea(const OGRSpatialReference *poSRSOverride=nullptr) const =0
Get the area of the surface object, considered as a surface on the underlying ellipsoid of the SRS at...
virtual OGRSurface * clone() const override=0
Make a copy of this object.
virtual double get_GeodesicLength(const OGRSpatialReference *poSRSOverride=nullptr) const =0
Get the length of the surface, where curve edges are geodesic lines on the underlying ellipsoid of th...
virtual OGRErr PointOnSurface(OGRPoint *poPoint) const
This method relates to the SFCOM ISurface::get_PointOnSurface() method.
Definition ogr_geometry.h:2408
Triangle class.
Definition ogr_geometry.h:2839
OGRTriangle()=default
Constructor.
const OGRPolygon * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:2880
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2885
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2890
OGRPolygon * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:2874
OGRTriangle(const OGRTriangle &other)
Copy constructor.
TriangulatedSurface class.
Definition ogr_geometry.h:3615
const OGRTriangle * getGeometryRef(int i) const
See OGRPolyhedralSurface::getGeometryRef()
Definition ogr_geometry.h:3676
OGRTriangle * getGeometryRef(int i)
See OGRPolyhedralSurface::getGeometryRef()
Definition ogr_geometry.h:3670
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3659
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3653
OGRPolyhedralSurface * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3689
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3700
const OGRPolyhedralSurface * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3695
OGRTriangle ChildType
Type of child elements.
Definition ogr_geometry.h:3634
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3705
OGRTriangulatedSurface()=default
Constructor.
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3639
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3645
Various convenience functions for CPL.
Interface for read and write JSON documents.
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition cpl_port.h:1030
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1179
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition cpl_port.h:964
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:169
void * OGRGeometryH
Opaque type for a geometry.
Definition ogr_api.h:50
Core portability services for cross-platform OGR code.
int OGRBoolean
Type for a OGR boolean.
Definition ogr_core.h:388
OGRwkbByteOrder
Enumeration to describe byte order.
Definition ogr_core.h:615
@ wkbNDR
LSB/Intel/Vax: Least Significant Byte First
Definition ogr_core.h:617
OGRwkbVariant
Output variants of WKB we support.
Definition ogr_core.h:545
@ wkbVariantOldOgc
Old-style 99-402 extended dimension (Z) WKB types.
Definition ogr_core.h:546
OGRwkbGeometryType
List of well known binary geometry types.
Definition ogr_core.h:407
int OGRErr
Type for a OGR error.
Definition ogr_core.h:371
const char * OGRToOGCGeomType(OGRwkbGeometryType eGeomType, bool bCamelCase=false, bool bAddZM=false, bool bSpaceBeforeZM=false)
Map OGR geometry format constants to corresponding OGC geometry type.
Definition ogrgeometry.cpp:2589
OGRWktFormat
WKT Output formatting options.
Definition ogr_geometry.h:48
@ Default
Format as F when abs(value) < 1, otherwise as G.
std::unique_ptr< OGRPreparedGeometry, OGRPreparedGeometryUniquePtrDeleter > OGRPreparedGeometryUniquePtr
Unique pointer type for OGRPreparedGeometry.
Definition ogr_geometry.h:4344
struct GEOSContextHandle_HS * GEOSContextHandle_t
GEOS context handle type.
Definition ogr_geometry.h:111
OGRwkbGeometryType OGRFromOGCGeomType(const char *pszGeomType)
Map OGCgeometry format type to corresponding OGR constants.
Definition ogrgeometry.cpp:2510
std::unique_ptr< OGRGeometry, OGRGeometryUniquePtrDeleter > OGRGeometryUniquePtr
Unique pointer type for OGRGeometry.
Definition ogr_geometry.h:1035
struct GEOSGeom_t * GEOSGeom
GEOS geometry type.
Definition ogr_geometry.h:109
void sfcgal_geometry_t
SFCGAL geometry type.
Definition ogr_geometry.h:113
Coordinate systems services.
OGRLayer::FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition ogrsf_frmts.h:421
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition ogrsf_frmts.h:429
Geometry coordinate precision for a binary representation.
Definition ogr_geometry.h:307
Geometry coordinate precision.
Definition ogr_geomcoordinateprecision.h:34
Options for formatting WKT output.
Definition ogr_geometry.h:56
int mPrecision
Precision of output for M coordinates. Interpretation depends on format.
Definition ogr_geometry.h:65
int zPrecision
Precision of output for Z coordinates. Interpretation depends on format.
Definition ogr_geometry.h:63
OGRWktOptions()
Constructor.
Definition ogr_geometry.h:72
OGRWktOptions(const OGRWktOptions &)=default
Copy constructor.
int xyPrecision
Precision of output for X,Y coordinates. Interpretation depends on format.
Definition ogr_geometry.h:61
WKB export options.
Definition ogr_geometry.h:330