15#ifndef OGR_GEOMETRY_H_INCLUDED
16#define OGR_GEOMETRY_H_INCLUDED
63 : xyPrecision(getDefaultPrecision()), zPrecision(xyPrecision),
64 mPrecision(zPrecision), round(getDefaultRound())
70 : xyPrecision(xyPrecisionIn), zPrecision(xyPrecision),
71 mPrecision(zPrecision), round(roundIn)
79 static int getDefaultPrecision();
82 static bool getDefaultRound();
307 int nXYBitPrecision =
366 friend class OGRCurveCollection;
368 unsigned int flags = 0;
370 OGRErr importPreambleFromWkt(
const char **ppszInput,
int *pbHasZ,
371 int *pbHasM,
bool *pbIsEmpty);
372 OGRErr importCurveCollectionFromWkt(
373 const char **ppszInput,
int bAllowEmptyComponent,
int bAllowLineString,
374 int bAllowCurve,
int bAllowCompoundCurve,
376 OGRErr importPreambleFromWkb(
const unsigned char *pabyData,
size_t nSize,
379 OGRErr importPreambleOfCollectionFromWkb(
const unsigned char *pabyData,
380 size_t &nSize,
size_t &nDataOffset,
382 size_t nMinSubGeomSize,
388 void HomogenizeDimensionalityWith(
OGRGeometry *poOtherGeom);
402 static const unsigned int OGR_G_NOT_EMPTY_POINT = 0x1;
403 static const unsigned int OGR_G_3D = 0x2;
404 static const unsigned int OGR_G_MEASURED = 0x4;
418 return CPL_TO_BOOL(Equals(&other));
424 return !CPL_TO_BOOL(Equals(&other));
429 virtual int getCoordinateDimension()
const;
430 int CoordinateDimension()
const;
440 return (flags & OGR_G_3D) != 0;
446 return (flags & OGR_G_MEASURED) != 0;
456 virtual
size_t WkbSize() const = 0;
457 OGRErr importFromWkb(const
GByte *,
size_t = static_cast<
size_t>(-1),
460 size_t &nBytesConsumedOut) = 0;
463 virtual
OGRErr exportToWkb(
unsigned char *,
465 virtual
OGRErr importFromWkt(const
char **ppszInput) = 0;
473 CPL_WARN_DEPRECATED(
"Use importFromWkt(const char**) instead")
476 return importFromWkt(
const_cast<const char **
>(ppszInput));
480 OGRErr exportToWkt(
char **ppszDstText,
488 OGRErr *err =
nullptr)
const = 0;
494 void dumpReadable(FILE *,
const char * =
nullptr,
496 std::string dumpReadable(
const char * =
nullptr,
499 virtual char *exportToGML(
const char *
const *papszOptions =
nullptr)
const;
500 virtual char *exportToKML()
const;
501 virtual char *exportToJson(
CSLConstList papszOptions =
nullptr)
const;
514 virtual
OGRBoolean hasCurveGeometry(
int bLookForNonLinear = FALSE) const;
518 double dfMaxAngleStepSizeDegrees = 0,
530 virtual
void closeRings();
532 virtual
bool setCoordinateDimension(
int nDimension);
534 virtual
bool setMeasured(
OGRBoolean bIsMeasured);
546 virtual bool segmentize(
double dfMaxLength);
563 virtual
double Distance(const
OGRGeometry *) const;
570 BufferEx(
double dfDistance,
588 DelaunayTriangulation(
double dfTolerance,
594 virtual
double Distance3D(const
OGRGeometry *poOtherGeom) const;
596 OGRGeometry *SetPrecision(
double dfGridSize,
int nFlags) const;
598 virtual
bool hasEmptyParts() const;
599 virtual
void removeEmptyParts();
604 CPL_WARN_DEPRECATED("Non standard method. "
605 "Use Intersects() instead");
607 CPL_WARN_DEPRECATED("Non standard method. "
608 "Use Equals() instead");
610 CPL_WARN_DEPRECATED("Non standard method. "
611 "Use SymDifference() instead");
613 CPL_WARN_DEPRECATED("Non standard method. "
614 "Use Boundary() instead");
619 static
int bGenerate_DB2_V72_BYTE_ORDER;
622 virtual
void swapXY();
624 bool IsRectangle() const;
658 return cpl::down_cast<OGRPoint *>(
this);
667 return cpl::down_cast<const OGRPoint *>(
this);
677 return cpl::down_cast<OGRCurve *>(
this);
687 return cpl::down_cast<const OGRCurve *>(
this);
697 return cpl::down_cast<OGRSimpleCurve *>(
this);
707 return cpl::down_cast<const OGRSimpleCurve *>(
this);
717 return cpl::down_cast<OGRLineString *>(
this);
727 return cpl::down_cast<const OGRLineString *>(
this);
736 return cpl::down_cast<OGRLinearRing *>(
this);
745 return cpl::down_cast<const OGRLinearRing *>(
this);
755 return cpl::down_cast<OGRCircularString *>(
this);
765 return cpl::down_cast<const OGRCircularString *>(
this);
775 return cpl::down_cast<OGRCompoundCurve *>(
this);
785 return cpl::down_cast<const OGRCompoundCurve *>(
this);
795 return cpl::down_cast<OGRSurface *>(
this);
805 return cpl::down_cast<const OGRSurface *>(
this);
815 return cpl::down_cast<OGRPolygon *>(
this);
825 return cpl::down_cast<const OGRPolygon *>(
this);
834 return cpl::down_cast<OGRTriangle *>(
this);
843 return cpl::down_cast<const OGRTriangle *>(
this);
853 return cpl::down_cast<OGRCurvePolygon *>(
this);
863 return cpl::down_cast<const OGRCurvePolygon *>(
this);
873 return cpl::down_cast<OGRGeometryCollection *>(
this);
883 return cpl::down_cast<const OGRGeometryCollection *>(
this);
893 return cpl::down_cast<OGRMultiPoint *>(
this);
903 return cpl::down_cast<const OGRMultiPoint *>(
this);
913 return cpl::down_cast<OGRMultiLineString *>(
this);
923 return cpl::down_cast<const OGRMultiLineString *>(
this);
933 return cpl::down_cast<OGRMultiPolygon *>(
this);
943 return cpl::down_cast<const OGRMultiPolygon *>(
this);
953 return cpl::down_cast<OGRMultiCurve *>(
this);
963 return cpl::down_cast<const OGRMultiCurve *>(
this);
973 return cpl::down_cast<OGRMultiSurface *>(
this);
983 return cpl::down_cast<const OGRMultiSurface *>(
this);
993 return cpl::down_cast<OGRPolyhedralSurface *>(
this);
1003 return cpl::down_cast<const OGRPolyhedralSurface *>(
this);
1012 return cpl::down_cast<OGRTriangulatedSurface *>(
this);
1021 return cpl::down_cast<const OGRTriangulatedSurface *>(
this);
1026struct CPL_DLL OGRGeometryUniquePtrDeleter
1036typedef std::unique_ptr<OGRGeometry, OGRGeometryUniquePtrDeleter>
1040#define OGR_FORBID_DOWNCAST_TO(name) \
1041 inline OGR##name *to##name() = delete; \
1042 inline const OGR##name *to##name() const = delete;
1044#define OGR_FORBID_DOWNCAST_TO_POINT OGR_FORBID_DOWNCAST_TO(Point)
1045#define OGR_FORBID_DOWNCAST_TO_CURVE OGR_FORBID_DOWNCAST_TO(Curve)
1046#define OGR_FORBID_DOWNCAST_TO_SIMPLE_CURVE OGR_FORBID_DOWNCAST_TO(SimpleCurve)
1047#define OGR_FORBID_DOWNCAST_TO_LINESTRING OGR_FORBID_DOWNCAST_TO(LineString)
1048#define OGR_FORBID_DOWNCAST_TO_LINEARRING OGR_FORBID_DOWNCAST_TO(LinearRing)
1049#define OGR_FORBID_DOWNCAST_TO_CIRCULARSTRING \
1050 OGR_FORBID_DOWNCAST_TO(CircularString)
1051#define OGR_FORBID_DOWNCAST_TO_COMPOUNDCURVE \
1052 OGR_FORBID_DOWNCAST_TO(CompoundCurve)
1053#define OGR_FORBID_DOWNCAST_TO_SURFACE OGR_FORBID_DOWNCAST_TO(Surface)
1054#define OGR_FORBID_DOWNCAST_TO_CURVEPOLYGON OGR_FORBID_DOWNCAST_TO(CurvePolygon)
1055#define OGR_FORBID_DOWNCAST_TO_POLYGON OGR_FORBID_DOWNCAST_TO(Polygon)
1056#define OGR_FORBID_DOWNCAST_TO_TRIANGLE OGR_FORBID_DOWNCAST_TO(Triangle)
1057#define OGR_FORBID_DOWNCAST_TO_MULTIPOINT OGR_FORBID_DOWNCAST_TO(MultiPoint)
1058#define OGR_FORBID_DOWNCAST_TO_MULTICURVE OGR_FORBID_DOWNCAST_TO(MultiCurve)
1059#define OGR_FORBID_DOWNCAST_TO_MULTILINESTRING \
1060 OGR_FORBID_DOWNCAST_TO(MultiLineString)
1061#define OGR_FORBID_DOWNCAST_TO_MULTISURFACE OGR_FORBID_DOWNCAST_TO(MultiSurface)
1062#define OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON OGR_FORBID_DOWNCAST_TO(MultiPolygon)
1063#define OGR_FORBID_DOWNCAST_TO_GEOMETRYCOLLECTION \
1064 OGR_FORBID_DOWNCAST_TO(GeometryCollection)
1065#define OGR_FORBID_DOWNCAST_TO_POLYHEDRALSURFACE \
1066 OGR_FORBID_DOWNCAST_TO(PolyhedralSurface)
1067#define OGR_FORBID_DOWNCAST_TO_TIN OGR_FORBID_DOWNCAST_TO(TriangulatedSurface)
1069#define OGR_ALLOW_UPCAST_TO(name) \
1070 inline OGR##name *to##name() \
1074 inline const OGR##name *to##name() const \
1079#ifndef SUPPRESS_OGR_ALLOW_CAST_TO_THIS_WARNING
1080#define CAST_TO_THIS_WARNING CPL_WARN_DEPRECATED("Casting to this is useless")
1082#define CAST_TO_THIS_WARNING
1085#define OGR_ALLOW_CAST_TO_THIS(name) \
1086 inline OGR##name *to##name() CAST_TO_THIS_WARNING \
1090 inline const OGR##name *to##name() const CAST_TO_THIS_WARNING \
1095#define OGR_FORBID_DOWNCAST_TO_ALL_CURVES \
1096 OGR_FORBID_DOWNCAST_TO_CURVE \
1097 OGR_FORBID_DOWNCAST_TO_SIMPLE_CURVE \
1098 OGR_FORBID_DOWNCAST_TO_LINESTRING \
1099 OGR_FORBID_DOWNCAST_TO_LINEARRING \
1100 OGR_FORBID_DOWNCAST_TO_CIRCULARSTRING \
1101 OGR_FORBID_DOWNCAST_TO_COMPOUNDCURVE
1103#define OGR_FORBID_DOWNCAST_TO_ALL_SURFACES \
1104 OGR_FORBID_DOWNCAST_TO_SURFACE \
1105 OGR_FORBID_DOWNCAST_TO_CURVEPOLYGON \
1106 OGR_FORBID_DOWNCAST_TO_POLYGON \
1107 OGR_FORBID_DOWNCAST_TO_TRIANGLE \
1108 OGR_FORBID_DOWNCAST_TO_POLYHEDRALSURFACE \
1109 OGR_FORBID_DOWNCAST_TO_TIN
1111#define OGR_FORBID_DOWNCAST_TO_ALL_SINGLES \
1112 OGR_FORBID_DOWNCAST_TO_POINT \
1113 OGR_FORBID_DOWNCAST_TO_ALL_CURVES \
1114 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1116#define OGR_FORBID_DOWNCAST_TO_ALL_MULTI \
1117 OGR_FORBID_DOWNCAST_TO_GEOMETRYCOLLECTION \
1118 OGR_FORBID_DOWNCAST_TO_MULTIPOINT \
1119 OGR_FORBID_DOWNCAST_TO_MULTICURVE \
1120 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING \
1121 OGR_FORBID_DOWNCAST_TO_MULTISURFACE \
1122 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
1146 OGRPoint(
double x,
double y,
double z);
1147 OGRPoint(
double x,
double y,
double z,
double m);
1151 static OGRPoint *createXYM(
double x,
double y,
double m);
1158 size_t WkbSize()
const override;
1160 size_t &nBytesConsumedOut)
override;
1161 OGRErr exportToWkb(
unsigned char *,
1168 OGRErr importFromWkt(
const char **)
override;
1179 OGRErr *err =
nullptr)
const override;
1182 virtual int getDimension()
const override;
1183 virtual OGRPoint *clone()
const override;
1184 virtual void empty()
override;
1185 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
1186 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
1190 return !(flags & OGR_G_NOT_EMPTY_POINT);
1219 virtual bool setCoordinateDimension(
int nDimension)
override;
1227 if (std::isnan(x) || std::isnan(y))
1228 flags &= ~OGR_G_NOT_EMPTY_POINT;
1230 flags |= OGR_G_NOT_EMPTY_POINT;
1239 if (std::isnan(x) || std::isnan(y))
1240 flags &= ~OGR_G_NOT_EMPTY_POINT;
1242 flags |= OGR_G_NOT_EMPTY_POINT;
1260 flags |= OGR_G_MEASURED;
1269 virtual const char *getGeometryName()
const override;
1272 virtual void flattenTo2D()
override;
1276 visitor->
visit(
this);
1281 visitor->
visit(
this);
1284 virtual void swapXY()
override;
1286 OGR_ALLOW_CAST_TO_THIS(Point)
1287 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
1288 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1289 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
1328 virtual OGRCurveCasterToLineString GetCasterToLineString()
const = 0;
1329 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const = 0;
1334 virtual int ContainsPoint(
const OGRPoint *p)
const;
1335 virtual int IntersectsPoint(
const OGRPoint *p)
const;
1339 class CPL_DLL ConstIterator
1342 std::unique_ptr<Private> m_poPrivate;
1345 ConstIterator(
const OGRCurve *poSelf,
bool bStart);
1346 ConstIterator(ConstIterator &&oOther)
noexcept;
1347 ConstIterator &operator=(ConstIterator &&oOther);
1350 ConstIterator &operator++();
1351 bool operator!=(
const ConstIterator &it)
const;
1355 friend inline ConstIterator
end(
const OGRCurve *);
1374 ConstIterator
begin()
const;
1376 ConstIterator
end()
const;
1385 virtual int get_IsClosed()
const;
1389 const char *
const *papszOptions =
nullptr)
const = 0;
1390 virtual int getDimension()
const override;
1401 virtual int isClockwise()
const;
1409 return cpl::down_cast<OGRSimpleCurve *>(
this);
1417 return cpl::down_cast<const OGRSimpleCurve *>(
this);
1424 OGR_FORBID_DOWNCAST_TO_POINT
1425 OGR_ALLOW_CAST_TO_THIS(Curve)
1426 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1427 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
1432inline OGRCurve::ConstIterator
begin(
const OGRCurve *poCurve)
1434 return poCurve->begin();
1438inline OGRCurve::ConstIterator
end(
const OGRCurve *poCurve)
1440 return poCurve->end();
1486 void setX(
double xIn);
1490 void setY(
double yIn);
1494 void setZ(
double zIn);
1498 void setM(
double mIn);
1520 int nPointCount = 0;
1521 int m_nPointCapacity = 0;
1523 double *padfZ =
nullptr;
1524 double *padfM =
nullptr;
1531 OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
int bHasM,
1536 virtual double get_LinearArea()
const;
1546 class CPL_DLL Iterator
1549 std::unique_ptr<Private> m_poPrivate;
1554 Iterator(Iterator &&oOther)
noexcept;
1558 Iterator &operator++();
1559 bool operator!=(
const Iterator &it)
const;
1565 class CPL_DLL ConstIterator
1568 std::unique_ptr<Private> m_poPrivate;
1573 ConstIterator &&oOther)
noexcept;
1577 ConstIterator &operator++();
1578 bool operator!=(
const ConstIterator &it)
const;
1613 ConstIterator
begin()
const;
1615 ConstIterator
end()
const;
1618 virtual size_t WkbSize()
const override;
1620 size_t &nBytesConsumedOut)
override;
1622 exportToWkb(
unsigned char *,
1629 OGRErr importFromWkt(
const char **)
override;
1640 OGRErr *err =
nullptr)
const override;
1643 virtual void empty()
override;
1644 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
1645 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
1650 virtual double get_Length()
const override;
1651 virtual void StartPoint(
OGRPoint *)
const override;
1652 virtual void EndPoint(
OGRPoint *)
const override;
1653 virtual void Value(
double,
OGRPoint *)
const override;
1654 virtual double Project(
const OGRPoint *)
const;
1655 virtual OGRLineString *getSubLine(
double,
double,
int)
const;
1663 void getPoint(
int,
OGRPoint *)
const;
1667 return paoPoints[i].
x;
1672 return paoPoints[i].
y;
1675 double getZ(
int i)
const;
1676 double getM(
int i)
const;
1682 virtual bool setCoordinateDimension(
int nDimension)
override;
1683 virtual bool set3D(
OGRBoolean bIs3D)
override;
1684 virtual bool setMeasured(
OGRBoolean bIsMeasured)
override;
1685 bool setNumPoints(
int nNewPointCount,
int bZeroizeNewContent = TRUE);
1687 bool setPoint(
int,
double,
double);
1688 bool setZ(
int,
double);
1689 bool setM(
int,
double);
1690 bool setPoint(
int,
double,
double,
double);
1691 bool setPointM(
int,
double,
double,
double);
1692 bool setPoint(
int,
double,
double,
double,
double);
1693 bool setPoints(
int,
const OGRRawPoint *,
const double * =
nullptr);
1694 bool setPointsM(
int,
const OGRRawPoint *,
const double *);
1695 bool setPoints(
int,
const OGRRawPoint *,
const double *,
const double *);
1696 bool setPoints(
int,
const double *padfX,
const double *padfY,
1697 const double *padfZIn =
nullptr);
1698 bool setPointsM(
int,
const double *padfX,
const double *padfY,
1699 const double *padfMIn =
nullptr);
1700 bool setPoints(
int,
const double *padfX,
const double *padfY,
1701 const double *padfZIn,
const double *padfMIn);
1703 bool addPoint(
double,
double);
1704 bool addPoint(
double,
double,
double);
1705 bool addPointM(
double,
double,
double);
1706 bool addPoint(
double,
double,
double,
double);
1708 bool removePoint(
int);
1710 void getPoints(
OGRRawPoint *,
double * =
nullptr)
const;
1711 void getPoints(
void *pabyX,
int nXStride,
void *pabyY,
int nYStride,
1712 void *pabyZ =
nullptr,
int nZStride = 0,
1713 void *pabyM =
nullptr,
int nMStride = 0)
const;
1715 void addSubLineString(
const OGRLineString *,
int nStartVertex = 0,
1716 int nEndVertex = -1);
1717 void reversePoints()
override;
1722 virtual void flattenTo2D()
override;
1723 virtual bool segmentize(
double dfMaxLength)
override;
1725 virtual void swapXY()
override;
1727 OGR_ALLOW_UPCAST_TO(Curve)
1728 OGR_ALLOW_CAST_TO_THIS(SimpleCurve)
1735 return poCurve->begin();
1741 return poCurve->end();
1747 return poCurve->begin();
1753 return poCurve->end();
1779 virtual OGRCurveCasterToLineString GetCasterToLineString()
const override;
1780 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1782 virtual double get_AreaOfCurveSegments()
const override;
1798 CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
1799 const char *
const *papszOptions =
nullptr)
const override;
1801 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
1810 virtual const char *getGeometryName()
const override;
1827 visitor->
visit(
this);
1832 visitor->
visit(
this);
1835 OGR_ALLOW_UPCAST_TO(SimpleCurve)
1836 OGR_ALLOW_CAST_TO_THIS(LineString)
1870 virtual size_t WkbSize()
const override;
1872 size_t &nBytesConsumedOut)
override;
1873 OGRErr exportToWkb(
unsigned char *,
1882 virtual size_t _WkbSize(
int _flags)
const;
1884 const unsigned char *,
size_t,
1885 size_t &nBytesConsumedOut);
1886 virtual OGRErr _exportToWkb(
int _flags,
unsigned char *,
1889 virtual OGRCurveCasterToLineString GetCasterToLineString()
const override;
1890 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1908 virtual const char *getGeometryName()
const override;
1912 void reverseWindingOrder()
1913 CPL_WARN_DEPRECATED("Use reversePoints() instead");
1916 virtual
void closeRings() override;
1918 int bTestEnvelope = TRUE) const;
1920 int bTestEnvelope = TRUE) const;
1937 visitor->
visit(
this);
1942 visitor->
visit(
this);
1945 OGR_ALLOW_UPCAST_TO(LineString)
1946 OGR_ALLOW_CAST_TO_THIS(LinearRing)
1968 void ExtendEnvelopeWithCircular(
OGREnvelope *psEnvelope)
const;
1970 int IsFullCircle(
double &cx,
double &cy,
double &square_R)
const;
1974 virtual OGRCurveCasterToLineString GetCasterToLineString()
const override;
1975 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1976 virtual int IntersectsPoint(
const OGRPoint *p)
const override;
1977 virtual int ContainsPoint(
const OGRPoint *p)
const override;
1978 virtual double get_AreaOfCurveSegments()
const override;
1995 size_t &nBytesConsumedOut)
override;
1996 OGRErr exportToWkb(
unsigned char *,
2003 OGRErr importFromWkt(
const char **)
override;
2014 OGRErr *err =
nullptr)
const override;
2018 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
2019 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
2023 virtual double get_Length()
const override;
2025 CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
2026 const char *
const *papszOptions =
nullptr)
const override;
2027 virtual void Value(
double,
OGRPoint *)
const override;
2028 virtual double get_Area()
const override;
2029 virtual double get_GeodesicArea(
2031 virtual double get_GeodesicLength(
2036 virtual const char *getGeometryName()
const override;
2037 virtual bool segmentize(
double dfMaxLength)
override;
2039 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2041 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2042 const char *
const *papszOptions =
nullptr)
const override;
2058 visitor->
visit(
this);
2063 visitor->
visit(
this);
2066 OGR_ALLOW_UPCAST_TO(SimpleCurve)
2067 OGR_ALLOW_CAST_TO_THIS(CircularString)
2085class CPL_DLL OGRCurveCollection
2093 int nCurveCount = 0;
2097 OGRCurveCollection() =
default;
2098 OGRCurveCollection(
const OGRCurveCollection &other);
2099 OGRCurveCollection(OGRCurveCollection &&other);
2100 ~OGRCurveCollection();
2102 OGRCurveCollection &operator=(
const OGRCurveCollection &other);
2103 OGRCurveCollection &operator=(OGRCurveCollection &&other);
2119 return papoCurves + nCurveCount;
2133 return papoCurves + nCurveCount;
2143 size_t WkbSize()
const;
2145 const unsigned char *pabyData,
size_t &nSize,
2146 size_t &nDataOffset,
2148 size_t nMinSubGeomSize,
2151 importBodyFromWkb(
OGRGeometry *poGeom,
const unsigned char *pabyData,
2152 size_t nSize,
bool bAcceptCompoundCurve,
2160 OGRBoolean Equals(
const OGRCurveCollection *poOCC)
const;
2161 bool setCoordinateDimension(
OGRGeometry *poGeom,
int nNewDimension);
2166 int getNumCurves()
const;
2168 const OGRCurve *getCurve(
int)
const;
2171 OGRErr removeCurve(
int iIndex,
bool bDelete =
true);
2173 bool hasEmptyParts()
const;
2174 void removeEmptyParts();
2176 void reversePoints();
2180 bool segmentize(
double dfMaxLength);
2182 OGRBoolean hasCurveGeometry(
int bLookForNonLinear)
const;
2204 OGRCurveCollection oCC{};
2206 OGRErr addCurveDirectlyInternal(
OGRCurve *poCurve,
double dfToleranceEps,
2212 OGRLineString *CurveToLineInternal(
double dfMaxAngleStepSizeDegrees,
2213 const char *
const *papszOptions,
2214 int bIsLinearRing)
const;
2225 virtual OGRCurveCasterToLineString GetCasterToLineString()
const override;
2226 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
2273 virtual size_t WkbSize()
const override;
2275 size_t &nBytesConsumedOut)
override;
2276 OGRErr exportToWkb(
unsigned char *,
2283 OGRErr importFromWkt(
const char **)
override;
2294 OGRErr *err =
nullptr)
const override;
2298 virtual void empty()
override;
2299 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
2300 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
2304 virtual double get_Length()
const override;
2305 virtual void StartPoint(
OGRPoint *)
const override;
2306 virtual void EndPoint(
OGRPoint *)
const override;
2307 virtual void Value(
double,
OGRPoint *)
const override;
2309 CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
2310 const char *
const *papszOptions =
nullptr)
const override;
2312 virtual int getNumPoints()
const override;
2313 virtual double get_AreaOfCurveSegments()
const override;
2314 virtual double get_Area()
const override;
2315 virtual double get_GeodesicArea(
2317 virtual double get_GeodesicLength(
2324 int getNumCurves()
const;
2326 const OGRCurve *getCurve(
int)
const;
2329 virtual bool setCoordinateDimension(
int nDimension)
override;
2330 virtual bool set3D(
OGRBoolean bIs3D)
override;
2331 virtual bool setMeasured(
OGRBoolean bIsMeasured)
override;
2339 static constexpr double DEFAULT_TOLERANCE_EPSILON = 1e-14;
2342 double dfToleranceEps = DEFAULT_TOLERANCE_EPSILON);
2344 double dfToleranceEps = DEFAULT_TOLERANCE_EPSILON);
2345 OGRErr addCurve(std::unique_ptr<OGRCurve>,
2346 double dfToleranceEps = DEFAULT_TOLERANCE_EPSILON);
2349 void reversePoints()
override;
2353 virtual const char *getGeometryName()
const override;
2355 virtual void flattenTo2D()
override;
2356 virtual bool segmentize(
double dfMaxLength)
override;
2358 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2360 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2361 const char *
const *papszOptions =
nullptr)
const override;
2365 visitor->
visit(
this);
2370 visitor->
visit(
this);
2373 virtual void swapXY()
override;
2375 bool hasEmptyParts()
const override;
2376 void removeEmptyParts()
override;
2378 OGR_ALLOW_UPCAST_TO(Curve)
2379 OGR_ALLOW_CAST_TO_THIS(CompoundCurve)
2387 return poCurve->
begin();
2394 return poCurve->
end();
2400 return poCurve->
begin();
2406 return poCurve->
end();
2424 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const = 0;
2425 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
const = 0;
2438 return PointOnSurfaceInternal(poPoint);
2448 OGR_FORBID_DOWNCAST_TO_POINT
2449 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
2450 OGR_ALLOW_CAST_TO_THIS(Surface)
2451 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
2479 virtual bool isRingCorrectType(
const OGRCurve *poRing)
const;
2481 virtual bool checkRing(
const OGRCurve *poNewRing)
const;
2482 OGRErr addRingDirectlyInternal(
OGRCurve *poCurve,
int bNeedRealloc);
2492 OGRCurveCollection oCC{};
2494 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2495 virtual OGRSurfaceCasterToCurvePolygon
2496 GetCasterToCurvePolygon()
const override;
2546 virtual const char *getGeometryName()
const override;
2549 virtual void empty()
override;
2551 virtual void flattenTo2D()
override;
2553 virtual bool segmentize(
double dfMaxLength)
override;
2555 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2557 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2558 const char *
const *papszOptions =
nullptr)
const override;
2559 virtual double get_GeodesicArea(
2561 virtual double get_GeodesicLength(
2565 virtual double get_Area()
const override;
2567 virtual double get_Length()
const override;
2570 virtual size_t WkbSize()
const override;
2572 size_t &nBytesConsumedOut)
override;
2573 OGRErr exportToWkb(
unsigned char *,
2580 OGRErr importFromWkt(
const char **)
override;
2591 OGRErr *err =
nullptr)
const override;
2594 virtual int getDimension()
const override;
2595 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
2596 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
2600 CurvePolyToPoly(
double dfMaxAngleStepSizeDegrees = 0,
2601 const char *
const *papszOptions =
nullptr)
const;
2609 virtual bool setCoordinateDimension(
int nDimension)
override;
2610 virtual bool set3D(
OGRBoolean bIs3D)
override;
2611 virtual bool setMeasured(
OGRBoolean bIsMeasured)
override;
2618 OGRErr addRing(std::unique_ptr<OGRCurve>);
2621 const OGRCurve *getExteriorRingCurve()
const;
2622 int getNumInteriorRings()
const;
2623 OGRCurve *getInteriorRingCurve(
int);
2624 const OGRCurve *getInteriorRingCurve(
int)
const;
2626 OGRCurve *stealExteriorRingCurve();
2628 OGRErr removeRing(
int iIndex,
bool bDelete =
true);
2632 visitor->
visit(
this);
2637 visitor->
visit(
this);
2640 virtual void swapXY()
override;
2642 bool hasEmptyParts()
const override;
2643 void removeEmptyParts()
override;
2645 OGR_ALLOW_UPCAST_TO(Surface)
2646 OGR_ALLOW_CAST_TO_THIS(CurvePolygon)
2654 return poGeom->
begin();
2661 return poGeom->
end();
2667 return poGeom->
begin();
2673 return poGeom->
end();
2701 virtual bool isRingCorrectType(
const OGRCurve *poRing)
const override;
2703 virtual bool checkRing(
const OGRCurve *poNewRing)
const override;
2704 virtual OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
2706 int &nMaxPoints,
double *&padfZ);
2710 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2711 virtual OGRSurfaceCasterToCurvePolygon
2712 GetCasterToCurvePolygon()
const override;
2719 OGRPolygon(
double x1,
double y1,
double x2,
double y2);
2739 return reinterpret_cast<ChildType **
>(oCC.begin());
2745 return reinterpret_cast<ChildType **
>(oCC.end());
2753 return reinterpret_cast<const ChildType *
const *
>(oCC.begin());
2759 return reinterpret_cast<const ChildType *
const *
>(oCC.end());
2763 virtual const char *getGeometryName()
const override;
2767 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2769 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
2771 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2772 const char *
const *papszOptions =
nullptr)
const override;
2775 virtual size_t WkbSize()
const override;
2777 size_t &nBytesConsumedOut)
override;
2778 OGRErr exportToWkb(
unsigned char *,
2785 OGRErr importFromWkt(
const char **)
override;
2796 OGRErr *err =
nullptr)
const override;
2800 CurvePolyToPoly(
double dfMaxAngleStepSizeDegrees = 0,
2801 const char *
const *papszOptions =
nullptr)
const override;
2827 visitor->
visit(
this);
2832 visitor->
visit(
this);
2835 virtual void closeRings()
override;
2837 OGR_ALLOW_UPCAST_TO(CurvePolygon)
2838 OGR_ALLOW_CAST_TO_THIS(Polygon)
2845 return poGeom->
begin();
2851 return poGeom->
end();
2857 return poGeom->
begin();
2863 return poGeom->
end();
2883 bool quickValidityCheck()
const;
2887 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2888 virtual OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
2891 double *&padfZ)
override;
2906 virtual const char *getGeometryName()
const override;
2912 size_t &nBytesConsumedOut)
override;
2931 visitor->
visit(
this);
2936 visitor->
visit(
this);
2943 OGR_ALLOW_UPCAST_TO(Polygon)
2944 OGR_ALLOW_CAST_TO_THIS(Triangle)
2960 OGRErr importFromWktInternal(
const char **ppszInput,
int nRecLevel);
2969 const std::string &exclude = std::string())
const;
2974 OGRErr importFromWkbInternal(
const unsigned char *pabyData,
size_t nSize,
2976 size_t &nBytesConsumedOut);
3005 return papoGeoms + nGeomCount;
3019 return papoGeoms + nGeomCount;
3023 virtual const char *getGeometryName()
const override;
3026 virtual void empty()
override;
3028 virtual void flattenTo2D()
override;
3030 virtual bool segmentize(
double dfMaxLength)
override;
3032 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3034 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
3036 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
3037 const char *
const *papszOptions =
nullptr)
const override;
3040 virtual double get_GeodesicLength(
3044 virtual size_t WkbSize()
const override;
3046 size_t &nBytesConsumedOut)
override;
3047 OGRErr exportToWkb(
unsigned char *,
3054 OGRErr importFromWkt(
const char **)
override;
3065 OGRErr *err =
nullptr)
const override;
3067 virtual double get_Length()
const;
3068 virtual double get_Area()
const;
3071 virtual int getDimension()
const override;
3072 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
3073 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
3076 int getNumGeometries()
const;
3084 virtual bool setCoordinateDimension(
int nDimension)
override;
3085 virtual bool set3D(
OGRBoolean bIs3D)
override;
3086 virtual bool setMeasured(
OGRBoolean bIsMeasured)
override;
3089 OGRErr addGeometry(std::unique_ptr<OGRGeometry> geom);
3090 virtual OGRErr removeGeometry(
int iIndex,
int bDelete = TRUE);
3091 std::unique_ptr<OGRGeometry> stealGeometry(
int iIndex);
3093 bool hasEmptyParts()
const override;
3094 void removeEmptyParts()
override;
3099 void closeRings()
override;
3101 virtual void swapXY()
override;
3105 visitor->
visit(
this);
3110 visitor->
visit(
this);
3116 OGR_FORBID_DOWNCAST_TO_POINT
3117 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
3118 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
3119 OGR_ALLOW_CAST_TO_THIS(GeometryCollection)
3127 return poGeom->
begin();
3134 return poGeom->
end();
3140 return poGeom->
begin();
3146 return poGeom->
end();
3186 return reinterpret_cast<ChildType **
>(papoGeoms);
3192 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3200 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3206 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3211 virtual const char *getGeometryName()
const override;
3219 OGRErr importFromWkt(
const char **)
override;
3230 OGRErr *err =
nullptr)
const override;
3236 virtual int getDimension()
const override;
3253 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3269 visitor->
visit(
this);
3274 visitor->
visit(
this);
3279 OGR_ALLOW_CAST_TO_THIS(MultiSurface)
3280 OGR_ALLOW_UPCAST_TO(GeometryCollection)
3281 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
3282 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING
3283 OGR_FORBID_DOWNCAST_TO_MULTICURVE
3291 return poGeom->
begin();
3298 return poGeom->
end();
3304 return poGeom->
begin();
3310 return poGeom->
end();
3332 OGRErr _addGeometryWithExpectedSubGeometryType(
3334 OGRErr _addGeometryDirectlyWithExpectedSubGeometryType(
3358 return reinterpret_cast<ChildType **
>(papoGeoms);
3364 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3372 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3378 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3396 virtual const char *getGeometryName()
const override;
3405 size_t &nBytesConsumedOut)
override;
3412 OGRErr *err =
nullptr)
const override;
3416 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3432 visitor->
visit(
this);
3437 visitor->
visit(
this);
3442 OGR_ALLOW_CAST_TO_THIS(MultiPolygon)
3443 OGR_ALLOW_UPCAST_TO(MultiSurface)
3451 return poGeom->
begin();
3458 return poGeom->
end();
3464 return poGeom->
begin();
3470 return poGeom->
end();
3491 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
3492 virtual OGRSurfaceCasterToCurvePolygon
3493 GetCasterToCurvePolygon()
const override;
3495 virtual const char *getSubGeometryName()
const;
3500 virtual OGRPolyhedralSurfaceCastToMultiPolygon
3501 GetCasterToMultiPolygon()
const;
3549 virtual size_t WkbSize()
const override;
3550 virtual const char *getGeometryName()
const override;
3553 size_t &nBytesConsumedOut)
override;
3554 OGRErr exportToWkb(
unsigned char *,
3561 OGRErr importFromWkt(
const char **)
override;
3572 OGRErr *err =
nullptr)
const override;
3575 virtual int getDimension()
const override;
3577 virtual void empty()
override;
3580 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
3581 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
3583 virtual void flattenTo2D()
override;
3586 virtual double get_Area()
const override;
3587 virtual double get_GeodesicArea(
3589 virtual double get_Length()
const override;
3590 virtual double get_GeodesicLength(
3597 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3600 OGRErr addGeometry(std::unique_ptr<OGRGeometry> poNewGeom);
3602 int getNumGeometries()
const;
3604 const OGRPolygon *getGeometryRef(
int i)
const;
3607 virtual bool setCoordinateDimension(
int nDimension)
override;
3608 virtual bool set3D(
OGRBoolean bIs3D)
override;
3609 virtual bool setMeasured(
OGRBoolean bIsMeasured)
override;
3610 virtual void swapXY()
override;
3611 OGRErr removeGeometry(
int iIndex,
int bDelete = TRUE);
3613 bool hasEmptyParts()
const override;
3614 void removeEmptyParts()
override;
3618 visitor->
visit(
this);
3623 visitor->
visit(
this);
3629 OGR_ALLOW_CAST_TO_THIS(PolyhedralSurface)
3630 OGR_ALLOW_UPCAST_TO(Surface)
3638 return poGeom->
begin();
3645 return poGeom->
end();
3651 return poGeom->
begin();
3657 return poGeom->
end();
3677 virtual const char *getSubGeometryName()
const override;
3680 virtual OGRPolyhedralSurfaceCastToMultiPolygon
3681 GetCasterToMultiPolygon()
const override;
3705 return reinterpret_cast<ChildType **
>(oMP.begin());
3711 return reinterpret_cast<ChildType **
>(oMP.end());
3719 return reinterpret_cast<const ChildType *
const *
>(oMP.begin());
3725 return reinterpret_cast<const ChildType *
const *
>(oMP.end());
3728 virtual const char *getGeometryName()
const override;
3765 visitor->
visit(
this);
3770 visitor->
visit(
this);
3776 OGR_ALLOW_CAST_TO_THIS(TriangulatedSurface)
3777 OGR_ALLOW_UPCAST_TO(PolyhedralSurface)
3785 return poGeom->
begin();
3792 return poGeom->
end();
3798 return poGeom->
begin();
3804 return poGeom->
end();
3820 OGRErr importFromWkt_Bracketed(
const char **,
int bHasM,
int bHasZ);
3845 return reinterpret_cast<ChildType **
>(papoGeoms);
3851 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3859 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3865 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3883 virtual const char *getGeometryName()
const override;
3891 OGRErr importFromWkt(
const char **)
override;
3902 OGRErr *err =
nullptr)
const override;
3905 virtual int getDimension()
const override;
3921 visitor->
visit(
this);
3926 visitor->
visit(
this);
3931 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3933 OGR_ALLOW_CAST_TO_THIS(MultiPoint)
3934 OGR_ALLOW_UPCAST_TO(GeometryCollection)
3935 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING
3936 OGR_FORBID_DOWNCAST_TO_MULTICURVE
3937 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
3938 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
3945 return poGeom->
begin();
3951 return poGeom->
end();
3957 return poGeom->
begin();
3963 return poGeom->
end();
4007 return reinterpret_cast<ChildType **
>(papoGeoms);
4013 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
4021 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
4027 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
4045 virtual const char *getGeometryName()
const override;
4053 OGRErr importFromWkt(
const char **)
override;
4064 OGRErr *err =
nullptr)
const override;
4067 virtual int getDimension()
const override;
4071 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
4087 visitor->
visit(
this);
4092 visitor->
visit(
this);
4097 OGR_ALLOW_CAST_TO_THIS(MultiCurve)
4098 OGR_ALLOW_UPCAST_TO(GeometryCollection)
4099 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
4100 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
4101 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
4108 return poGeom->
begin();
4114 return poGeom->
end();
4120 return poGeom->
begin();
4126 return poGeom->
end();
4164 return reinterpret_cast<ChildType **
>(papoGeoms);
4170 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
4178 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
4184 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
4202 virtual const char *getGeometryName()
const override;
4211 size_t &nBytesConsumedOut)
override;
4218 OGRErr *err =
nullptr)
const override;
4222 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
4238 visitor->
visit(
this);
4243 visitor->
visit(
this);
4248 OGR_ALLOW_CAST_TO_THIS(MultiLineString)
4249 OGR_ALLOW_UPCAST_TO(MultiCurve)
4250 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
4251 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
4252 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
4260 return poGeom->
begin();
4267 return poGeom->
end();
4273 return poGeom->
begin();
4279 return poGeom->
end();
4294 static OGRErr createFromFgfInternal(
const unsigned char *pabyData,
4297 int *pnBytesConsumed,
int nRecLevel);
4302 size_t =
static_cast<size_t>(-1),
4304 static OGRErr createFromWkb(
const void *pabyData,
4307 size_t &nBytesConsumedOut);
4312 static std::pair<std::unique_ptr<OGRGeometry>,
OGRErr>
4321 CPL_WARN_DEPRECATED(
"Use createFromWkt(const char**, ...) instead")
4323 return createFromWkt(
const_cast<const char **
>(ppszInput), poSRS,
4331 static OGRGeometry *createFromGeoJson(
const char *,
int = -1);
4339 bool bOnlyInOrder =
true);
4346 const char *
const *papszOptions =
nullptr);
4352 int *pbResultValidGeometry,
4353 const char **papszOptions =
nullptr);
4354 static bool haveGEOS();
4361 std::unique_ptr<Private> d;
4369 static bool isTransformWithOptionsRegularTransform(
4376 char **papszOptions,
4379 static double GetDefaultArcStepSize();
4382 approximateArcAngles(
double dfX,
double dfY,
double dfZ,
4383 double dfPrimaryRadius,
double dfSecondaryAxis,
4384 double dfRotation,
double dfStartAngle,
4385 double dfEndAngle,
double dfMaxAngleStepSizeDegrees,
4386 const bool bUseMaxGap =
false);
4388 static int GetCurveParameters(
double x0,
double y0,
double x1,
double y1,
4389 double x2,
double y2,
double &R,
double &cx,
4390 double &cy,
double &alpha0,
double &alpha1,
4393 curveToLineString(
double x0,
double y0,
double z0,
double x1,
double y1,
4394 double z1,
double x2,
double y2,
double z2,
int bHasZ,
4395 double dfMaxAngleStepSizeDegrees,
4396 const char *
const *papszOptions =
nullptr);
4399 const char *
const *papszOptions =
nullptr);
4404 bool bCamelCase =
false,
4405 bool bAddZM =
false,
4406 bool bSpaceBeforeZM =
false);
4409typedef struct _OGRPreparedGeometry OGRPreparedGeometry;
4411struct CPL_DLL OGRPreparedGeometryUniquePtrDeleter
4413 void operator()(OGRPreparedGeometry *)
const;
4421typedef std::unique_ptr<OGRPreparedGeometry,
4422 OGRPreparedGeometryUniquePtrDeleter>
The CPLJSONArray class holds JSON object from CPLJSONDocument.
Definition cpl_json.h:41
OGRGeometry visitor interface.
Definition ogr_geometry.h:225
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:149
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:1966
OGRCircularString()=default
Create an empty circular string.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2056
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:2051
OGRCircularString(const OGRCircularString &other)
Copy constructor.
OGRSimpleCurve * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:2045
OGRCircularString & operator=(OGRCircularString &&other)=default
Move assignment operator.
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2061
OGRCircularString(OGRCircularString &&other)=default
Move constructor.
Utility class to store a collection of curves.
Definition ogr_geometry.h:2202
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2368
const ChildType *const * end() const
Return end of curve iterator.
Definition ogr_geometry.h:2267
OGRCompoundCurve()=default
Create an empty compound curve.
const ChildType *const * begin() const
Return begin of curve iterator.
Definition ogr_geometry.h:2261
OGRCompoundCurve(const OGRCompoundCurve &other)
Copy constructor.
OGRCurve ChildType
Type of child elements.
Definition ogr_geometry.h:2242
OGRCompoundCurve(OGRCompoundCurve &&other)=default
Move constructor.
ChildType ** end()
Return end of curve iterator.
Definition ogr_geometry.h:2253
OGRCompoundCurve & operator=(OGRCompoundCurve &&other)=default
Move assignment operator.
ChildType ** begin()
Return begin of curve iterator.
Definition ogr_geometry.h:2247
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2363
Concrete class representing curve polygons.
Definition ogr_geometry.h:2472
OGRCurvePolygon()=default
Create an empty curve polygon.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2630
OGRCurvePolygon & operator=(OGRCurvePolygon &&other)=default
Move assignment operator.
OGRCurve ChildType
Type of child elements.
Definition ogr_geometry.h:2515
OGRCurvePolygon(OGRCurvePolygon &&)=default
Move constructor.
const ChildType *const * end() const
Return end of curve iterator.
Definition ogr_geometry.h:2540
const ChildType *const * begin() const
Return begin of curve iterator.
Definition ogr_geometry.h:2534
ChildType ** begin()
Return begin of curve iterator.
Definition ogr_geometry.h:2520
ChildType ** end()
Return end of curve iterator.
Definition ogr_geometry.h:2526
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2635
OGRCurvePolygon(const OGRCurvePolygon &)
Copy constructor.
Abstract curve base class for OGRLineString, OGRCircularString and OGRCompoundCurve.
Definition ogr_geometry.h:1321
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:1415
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:1364
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:1407
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:272
void visit(const OGRPoint *) override
Visit OGRPoint.
Definition ogr_geometry.h:276
OGRGeometry visitor default implementation.
Definition ogr_geometry.h:196
void visit(OGRPoint *) override
Visit OGRPoint.
Definition ogr_geometry.h:200
Simple container for a bounding region in 3D.
Definition ogr_core.h:199
Simple container for a bounding region (rectangle)
Definition ogr_core.h:44
A collection of 1 or more geometry objects.
Definition ogr_geometry.h:2959
ChildType ** end()
Return end of sub-geometry iterator.
Definition ogr_geometry.h:3003
OGRGeometryCollection()=default
Create an empty geometry collection.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3103
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3108
const ChildType *const * begin() const
Return begin of sub-geometry iterator.
Definition ogr_geometry.h:3011
const ChildType *const * end() const
Return end of sub-geometry iterator.
Definition ogr_geometry.h:3017
ChildType ** begin()
Return begin of sub-geometry iterator.
Definition ogr_geometry.h:2997
OGRGeometry * getGeometryRef(int)
Fetch geometry from container.
Definition ogrgeometrycollection.cpp:303
OGRGeometry ChildType
Type of child elements.
Definition ogr_geometry.h:2992
Create geometry objects from well known text/binary.
Definition ogr_geometry.h:4293
static OGRErr createFromWkt(char **ppszInput, const OGRSpatialReference *poSRS, OGRGeometry **ppoGeom)
Deprecated.
Definition ogr_geometry.h:4318
Abstract base class for all geometry classes.
Definition ogr_geometry.h:360
const OGRSurface * toSurface() const
Down-cast to OGRSurface*.
Definition ogr_geometry.h:803
const OGRCurvePolygon * toCurvePolygon() const
Down-cast to OGRCurvePolygon*.
Definition ogr_geometry.h:861
const OGRMultiCurve * toMultiCurve() const
Down-cast to OGRMultiCurve*.
Definition ogr_geometry.h:961
const OGRPolyhedralSurface * toPolyhedralSurface() const
Down-cast to OGRPolyhedralSurface*.
Definition ogr_geometry.h:1001
const OGRMultiPoint * toMultiPoint() const
Down-cast to OGRMultiPoint*.
Definition ogr_geometry.h:901
virtual void empty()=0
Clear geometry information.
const OGRMultiPolygon * toMultiPolygon() const
Down-cast to OGRMultiPolygon*.
Definition ogr_geometry.h:941
virtual OGRBoolean Equals(const OGRGeometry *) const =0
Returns TRUE if two geometries are equivalent.
OGRPolyhedralSurface * toPolyhedralSurface()
Down-cast to OGRPolyhedralSurface*.
Definition ogr_geometry.h:991
const OGRMultiSurface * toMultiSurface() const
Down-cast to OGRMultiSurface*.
Definition ogr_geometry.h:981
OGRPoint * toPoint()
Down-cast to OGRPoint*.
Definition ogr_geometry.h:656
bool operator!=(const OGRGeometry &other) const
Returns if two geometries are different.
Definition ogr_geometry.h:422
OGRTriangle * toTriangle()
Down-cast to OGRTriangle*.
Definition ogr_geometry.h:832
OGRLineString * toLineString()
Down-cast to OGRLineString*.
Definition ogr_geometry.h:715
const OGRLinearRing * toLinearRing() const
Down-cast to OGRLinearRing*.
Definition ogr_geometry.h:743
const OGRPoint * toPoint() const
Down-cast to OGRPoint*.
Definition ogr_geometry.h:665
OGRMultiLineString * toMultiLineString()
Down-cast to OGRMultiLineString*.
Definition ogr_geometry.h:911
OGRMultiSurface * toMultiSurface()
Down-cast to OGRMultiSurface*.
Definition ogr_geometry.h:971
static OGRGeometry * FromHandle(OGRGeometryH hGeom)
Convert a OGRGeometryH to a OGRGeometry*.
Definition ogr_geometry.h:647
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:881
const OGRMultiLineString * toMultiLineString() const
Down-cast to OGRMultiLineString*.
Definition ogr_geometry.h:921
const OGRCircularString * toCircularString() const
Down-cast to OGRCircularString*.
Definition ogr_geometry.h:763
OGRPolygon * toPolygon()
Down-cast to OGRPolygon*.
Definition ogr_geometry.h:813
bool operator==(const OGRGeometry &other) const
Returns if two geometries are equal.
Definition ogr_geometry.h:416
OGRLinearRing * toLinearRing()
Down-cast to OGRLinearRing*.
Definition ogr_geometry.h:734
OGRBoolean IsMeasured() const
Definition ogr_geometry.h:444
virtual void accept(IOGRGeometryVisitor *visitor)=0
Accept a visitor.
OGRMultiCurve * toMultiCurve()
Down-cast to OGRMultiCurve*.
Definition ogr_geometry.h:951
const OGRCompoundCurve * toCompoundCurve() const
Down-cast to OGRCompoundCurve*.
Definition ogr_geometry.h:783
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:871
virtual const char * getGeometryName() const =0
Fetch WKT name for geometry type.
OGRMultiPolygon * toMultiPolygon()
Down-cast to OGRMultiPolygon*.
Definition ogr_geometry.h:931
const OGRPolygon * toPolygon() const
Down-cast to OGRPolygon*.
Definition ogr_geometry.h:823
OGRCompoundCurve * toCompoundCurve()
Down-cast to OGRCompoundCurve*.
Definition ogr_geometry.h:773
OGRErr importFromWkt(char **ppszInput)
Deprecated.
Definition ogr_geometry.h:471
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:725
OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const
Convert a geometry into well known text format.
Definition ogrgeometry.cpp:1983
OGRCircularString * toCircularString()
Down-cast to OGRCircularString*.
Definition ogr_geometry.h:753
const OGRCurve * toCurve() const
Down-cast to OGRCurve*.
Definition ogr_geometry.h:685
OGRCurvePolygon * toCurvePolygon()
Down-cast to OGRCurvePolygon*.
Definition ogr_geometry.h:851
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:705
static OGRGeometryH ToHandle(OGRGeometry *poGeom)
Convert a OGRGeometry* to a OGRGeometryH.
Definition ogr_geometry.h:639
OGRBoolean Is3D() const
Definition ogr_geometry.h:438
OGRMultiPoint * toMultiPoint()
Down-cast to OGRMultiPoint*.
Definition ogr_geometry.h:891
const OGRTriangulatedSurface * toTriangulatedSurface() const
Down-cast to OGRTriangulatedSurface*.
Definition ogr_geometry.h:1019
const OGRTriangle * toTriangle() const
Down-cast to OGRTriangle*.
Definition ogr_geometry.h:841
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:793
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:695
OGRTriangulatedSurface * toTriangulatedSurface()
Down-cast to OGRTriangulatedSurface*.
Definition ogr_geometry.h:1010
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:675
Definition ogr_geometry.h:1471
Concrete representation of a multi-vertex line.
Definition ogr_geometry.h:1770
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:1814
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:1830
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:1825
OGRLineString(const OGRLineString &other)
Copy constructor.
OGRLineString(OGRLineString &&other)
Move 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:1820
OGRLineString()=default
Create an empty line string.
Concrete representation of a closed ring.
Definition ogr_geometry.h:1864
OGRLinearRing()=default
Constructor.
OGRLinearRing & operator=(OGRLinearRing &&other)=default
Move assignment operator.
const OGRLineString * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:1930
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:1940
OGRLinearRing(const OGRLinearRing &other)
Copy constructor.
OGRLinearRing(OGRLinearRing &&other)=default
Move constructor.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:1935
A collection of OGRCurve.
Definition ogr_geometry.h:3979
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:4019
OGRMultiCurve()=default
Create an empty multi curve collection.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:4025
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:4090
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:4011
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:4080
OGRMultiCurve & operator=(OGRMultiCurve &&other)=default
Move assignment operator.
const OGRCurve * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:4039
OGRCurve * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:4033
OGRMultiCurve(const OGRMultiCurve &other)
Copy constructor.
OGRCurve ChildType
Type of child elements.
Definition ogr_geometry.h:4000
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:4005
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:4074
OGRMultiCurve(OGRMultiCurve &&other)=default
Move constructor.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:4085
A collection of OGRLineString.
Definition ogr_geometry.h:4140
OGRLineString ChildType
Type of child elements.
Definition ogr_geometry.h:4157
OGRLineString * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:4190
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:4225
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:4168
OGRMultiLineString()=default
Create an empty multi line string collection.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:4182
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:4241
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:4176
OGRMultiLineString(OGRMultiLineString &&other)=default
Move constructor.
const OGRLineString * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:4196
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:4236
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:4162
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:4231
OGRMultiLineString & operator=(OGRMultiLineString &&other)=default
Move assignment operator.
OGRMultiLineString(const OGRMultiLineString &other)
Copy constructor.
A collection of OGRPoint.
Definition ogr_geometry.h:3818
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3908
OGRMultiPoint & operator=(OGRMultiPoint &&other)=default
Move assignment operator.
OGRMultiPoint()=default
Create an empty multi point collection.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3919
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3863
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3843
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3924
OGRMultiPoint(const OGRMultiPoint &other)
Copy constructor.
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3857
OGRMultiPoint(OGRMultiPoint &&other)=default
Move constructor.
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3914
OGRPoint ChildType
Type of child elements.
Definition ogr_geometry.h:3838
const OGRPoint * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3877
OGRPoint * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3871
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3849
A collection of non-overlapping OGRPolygon.
Definition ogr_geometry.h:3324
OGRPolygon ChildType
Type of child elements.
Definition ogr_geometry.h:3351
OGRMultiPolygon(const OGRMultiPolygon &other)
Copy constructor.
OGRMultiPolygon & operator=(OGRMultiPolygon &&other)=default
Move assignment operator.
OGRPolygon * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3384
OGRMultiPolygon()=default
Create an empty multi polygon collection.
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3435
const OGRPolygon * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3390
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3376
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3362
OGRMultiPolygon(OGRMultiPolygon &&other)=default
Move constructor.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3430
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3356
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3419
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3370
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3425
A collection of non-overlapping OGRSurface.
Definition ogr_geometry.h:3162
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3267
const OGRSurface * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3246
OGRMultiSurface & operator=(OGRMultiSurface &&other)=default
Move assignment operator.
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3184
OGRSurface ChildType
Type of child elements.
Definition ogr_geometry.h:3179
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3262
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3198
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3204
OGRMultiSurface(const OGRMultiSurface &other)
Copy constructor.
OGRMultiSurface()=default
Create an empty multi surface collection.
OGRMultiSurface(OGRMultiSurface &&other)=default
Move constructor.
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3190
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3272
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3256
OGRSurface * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3240
Interface for a point iterator.
Definition ogr_geometry.h:1303
virtual OGRBoolean getNextPoint(OGRPoint *p)=0
Returns the next point followed by the iterator.
Point class.
Definition ogr_geometry.h:1137
double getM() const
Return m.
Definition ogr_geometry.h:1213
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:1274
void setX(double xIn)
Set x.
Definition ogr_geometry.h:1224
OGRPoint(const OGRPoint &other)
Copy constructor.
OGRPoint & operator=(OGRPoint &&other)=default
Move assignment operator.
void setZ(double zIn)
Set z.
Definition ogr_geometry.h:1248
void setM(double mIn)
Set m.
Definition ogr_geometry.h:1257
double getX() const
Return x.
Definition ogr_geometry.h:1195
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:1279
void setY(double yIn)
Set y.
Definition ogr_geometry.h:1236
virtual OGRBoolean IsEmpty() const override
Returns TRUE (non-zero) if the object has no points.
Definition ogr_geometry.h:1188
double getZ() const
Return z.
Definition ogr_geometry.h:1207
double getY() const
Return y.
Definition ogr_geometry.h:1201
OGRPoint(OGRPoint &&other)=default
Move constructor.
Concrete class representing polygons.
Definition ogr_geometry.h:2692
OGRPolygon & operator=(OGRPolygon &&other)=default
Move assignment operator.
OGRLinearRing ChildType
Type of child elements.
Definition ogr_geometry.h:2732
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:2737
OGRPolygon(OGRPolygon &&other)=default
Move constructor.
const OGRCurvePolygon * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:2820
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:2743
OGRPolygon(const OGRPolygon &other)
Copy constructor.
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:2751
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2830
OGRPolygon()=default
Create an empty polygon.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:2757
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2825
OGRCurvePolygon * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:2814
PolyhedralSurface class.
Definition ogr_geometry.h:3486
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3529
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3543
OGRPolyhedralSurface(const OGRPolyhedralSurface &other)
Copy constructor.
OGRPolygon * getGeometryRef(int i)
Fetch geometry from container.
Definition ogrpolyhedralsurface.cpp:862
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3537
OGRPolyhedralSurface(OGRPolyhedralSurface &&other)=default
Move constructor.
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3523
OGRPolyhedralSurface()=default
Create an empty PolyhedralSurface.
virtual OGRErr addGeometry(const OGRGeometry *)
Add a new geometry to a collection.
Definition ogrpolyhedralsurface.cpp:744
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3616
OGRPolygon ChildType
Type of child elements.
Definition ogr_geometry.h:3518
OGRPolyhedralSurface & operator=(OGRPolyhedralSurface &&other)=default
Move assignment operator.
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3621
Simple container for a position.
Definition ogr_geometry.h:89
OGRRawPoint(double xIn, double yIn)
Constructor.
Definition ogr_geometry.h:97
double x
x
Definition ogr_geometry.h:102
double y
y
Definition ogr_geometry.h:104
OGRRawPoint()
Constructor.
Definition ogr_geometry.h:92
Abstract curve base class for OGRLineString and OGRCircularString.
Definition ogr_geometry.h:1515
double getY(int i) const
Get Y at vertex.
Definition ogr_geometry.h:1670
double getX(int i) const
Get X at vertex.
Definition ogr_geometry.h:1665
OGRSimpleCurve()=default
Constructor.
OGRPoint ChildType
Type of child elements.
Definition ogr_geometry.h:1592
virtual OGRSimpleCurve * clone() const override=0
Make a copy of this object.
virtual int getNumPoints() const override
Fetch vertex count.
Definition ogr_geometry.h:1658
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition ogr_spatialref.h:152
Abstract base class for 2 dimensional objects like polygons or curve polygons.
Definition ogr_geometry.h:2421
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:2436
Triangle class.
Definition ogr_geometry.h:2879
OGRTriangle()=default
Constructor.
const OGRPolygon * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:2924
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2929
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2934
OGRTriangle(OGRTriangle &&other)=default
Move constructor.
OGRPolygon * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:2918
OGRTriangle & operator=(OGRTriangle &&other)=default
Move assignment operator.
OGRTriangle(const OGRTriangle &other)
Copy constructor.
TriangulatedSurface class.
Definition ogr_geometry.h:3673
const OGRTriangle * getGeometryRef(int i) const
See OGRPolyhedralSurface::getGeometryRef()
Definition ogr_geometry.h:3739
OGRTriangle * getGeometryRef(int i)
See OGRPolyhedralSurface::getGeometryRef()
Definition ogr_geometry.h:3733
OGRTriangulatedSurface(OGRTriangulatedSurface &&other)=default
Move constructor.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3723
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3717
OGRPolyhedralSurface * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3752
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3763
const OGRPolyhedralSurface * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3758
OGRTriangulatedSurface & operator=(OGRTriangulatedSurface &&other)=default
Move assignment operator.
OGRTriangle ChildType
Type of child elements.
Definition ogr_geometry.h:3698
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3768
OGRTriangulatedSurface()=default
Constructor.
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3703
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3709
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:962
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1111
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition cpl_port.h:896
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:175
Forward definitions of GDAL/OGR/OSR C handle types.
void * OGRGeometryH
Opaque type for a geometry.
Definition gdal_fwd.h:93
Core portability services for cross-platform OGR code.
int OGRBoolean
Type for a OGR boolean.
Definition ogr_core.h:387
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:544
@ wkbVariantOldOgc
Old-style 99-402 extended dimension (Z) WKB types.
Definition ogr_core.h:545
OGRwkbGeometryType
List of well known binary geometry types.
Definition ogr_core.h:406
int OGRErr
Type for a OGR error.
Definition ogr_core.h:370
Geometry coordinate precision class.
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:2626
OGRWktFormat
WKT Output formatting options.
Definition ogr_geometry.h:38
@ 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:4423
struct GEOSContextHandle_HS * GEOSContextHandle_t
GEOS context handle type.
Definition ogr_geometry.h:110
OGRwkbGeometryType OGRFromOGCGeomType(const char *pszGeomType)
Map OGC geometry format type to corresponding OGR constants.
Definition ogrgeometry.cpp:2547
std::unique_ptr< OGRGeometry, OGRGeometryUniquePtrDeleter > OGRGeometryUniquePtr
Unique pointer type for OGRGeometry.
Definition ogr_geometry.h:1037
struct GEOSGeom_t * GEOSGeom
GEOS geometry type.
Definition ogr_geometry.h:108
void sfcgal_geometry_t
SFCGAL geometry type.
Definition ogr_geometry.h:112
Coordinate systems services.
OGRLayer::FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition ogrsf_frmts.h:467
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition ogrsf_frmts.h:475
Geometry coordinate precision for a binary representation.
Definition ogr_geometry.h:306
Geometry coordinate precision.
Definition ogr_geomcoordinateprecision.h:40
Options for formatting WKT output.
Definition ogr_geometry.h:46
int mPrecision
Precision of output for M coordinates. Interpretation depends on format.
Definition ogr_geometry.h:55
int zPrecision
Precision of output for Z coordinates. Interpretation depends on format.
Definition ogr_geometry.h:53
OGRWktOptions()
Constructor.
Definition ogr_geometry.h:62
OGRWktOptions(const OGRWktOptions &)=default
Copy constructor.
int xyPrecision
Precision of output for X,Y coordinates. Interpretation depends on format.
Definition ogr_geometry.h:51
bool round
Whether GDAL-special rounding should be applied.
Definition ogr_geometry.h:57
OGRWktOptions(int xyPrecisionIn, bool roundIn)
Constructor.
Definition ogr_geometry.h:69
WKB export options.
Definition ogr_geometry.h:329