32 #ifndef OGR_GEOMETRY_H_INCLUDED
33 #define OGR_GEOMETRY_H_INCLUDED
38 #include "ogr_geomcoordinateprecision.h"
52 #ifndef DEFINEH_OGRGeometryH
53 #define DEFINEH_OGRGeometryH
83 bool round = getDefaultRound();
89 : xyPrecision(getDefaultPrecision()), zPrecision(xyPrecision),
90 mPrecision(zPrecision)
98 static int getDefaultPrecision();
99 static bool getDefaultRound();
324 int nXYBitPrecision =
383 friend class OGRCurveCollection;
385 unsigned int flags = 0;
387 OGRErr importPreambleFromWkt(
const char **ppszInput,
int *pbHasZ,
388 int *pbHasM,
bool *pbIsEmpty);
389 OGRErr importCurveCollectionFromWkt(
390 const char **ppszInput,
int bAllowEmptyComponent,
int bAllowLineString,
391 int bAllowCurve,
int bAllowCompoundCurve,
393 OGRErr importPreambleFromWkb(
const unsigned char *pabyData,
size_t nSize,
396 OGRErr importPreambleOfCollectionFromWkb(
const unsigned char *pabyData,
397 size_t &nSize,
size_t &nDataOffset,
399 size_t nMinSubGeomSize,
405 void HomogenizeDimensionalityWith(
OGRGeometry *poOtherGeom);
419 static const unsigned int OGR_G_NOT_EMPTY_POINT = 0x1;
420 static const unsigned int OGR_G_3D = 0x2;
421 static const unsigned int OGR_G_MEASURED = 0x4;
433 return CPL_TO_BOOL(Equals(&other));
439 return !CPL_TO_BOOL(Equals(&other));
444 virtual int getCoordinateDimension()
const;
445 int CoordinateDimension()
const;
455 return (flags & OGR_G_3D) != 0;
461 return (flags & OGR_G_MEASURED) != 0;
471 virtual
size_t WkbSize() const = 0;
472 OGRErr importFromWkb(const
GByte *,
size_t = static_cast<
size_t>(-1),
475 size_t &nBytesConsumedOut) = 0;
478 virtual
OGRErr exportToWkb(
unsigned char *,
480 virtual
OGRErr importFromWkt(const
char **ppszInput) = 0;
488 CPL_WARN_DEPRECATED(
"Use importFromWkt(const char**) instead")
491 return importFromWkt(
const_cast<const char **
>(ppszInput));
495 OGRErr exportToWkt(
char **ppszDstText,
503 OGRErr *err =
nullptr)
const = 0;
509 void dumpReadable(FILE *,
const char * =
nullptr,
511 std::string dumpReadable(
const char * =
nullptr,
514 virtual char *exportToGML(
const char *
const *papszOptions =
nullptr)
const;
515 virtual char *exportToKML()
const;
516 virtual char *exportToJson(
CSLConstList papszOptions =
nullptr)
const;
529 virtual
OGRBoolean hasCurveGeometry(
int bLookForNonLinear = FALSE) const;
533 double dfMaxAngleStepSizeDegrees = 0,
545 virtual
void closeRings();
547 virtual
void setCoordinateDimension(
int nDimension);
549 virtual
void setMeasured(
OGRBoolean bIsMeasured);
561 virtual void segmentize(
double dfMaxLength);
578 virtual
double Distance(const
OGRGeometry *) const;
585 BufferEx(
double dfDistance,
603 DelaunayTriangulation(
double dfTolerance,
608 virtual
double Distance3D(const
OGRGeometry *poOtherGeom) const;
610 OGRGeometry *SetPrecision(
double dfGridSize,
int nFlags) const;
612 virtual
bool hasEmptyParts() const;
613 virtual
void removeEmptyParts();
618 CPL_WARN_DEPRECATED("Non standard method. "
619 "Use Intersects() instead");
621 CPL_WARN_DEPRECATED("Non standard method. "
622 "Use Equals() instead");
624 CPL_WARN_DEPRECATED("Non standard method. "
625 "Use SymDifference() instead");
627 CPL_WARN_DEPRECATED("Non standard method. "
628 "Use Boundary() instead");
633 static
int bGenerate_DB2_V72_BYTE_ORDER;
636 virtual
void swapXY();
638 bool IsRectangle() const;
672 return cpl::down_cast<OGRPoint *>(
this);
681 return cpl::down_cast<const OGRPoint *>(
this);
691 return cpl::down_cast<OGRCurve *>(
this);
701 return cpl::down_cast<const OGRCurve *>(
this);
711 return cpl::down_cast<OGRSimpleCurve *>(
this);
721 return cpl::down_cast<const OGRSimpleCurve *>(
this);
731 return cpl::down_cast<OGRLineString *>(
this);
741 return cpl::down_cast<const OGRLineString *>(
this);
750 return cpl::down_cast<OGRLinearRing *>(
this);
759 return cpl::down_cast<const OGRLinearRing *>(
this);
769 return cpl::down_cast<OGRCircularString *>(
this);
779 return cpl::down_cast<const OGRCircularString *>(
this);
789 return cpl::down_cast<OGRCompoundCurve *>(
this);
799 return cpl::down_cast<const OGRCompoundCurve *>(
this);
809 return cpl::down_cast<OGRSurface *>(
this);
819 return cpl::down_cast<const OGRSurface *>(
this);
829 return cpl::down_cast<OGRPolygon *>(
this);
839 return cpl::down_cast<const OGRPolygon *>(
this);
848 return cpl::down_cast<OGRTriangle *>(
this);
857 return cpl::down_cast<const OGRTriangle *>(
this);
867 return cpl::down_cast<OGRCurvePolygon *>(
this);
877 return cpl::down_cast<const OGRCurvePolygon *>(
this);
887 return cpl::down_cast<OGRGeometryCollection *>(
this);
897 return cpl::down_cast<const OGRGeometryCollection *>(
this);
907 return cpl::down_cast<OGRMultiPoint *>(
this);
917 return cpl::down_cast<const OGRMultiPoint *>(
this);
927 return cpl::down_cast<OGRMultiLineString *>(
this);
937 return cpl::down_cast<const OGRMultiLineString *>(
this);
947 return cpl::down_cast<OGRMultiPolygon *>(
this);
957 return cpl::down_cast<const OGRMultiPolygon *>(
this);
967 return cpl::down_cast<OGRMultiCurve *>(
this);
977 return cpl::down_cast<const OGRMultiCurve *>(
this);
987 return cpl::down_cast<OGRMultiSurface *>(
this);
997 return cpl::down_cast<const OGRMultiSurface *>(
this);
1007 return cpl::down_cast<OGRPolyhedralSurface *>(
this);
1017 return cpl::down_cast<const OGRPolyhedralSurface *>(
this);
1026 return cpl::down_cast<OGRTriangulatedSurface *>(
this);
1035 return cpl::down_cast<const OGRTriangulatedSurface *>(
this);
1040 struct CPL_DLL OGRGeometryUniquePtrDeleter
1050 typedef std::unique_ptr<OGRGeometry, OGRGeometryUniquePtrDeleter>
1054 #define OGR_FORBID_DOWNCAST_TO(name) \
1055 inline OGR##name *to##name() = delete; \
1056 inline const OGR##name *to##name() const = delete;
1058 #define OGR_FORBID_DOWNCAST_TO_POINT OGR_FORBID_DOWNCAST_TO(Point)
1059 #define OGR_FORBID_DOWNCAST_TO_CURVE OGR_FORBID_DOWNCAST_TO(Curve)
1060 #define OGR_FORBID_DOWNCAST_TO_SIMPLE_CURVE OGR_FORBID_DOWNCAST_TO(SimpleCurve)
1061 #define OGR_FORBID_DOWNCAST_TO_LINESTRING OGR_FORBID_DOWNCAST_TO(LineString)
1062 #define OGR_FORBID_DOWNCAST_TO_LINEARRING OGR_FORBID_DOWNCAST_TO(LinearRing)
1063 #define OGR_FORBID_DOWNCAST_TO_CIRCULARSTRING \
1064 OGR_FORBID_DOWNCAST_TO(CircularString)
1065 #define OGR_FORBID_DOWNCAST_TO_COMPOUNDCURVE \
1066 OGR_FORBID_DOWNCAST_TO(CompoundCurve)
1067 #define OGR_FORBID_DOWNCAST_TO_SURFACE OGR_FORBID_DOWNCAST_TO(Surface)
1068 #define OGR_FORBID_DOWNCAST_TO_CURVEPOLYGON OGR_FORBID_DOWNCAST_TO(CurvePolygon)
1069 #define OGR_FORBID_DOWNCAST_TO_POLYGON OGR_FORBID_DOWNCAST_TO(Polygon)
1070 #define OGR_FORBID_DOWNCAST_TO_TRIANGLE OGR_FORBID_DOWNCAST_TO(Triangle)
1071 #define OGR_FORBID_DOWNCAST_TO_MULTIPOINT OGR_FORBID_DOWNCAST_TO(MultiPoint)
1072 #define OGR_FORBID_DOWNCAST_TO_MULTICURVE OGR_FORBID_DOWNCAST_TO(MultiCurve)
1073 #define OGR_FORBID_DOWNCAST_TO_MULTILINESTRING \
1074 OGR_FORBID_DOWNCAST_TO(MultiLineString)
1075 #define OGR_FORBID_DOWNCAST_TO_MULTISURFACE OGR_FORBID_DOWNCAST_TO(MultiSurface)
1076 #define OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON OGR_FORBID_DOWNCAST_TO(MultiPolygon)
1077 #define OGR_FORBID_DOWNCAST_TO_GEOMETRYCOLLECTION \
1078 OGR_FORBID_DOWNCAST_TO(GeometryCollection)
1079 #define OGR_FORBID_DOWNCAST_TO_POLYHEDRALSURFACE \
1080 OGR_FORBID_DOWNCAST_TO(PolyhedralSurface)
1081 #define OGR_FORBID_DOWNCAST_TO_TIN OGR_FORBID_DOWNCAST_TO(TriangulatedSurface)
1083 #define OGR_ALLOW_UPCAST_TO(name) \
1084 inline OGR##name *to##name() \
1088 inline const OGR##name *to##name() const \
1093 #ifndef SUPPRESS_OGR_ALLOW_CAST_TO_THIS_WARNING
1094 #define CAST_TO_THIS_WARNING CPL_WARN_DEPRECATED("Casting to this is useless")
1096 #define CAST_TO_THIS_WARNING
1099 #define OGR_ALLOW_CAST_TO_THIS(name) \
1100 inline OGR##name *to##name() CAST_TO_THIS_WARNING \
1104 inline const OGR##name *to##name() const CAST_TO_THIS_WARNING \
1109 #define OGR_FORBID_DOWNCAST_TO_ALL_CURVES \
1110 OGR_FORBID_DOWNCAST_TO_CURVE \
1111 OGR_FORBID_DOWNCAST_TO_SIMPLE_CURVE \
1112 OGR_FORBID_DOWNCAST_TO_LINESTRING \
1113 OGR_FORBID_DOWNCAST_TO_LINEARRING \
1114 OGR_FORBID_DOWNCAST_TO_CIRCULARSTRING \
1115 OGR_FORBID_DOWNCAST_TO_COMPOUNDCURVE
1117 #define OGR_FORBID_DOWNCAST_TO_ALL_SURFACES \
1118 OGR_FORBID_DOWNCAST_TO_SURFACE \
1119 OGR_FORBID_DOWNCAST_TO_CURVEPOLYGON \
1120 OGR_FORBID_DOWNCAST_TO_POLYGON \
1121 OGR_FORBID_DOWNCAST_TO_TRIANGLE \
1122 OGR_FORBID_DOWNCAST_TO_POLYHEDRALSURFACE \
1123 OGR_FORBID_DOWNCAST_TO_TIN
1125 #define OGR_FORBID_DOWNCAST_TO_ALL_SINGLES \
1126 OGR_FORBID_DOWNCAST_TO_POINT \
1127 OGR_FORBID_DOWNCAST_TO_ALL_CURVES \
1128 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1130 #define OGR_FORBID_DOWNCAST_TO_ALL_MULTI \
1131 OGR_FORBID_DOWNCAST_TO_GEOMETRYCOLLECTION \
1132 OGR_FORBID_DOWNCAST_TO_MULTIPOINT \
1133 OGR_FORBID_DOWNCAST_TO_MULTICURVE \
1134 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING \
1135 OGR_FORBID_DOWNCAST_TO_MULTISURFACE \
1136 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
1160 OGRPoint(
double x,
double y,
double z);
1161 OGRPoint(
double x,
double y,
double z,
double m);
1163 static OGRPoint *createXYM(
double x,
double y,
double m);
1169 size_t WkbSize()
const override;
1171 size_t &nBytesConsumedOut)
override;
1172 OGRErr exportToWkb(
unsigned char *,
1179 OGRErr importFromWkt(
const char **)
override;
1190 OGRErr *err =
nullptr)
const override;
1193 virtual int getDimension()
const override;
1194 virtual OGRPoint *clone()
const override;
1195 virtual void empty()
override;
1196 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
1197 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
1201 return !(flags & OGR_G_NOT_EMPTY_POINT);
1230 virtual void setCoordinateDimension(
int nDimension)
override;
1238 if (std::isnan(x) || std::isnan(y))
1239 flags &= ~OGR_G_NOT_EMPTY_POINT;
1241 flags |= OGR_G_NOT_EMPTY_POINT;
1250 if (std::isnan(x) || std::isnan(y))
1251 flags &= ~OGR_G_NOT_EMPTY_POINT;
1253 flags |= OGR_G_NOT_EMPTY_POINT;
1271 flags |= OGR_G_MEASURED;
1280 virtual const char *getGeometryName()
const override;
1283 virtual void flattenTo2D()
override;
1287 visitor->
visit(
this);
1292 visitor->
visit(
this);
1295 virtual void swapXY()
override;
1297 OGR_ALLOW_CAST_TO_THIS(Point)
1298 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
1299 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1300 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
1338 virtual OGRCurveCasterToLineString GetCasterToLineString()
const = 0;
1339 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const = 0;
1349 class CPL_DLL ConstIterator
1352 std::unique_ptr<Private> m_poPrivate;
1355 ConstIterator(
const OGRCurve *poSelf,
bool bStart);
1356 ConstIterator(ConstIterator &&oOther) noexcept;
1357 ConstIterator &operator=(ConstIterator &&oOther);
1360 ConstIterator &operator++();
1361 bool operator!=(
const ConstIterator &it)
const;
1365 friend inline ConstIterator
end(
const OGRCurve *);
1385 ConstIterator
begin()
const;
1387 ConstIterator
end()
const;
1396 virtual int get_IsClosed()
const;
1400 const char *
const *papszOptions =
nullptr)
const = 0;
1401 virtual int getDimension()
const override;
1410 virtual int isClockwise()
const;
1418 return cpl::down_cast<OGRSimpleCurve *>(
this);
1426 return cpl::down_cast<const OGRSimpleCurve *>(
this);
1433 OGR_FORBID_DOWNCAST_TO_POINT
1434 OGR_ALLOW_CAST_TO_THIS(Curve)
1435 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1436 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
1441 inline OGRCurve::ConstIterator
begin(
const OGRCurve *poCurve)
1443 return poCurve->begin();
1447 inline OGRCurve::ConstIterator
end(
const OGRCurve *poCurve)
1449 return poCurve->end();
1495 void setX(
double xIn);
1499 void setY(
double yIn);
1503 void setZ(
double zIn);
1507 void setM(
double mIn);
1530 int m_nPointCapacity = 0;
1540 OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
int bHasM,
1545 virtual double get_LinearArea()
const;
1551 class CPL_DLL Iterator
1554 std::unique_ptr<Private> m_poPrivate;
1559 Iterator(Iterator &&oOther) noexcept;
1563 Iterator &operator++();
1564 bool operator!=(
const Iterator &it)
const;
1570 class CPL_DLL ConstIterator
1573 std::unique_ptr<Private> m_poPrivate;
1578 ConstIterator &&oOther) noexcept;
1582 ConstIterator &operator++();
1583 bool operator!=(
const ConstIterator &it)
const;
1616 ConstIterator
begin()
const;
1618 ConstIterator
end()
const;
1621 virtual size_t WkbSize()
const override;
1623 size_t &nBytesConsumedOut)
override;
1625 exportToWkb(
unsigned char *,
1632 OGRErr importFromWkt(
const char **)
override;
1643 OGRErr *err =
nullptr)
const override;
1646 virtual void empty()
override;
1647 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
1648 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
1653 virtual double get_Length()
const override;
1654 virtual void StartPoint(
OGRPoint *)
const override;
1655 virtual void EndPoint(
OGRPoint *)
const override;
1656 virtual void Value(
double,
OGRPoint *)
const override;
1657 virtual double Project(
const OGRPoint *)
const;
1658 virtual OGRLineString *getSubLine(
double,
double,
int)
const;
1666 void getPoint(
int,
OGRPoint *)
const;
1670 return paoPoints[i].
x;
1675 return paoPoints[i].
y;
1678 double getZ(
int i)
const;
1679 double getM(
int i)
const;
1685 virtual void setCoordinateDimension(
int nDimension)
override;
1686 virtual void set3D(
OGRBoolean bIs3D)
override;
1687 virtual void setMeasured(
OGRBoolean bIsMeasured)
override;
1688 void setNumPoints(
int nNewPointCount,
int bZeroizeNewContent = TRUE);
1690 void setPoint(
int,
double,
double);
1691 void setZ(
int,
double);
1692 void setM(
int,
double);
1693 void setPoint(
int,
double,
double,
double);
1694 void setPointM(
int,
double,
double,
double);
1695 void setPoint(
int,
double,
double,
double,
double);
1696 void setPoints(
int,
const OGRRawPoint *,
const double * =
nullptr);
1697 void setPointsM(
int,
const OGRRawPoint *,
const double *);
1698 void setPoints(
int,
const OGRRawPoint *,
const double *,
const double *);
1699 void setPoints(
int,
const double *padfX,
const double *padfY,
1700 const double *padfZIn =
nullptr);
1701 void setPointsM(
int,
const double *padfX,
const double *padfY,
1702 const double *padfMIn =
nullptr);
1703 void setPoints(
int,
const double *padfX,
const double *padfY,
1704 const double *padfZIn,
const double *padfMIn);
1706 void addPoint(
double,
double);
1707 void addPoint(
double,
double,
double);
1708 void addPointM(
double,
double,
double);
1709 void addPoint(
double,
double,
double,
double);
1711 bool removePoint(
int);
1713 void getPoints(
OGRRawPoint *,
double * =
nullptr)
const;
1714 void getPoints(
void *pabyX,
int nXStride,
void *pabyY,
int nYStride,
1715 void *pabyZ =
nullptr,
int nZStride = 0,
1716 void *pabyM =
nullptr,
int nMStride = 0)
const;
1718 void addSubLineString(
const OGRLineString *,
int nStartVertex = 0,
1719 int nEndVertex = -1);
1720 void reversePoints()
override;
1725 virtual void flattenTo2D()
override;
1726 virtual void segmentize(
double dfMaxLength)
override;
1728 virtual void swapXY()
override;
1730 OGR_ALLOW_UPCAST_TO(Curve)
1731 OGR_ALLOW_CAST_TO_THIS(SimpleCurve)
1738 return poCurve->begin();
1744 return poCurve->end();
1750 return poCurve->begin();
1756 return poCurve->end();
1782 virtual OGRCurveCasterToLineString GetCasterToLineString()
const override;
1783 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1785 virtual double get_AreaOfCurveSegments()
const override;
1799 CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
1800 const char *
const *papszOptions =
nullptr)
const override;
1802 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
1809 virtual const char *getGeometryName()
const override;
1826 visitor->
visit(
this);
1831 visitor->
visit(
this);
1834 OGR_ALLOW_UPCAST_TO(SimpleCurve)
1835 OGR_ALLOW_CAST_TO_THIS(LineString)
1869 virtual size_t WkbSize()
const override;
1871 size_t &nBytesConsumedOut)
override;
1872 OGRErr exportToWkb(
unsigned char *,
1881 virtual size_t _WkbSize(
int _flags)
const;
1883 const unsigned char *,
size_t,
1884 size_t &nBytesConsumedOut);
1885 virtual OGRErr _exportToWkb(
int _flags,
unsigned char *,
1888 virtual OGRCurveCasterToLineString GetCasterToLineString()
const override;
1889 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1907 void reverseWindingOrder()
1908 CPL_WARN_DEPRECATED("Use reversePoints() instead");
1913 int bTestEnvelope = TRUE) const;
1915 int bTestEnvelope = TRUE) const;
1932 visitor->
visit(
this);
1937 visitor->
visit(
this);
1940 OGR_ALLOW_UPCAST_TO(LineString)
1941 OGR_ALLOW_CAST_TO_THIS(LinearRing)
1963 void ExtendEnvelopeWithCircular(
OGREnvelope *psEnvelope)
const;
1965 int IsFullCircle(
double &cx,
double &cy,
double &square_R)
const;
1969 virtual OGRCurveCasterToLineString GetCasterToLineString()
const override;
1970 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1971 virtual int IntersectsPoint(
const OGRPoint *p)
const override;
1972 virtual int ContainsPoint(
const OGRPoint *p)
const override;
1973 virtual double get_AreaOfCurveSegments()
const override;
1985 size_t &nBytesConsumedOut)
override;
1986 OGRErr exportToWkb(
unsigned char *,
1993 OGRErr importFromWkt(
const char **)
override;
2004 OGRErr *err =
nullptr)
const override;
2008 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
2009 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
2013 virtual double get_Length()
const override;
2015 CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
2016 const char *
const *papszOptions =
nullptr)
const override;
2017 virtual void Value(
double,
OGRPoint *)
const override;
2018 virtual double get_Area()
const override;
2019 virtual double get_GeodesicArea(
2024 virtual const char *getGeometryName()
const override;
2025 virtual void segmentize(
double dfMaxLength)
override;
2027 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2029 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2030 const char *
const *papszOptions =
nullptr)
const override;
2046 visitor->
visit(
this);
2051 visitor->
visit(
this);
2054 OGR_ALLOW_UPCAST_TO(SimpleCurve)
2055 OGR_ALLOW_CAST_TO_THIS(CircularString)
2073 class CPL_DLL OGRCurveCollection
2081 int nCurveCount = 0;
2085 OGRCurveCollection();
2086 OGRCurveCollection(
const OGRCurveCollection &other);
2087 ~OGRCurveCollection();
2089 OGRCurveCollection &
operator=(
const OGRCurveCollection &other);
2105 return papoCurves + nCurveCount;
2119 return papoCurves + nCurveCount;
2131 const unsigned char *pabyData,
size_t &nSize,
2132 size_t &nDataOffset,
2134 size_t nMinSubGeomSize,
2137 importBodyFromWkb(
OGRGeometry *poGeom,
const unsigned char *pabyData,
2138 size_t nSize,
bool bAcceptCompoundCurve,
2152 int getNumCurves()
const;
2154 const OGRCurve *getCurve(
int)
const;
2157 OGRErr removeCurve(
int iIndex,
bool bDelete =
true);
2162 void reversePoints();
2190 OGRCurveCollection oCC{};
2192 OGRErr addCurveDirectlyInternal(
OGRCurve *poCurve,
double dfToleranceEps,
2198 OGRLineString *CurveToLineInternal(
double dfMaxAngleStepSizeDegrees,
2199 const char *
const *papszOptions,
2200 int bIsLinearRing)
const;
2211 virtual OGRCurveCasterToLineString GetCasterToLineString()
const override;
2212 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
2254 virtual size_t WkbSize()
const override;
2256 size_t &nBytesConsumedOut)
override;
2257 OGRErr exportToWkb(
unsigned char *,
2264 OGRErr importFromWkt(
const char **)
override;
2275 OGRErr *err =
nullptr)
const override;
2279 virtual void empty()
override;
2280 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
2281 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
2285 virtual double get_Length()
const override;
2286 virtual void StartPoint(
OGRPoint *)
const override;
2287 virtual void EndPoint(
OGRPoint *)
const override;
2288 virtual void Value(
double,
OGRPoint *)
const override;
2290 CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
2291 const char *
const *papszOptions =
nullptr)
const override;
2293 virtual int getNumPoints()
const override;
2294 virtual double get_AreaOfCurveSegments()
const override;
2295 virtual double get_Area()
const override;
2296 virtual double get_GeodesicArea(
2303 int getNumCurves()
const;
2305 const OGRCurve *getCurve(
int)
const;
2308 virtual void setCoordinateDimension(
int nDimension)
override;
2309 virtual void set3D(
OGRBoolean bIs3D)
override;
2310 virtual void setMeasured(
OGRBoolean bIsMeasured)
override;
2318 static constexpr
double DEFAULT_TOLERANCE_EPSILON = 1e-14;
2321 double dfToleranceEps = DEFAULT_TOLERANCE_EPSILON);
2323 double dfToleranceEps = DEFAULT_TOLERANCE_EPSILON);
2324 OGRErr addCurve(std::unique_ptr<OGRCurve>,
2325 double dfToleranceEps = DEFAULT_TOLERANCE_EPSILON);
2328 void reversePoints()
override;
2332 virtual const char *getGeometryName()
const override;
2334 virtual void flattenTo2D()
override;
2335 virtual void segmentize(
double dfMaxLength)
override;
2337 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2339 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2340 const char *
const *papszOptions =
nullptr)
const override;
2344 visitor->
visit(
this);
2349 visitor->
visit(
this);
2352 virtual void swapXY()
override;
2354 bool hasEmptyParts()
const override;
2355 void removeEmptyParts()
override;
2357 OGR_ALLOW_UPCAST_TO(Curve)
2358 OGR_ALLOW_CAST_TO_THIS(CompoundCurve)
2366 return poCurve->
begin();
2373 return poCurve->
end();
2379 return poCurve->
begin();
2385 return poCurve->
end();
2403 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const = 0;
2404 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
const = 0;
2414 return PointOnSurfaceInternal(poPoint);
2424 OGR_FORBID_DOWNCAST_TO_POINT
2425 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
2426 OGR_ALLOW_CAST_TO_THIS(Surface)
2427 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
2454 virtual int checkRing(
OGRCurve *poNewRing)
const;
2455 OGRErr addRingDirectlyInternal(
OGRCurve *poCurve,
int bNeedRealloc);
2465 OGRCurveCollection oCC{};
2467 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2468 virtual OGRSurfaceCasterToCurvePolygon
2469 GetCasterToCurvePolygon()
const override;
2517 virtual void empty()
override;
2521 virtual void segmentize(
double dfMaxLength)
override;
2526 const char *
const *papszOptions =
nullptr)
const override;
2531 virtual double get_Area()
const override;
2534 virtual size_t WkbSize()
const override;
2536 size_t &nBytesConsumedOut)
override;
2555 OGRErr *err =
nullptr)
const override;
2565 const char *
const *papszOptions =
nullptr)
const;
2596 visitor->
visit(
this);
2601 visitor->
visit(
this);
2604 virtual void swapXY()
override;
2609 OGR_ALLOW_UPCAST_TO(Surface)
2610 OGR_ALLOW_CAST_TO_THIS(CurvePolygon)
2618 return poGeom->
begin();
2625 return poGeom->
end();
2631 return poGeom->
begin();
2637 return poGeom->
end();
2665 virtual int checkRing(
OGRCurve *poNewRing)
const override;
2666 virtual OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
2668 int &nMaxPoints,
double *&padfZ);
2672 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2673 virtual OGRSurfaceCasterToCurvePolygon
2674 GetCasterToCurvePolygon()
const override;
2692 return reinterpret_cast<ChildType **
>(oCC.begin());
2698 return reinterpret_cast<ChildType **
>(oCC.end());
2706 return reinterpret_cast<const ChildType *
const *
>(oCC.begin());
2712 return reinterpret_cast<const ChildType *
const *
>(oCC.end());
2722 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
2725 const char *
const *papszOptions =
nullptr)
const override;
2728 virtual size_t WkbSize()
const override;
2730 size_t &nBytesConsumedOut)
override;
2749 OGRErr *err =
nullptr)
const override;
2753 CurvePolyToPoly(
double dfMaxAngleStepSizeDegrees = 0,
2754 const char *
const *papszOptions =
nullptr)
const override;
2780 visitor->
visit(
this);
2785 visitor->
visit(
this);
2790 OGR_ALLOW_UPCAST_TO(CurvePolygon)
2791 OGR_ALLOW_CAST_TO_THIS(Polygon)
2798 return poGeom->
begin();
2804 return poGeom->
end();
2810 return poGeom->
begin();
2816 return poGeom->
end();
2836 bool quickValidityCheck()
const;
2840 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2841 virtual OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
2844 double *&padfZ)
override;
2854 virtual const char *getGeometryName()
const override;
2860 size_t &nBytesConsumedOut)
override;
2879 visitor->
visit(
this);
2884 visitor->
visit(
this);
2891 OGR_ALLOW_UPCAST_TO(Polygon)
2892 OGR_ALLOW_CAST_TO_THIS(Triangle)
2908 OGRErr importFromWktInternal(
const char **ppszInput,
int nRecLevel);
2917 const std::string &exclude = std::string())
const;
2922 OGRErr importFromWkbInternal(
const unsigned char *pabyData,
size_t nSize,
2924 size_t &nBytesConsumedOut);
2949 return papoGeoms + nGeomCount;
2963 return papoGeoms + nGeomCount;
2967 virtual const char *getGeometryName()
const override;
2970 virtual void empty()
override;
2972 virtual void flattenTo2D()
override;
2974 virtual void segmentize(
double dfMaxLength)
override;
2976 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2978 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
2980 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2981 const char *
const *papszOptions =
nullptr)
const override;
2986 virtual size_t WkbSize()
const override;
2988 size_t &nBytesConsumedOut)
override;
2989 OGRErr exportToWkb(
unsigned char *,
2996 OGRErr importFromWkt(
const char **)
override;
3007 OGRErr *err =
nullptr)
const override;
3009 virtual double get_Length()
const;
3010 virtual double get_Area()
const;
3013 virtual int getDimension()
const override;
3014 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
3015 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
3018 int getNumGeometries()
const;
3026 virtual void setCoordinateDimension(
int nDimension)
override;
3027 virtual void set3D(
OGRBoolean bIs3D)
override;
3028 virtual void setMeasured(
OGRBoolean bIsMeasured)
override;
3031 OGRErr addGeometry(std::unique_ptr<OGRGeometry> geom);
3032 virtual OGRErr removeGeometry(
int iIndex,
int bDelete = TRUE);
3034 bool hasEmptyParts()
const override;
3035 void removeEmptyParts()
override;
3040 void closeRings()
override;
3042 virtual void swapXY()
override;
3046 visitor->
visit(
this);
3051 visitor->
visit(
this);
3057 OGR_FORBID_DOWNCAST_TO_POINT
3058 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
3059 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
3060 OGR_ALLOW_CAST_TO_THIS(GeometryCollection)
3068 return poGeom->
begin();
3075 return poGeom->
end();
3081 return poGeom->
begin();
3087 return poGeom->
end();
3122 return reinterpret_cast<ChildType **
>(papoGeoms);
3128 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3136 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3142 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3147 virtual const char *getGeometryName()
const override;
3155 OGRErr importFromWkt(
const char **)
override;
3166 OGRErr *err =
nullptr)
const override;
3172 virtual int getDimension()
const override;
3189 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3205 visitor->
visit(
this);
3210 visitor->
visit(
this);
3215 OGR_ALLOW_CAST_TO_THIS(MultiSurface)
3216 OGR_ALLOW_UPCAST_TO(GeometryCollection)
3217 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
3218 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING
3219 OGR_FORBID_DOWNCAST_TO_MULTICURVE
3227 return poGeom->
begin();
3234 return poGeom->
end();
3240 return poGeom->
begin();
3246 return poGeom->
end();
3268 OGRErr _addGeometryWithExpectedSubGeometryType(
3270 OGRErr _addGeometryDirectlyWithExpectedSubGeometryType(
3289 return reinterpret_cast<ChildType **
>(papoGeoms);
3295 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3303 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3309 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3336 size_t &nBytesConsumedOut)
override;
3343 OGRErr *err =
nullptr)
const override;
3363 visitor->
visit(
this);
3368 visitor->
visit(
this);
3373 OGR_ALLOW_CAST_TO_THIS(MultiPolygon)
3374 OGR_ALLOW_UPCAST_TO(MultiSurface)
3382 return poGeom->
begin();
3389 return poGeom->
end();
3395 return poGeom->
begin();
3401 return poGeom->
end();
3422 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
3423 virtual OGRSurfaceCasterToCurvePolygon
3424 GetCasterToCurvePolygon()
const override;
3426 virtual const char *getSubGeometryName()
const;
3431 virtual OGRPolyhedralSurfaceCastToMultiPolygon
3432 GetCasterToMultiPolygon()
const;
3474 virtual size_t WkbSize()
const override;
3478 size_t &nBytesConsumedOut)
override;
3497 OGRErr *err =
nullptr)
const override;
3502 virtual void empty()
override;
3511 virtual double get_Area()
const override;
3531 virtual void swapXY()
override;
3539 visitor->
visit(
this);
3544 visitor->
visit(
this);
3550 OGR_ALLOW_CAST_TO_THIS(PolyhedralSurface)
3551 OGR_ALLOW_UPCAST_TO(Surface)
3559 return poGeom->
begin();
3566 return poGeom->
end();
3572 return poGeom->
begin();
3578 return poGeom->
end();
3598 virtual const char *getSubGeometryName()
const override;
3601 virtual OGRPolyhedralSurfaceCastToMultiPolygon
3602 GetCasterToMultiPolygon()
const override;
3619 return reinterpret_cast<ChildType **
>(oMP.begin());
3625 return reinterpret_cast<ChildType **
>(oMP.end());
3633 return reinterpret_cast<const ChildType *
const *
>(oMP.begin());
3639 return reinterpret_cast<const ChildType *
const *
>(oMP.end());
3643 virtual const char *getGeometryName()
const override;
3680 visitor->
visit(
this);
3685 visitor->
visit(
this);
3691 OGR_ALLOW_CAST_TO_THIS(TriangulatedSurface)
3692 OGR_ALLOW_UPCAST_TO(PolyhedralSurface)
3700 return poGeom->
begin();
3707 return poGeom->
end();
3713 return poGeom->
begin();
3719 return poGeom->
end();
3735 OGRErr importFromWkt_Bracketed(
const char **,
int bHasM,
int bHasZ);
3755 return reinterpret_cast<ChildType **
>(papoGeoms);
3761 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3769 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3775 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3793 virtual const char *getGeometryName()
const override;
3801 OGRErr importFromWkt(
const char **)
override;
3812 OGRErr *err =
nullptr)
const override;
3815 virtual int getDimension()
const override;
3831 visitor->
visit(
this);
3836 visitor->
visit(
this);
3841 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3843 OGR_ALLOW_CAST_TO_THIS(MultiPoint)
3844 OGR_ALLOW_UPCAST_TO(GeometryCollection)
3845 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING
3846 OGR_FORBID_DOWNCAST_TO_MULTICURVE
3847 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
3848 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
3855 return poGeom->
begin();
3861 return poGeom->
end();
3867 return poGeom->
begin();
3873 return poGeom->
end();
3912 return reinterpret_cast<ChildType **
>(papoGeoms);
3918 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3926 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3932 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3950 virtual const char *getGeometryName()
const override;
3958 OGRErr importFromWkt(
const char **)
override;
3969 OGRErr *err =
nullptr)
const override;
3972 virtual int getDimension()
const override;
3976 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3992 visitor->
visit(
this);
3997 visitor->
visit(
this);
4002 OGR_ALLOW_CAST_TO_THIS(MultiCurve)
4003 OGR_ALLOW_UPCAST_TO(GeometryCollection)
4004 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
4005 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
4006 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
4013 return poGeom->
begin();
4019 return poGeom->
end();
4025 return poGeom->
begin();
4031 return poGeom->
end();
4064 return reinterpret_cast<ChildType **
>(papoGeoms);
4070 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
4078 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
4084 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
4102 virtual const char *getGeometryName()
const override;
4111 size_t &nBytesConsumedOut)
override;
4118 OGRErr *err =
nullptr)
const override;
4122 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
4138 visitor->
visit(
this);
4143 visitor->
visit(
this);
4148 OGR_ALLOW_CAST_TO_THIS(MultiLineString)
4149 OGR_ALLOW_UPCAST_TO(MultiCurve)
4150 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
4151 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
4152 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
4160 return poGeom->
begin();
4167 return poGeom->
end();
4173 return poGeom->
begin();
4179 return poGeom->
end();
4194 static OGRErr createFromFgfInternal(
const unsigned char *pabyData,
4197 int *pnBytesConsumed,
int nRecLevel);
4202 size_t =
static_cast<size_t>(-1),
4204 static OGRErr createFromWkb(
const void *pabyData,
4207 size_t &nBytesConsumedOut);
4219 CPL_WARN_DEPRECATED(
"Use createFromWkt(const char**, ...) instead")
4221 return createFromWkt(
const_cast<const char **
>(ppszInput), poSRS,
4229 static OGRGeometry *createFromGeoJson(
const char *,
int = -1);
4237 bool bOnlyInOrder =
true);
4244 const char *
const *papszOptions =
nullptr);
4250 int *pbResultValidGeometry,
4251 const char **papszOptions =
nullptr);
4252 static bool haveGEOS();
4259 std::unique_ptr<Private> d;
4268 char **papszOptions,
4272 approximateArcAngles(
double dfX,
double dfY,
double dfZ,
4273 double dfPrimaryRadius,
double dfSecondaryAxis,
4274 double dfRotation,
double dfStartAngle,
4275 double dfEndAngle,
double dfMaxAngleStepSizeDegrees,
4276 const bool bUseMaxGap =
false);
4278 static int GetCurveParameters(
double x0,
double y0,
double x1,
double y1,
4279 double x2,
double y2,
double &R,
double &cx,
4280 double &cy,
double &alpha0,
double &alpha1,
4283 curveToLineString(
double x0,
double y0,
double z0,
double x1,
double y1,
4284 double z1,
double x2,
double y2,
double z2,
int bHasZ,
4285 double dfMaxAngleStepSizeDegrees,
4286 const char *
const *papszOptions =
nullptr);
4289 const char *
const *papszOptions =
nullptr);
4294 bool bCamelCase =
false,
4295 bool bAddZM =
false,
4296 bool bSpaceBeforeZM =
false);
4299 typedef struct _OGRPreparedGeometry OGRPreparedGeometry;
4301 struct CPL_DLL OGRPreparedGeometryUniquePtrDeleter
4303 void operator()(OGRPreparedGeometry *)
const;
4311 typedef std::unique_ptr<OGRPreparedGeometry,
4312 OGRPreparedGeometryUniquePtrDeleter>
The CPLJSONArray class holds JSON object from CPLJSONDocument.
Definition: cpl_json.h:57
OGRGeometry visitor interface.
Definition: ogr_geometry.h:242
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:166
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:1961
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2044
OGRCircularString()
Create an empty circular string.
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2039
OGRCircularString(const OGRCircularString &other)
Copy constructor.
OGRSimpleCurve * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2033
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2049
Utility class to store a collection of curves.
Definition: ogr_geometry.h:2188
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2347
const ChildType *const * begin() const
Return begin of curve iterator.
Definition: ogr_geometry.h:2242
ChildType ** end()
Return end of curve iterator.
Definition: ogr_geometry.h:2234
OGRCompoundCurve(const OGRCompoundCurve &other)
Copy constructor.
ChildType ** begin()
Return begin of curve iterator.
Definition: ogr_geometry.h:2228
OGRCurve ChildType
Type of child elements.
Definition: ogr_geometry.h:2223
const ChildType *const * end() const
Return end of curve iterator.
Definition: ogr_geometry.h:2248
OGRCompoundCurve()
Create an empty compound curve.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2342
Concrete class representing curve polygons.
Definition: ogr_geometry.h:2448
OGRCurve * stealExteriorRingCurve()
"Steal" reference to external ring.
Definition: ogrcurvepolygon.cpp:290
virtual void assignSpatialReference(const OGRSpatialReference *poSR) override
Assign spatial reference to this object.
Definition: ogrcurvepolygon.cpp:757
OGRCurve * getExteriorRingCurve()
Fetch reference to external polygon ring.
Definition: ogrcurvepolygon.cpp:184
OGRCurve * getInteriorRingCurve(int)
Fetch reference to indicated internal ring.
Definition: ogrcurvepolygon.cpp:249
virtual OGRBoolean Contains(const OGRGeometry *) const override
Test for containment.
Definition: ogrcurvepolygon.cpp:831
virtual void flattenTo2D() override
Convert geometry to strictly 2D.
Definition: ogrcurvepolygon.cpp:148
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2594
virtual void empty() override
Clear geometry information.
Definition: ogrcurvepolygon.cpp:111
virtual void getEnvelope(OGREnvelope *psEnvelope) const override
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure.
Definition: ogrcurvepolygon.cpp:641
static OGRPolygon * CastToPolygon(OGRCurvePolygon *poCP)
Convert to polygon.
Definition: ogrcurvepolygon.cpp:878
virtual double get_Area() const override
Get the area of the surface object.
Definition: ogrcurvepolygon.cpp:690
virtual OGRErr transform(OGRCoordinateTransformation *poCT) override
Apply arbitrary coordinate transformation to geometry.
Definition: ogrcurvepolygon.cpp:680
virtual int getDimension() const override
Get the dimension of this object.
Definition: ogrcurvepolygon.cpp:138
virtual OGRBoolean Intersects(const OGRGeometry *) const override
Do these features intersect?
Definition: ogrcurvepolygon.cpp:847
virtual double get_GeodesicArea(const OGRSpatialReference *poSRSOverride=nullptr) const override
Get the area of the surface object, considered as a surface on the underlying ellipsoid of the SRS at...
Definition: ogrcurvepolygon.cpp:710
virtual void swapXY() override
Swap x and y coordinates.
Definition: ogrcurvepolygon.cpp:790
virtual OGRBoolean Equals(const OGRGeometry *) const override
Returns TRUE if two geometries are equivalent.
Definition: ogrcurvepolygon.cpp:661
virtual void segmentize(double dfMaxLength) override
Modify the geometry such it has no segment longer then the given distance.
Definition: ogrcurvepolygon.cpp:775
const ChildType *const * end() const
Return end of curve iterator.
Definition: ogr_geometry.h:2508
OGRCurve ChildType
Type of child elements.
Definition: ogr_geometry.h:2483
virtual OGRBoolean IsEmpty() const override
Returns TRUE (non-zero) if the object has no points.
Definition: ogrcurvepolygon.cpp:766
OGRCurvePolygon()
Create an empty curve polygon.
const ChildType *const * begin() const
Return begin of curve iterator.
Definition: ogr_geometry.h:2502
bool hasEmptyParts() const override
Returns whether a geometry has empty parts/rings.
Definition: ogrcurvepolygon.cpp:937
ChildType ** end()
Return end of curve iterator.
Definition: ogr_geometry.h:2494
virtual OGRErr addRing(OGRCurve *)
Add a ring to a polygon.
Definition: ogrcurvepolygon.cpp:345
ChildType ** begin()
Return begin of curve iterator.
Definition: ogr_geometry.h:2488
virtual void setCoordinateDimension(int nDimension) override
Set the coordinate dimension.
Definition: ogrcurvepolygon.cpp:737
virtual void setMeasured(OGRBoolean bIsMeasured) override
Add or remove the M coordinate dimension.
Definition: ogrcurvepolygon.cpp:748
int getNumInteriorRings() const
Fetch the number of internal rings.
Definition: ogrcurvepolygon.cpp:221
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2599
OGRErr removeRing(int iIndex, bool bDelete=true)
Remove a geometry from the container.
Definition: ogrcurvepolygon.cpp:322
OGRCurvePolygon(const OGRCurvePolygon &)
Copy constructor.
virtual void set3D(OGRBoolean bIs3D) override
Add or remove the Z coordinate dimension.
Definition: ogrcurvepolygon.cpp:743
void removeEmptyParts() override
Remove empty parts/rings from this geometry.
Definition: ogrcurvepolygon.cpp:946
Abstract curve base class for OGRLineString, OGRCircularString and OGRCompoundCurve.
Definition: ogr_geometry.h:1332
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.
virtual int IntersectsPoint(const OGRPoint *p) const
Returns if a point intersects a (closed) curve.
Definition: ogrcurve.cpp:445
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:1424
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:1375
virtual int ContainsPoint(const OGRPoint *p) const
Returns if a point is contained in a (closed) curve.
Definition: ogrcurve.cpp:425
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.
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:1416
virtual OGRCurve * clone() const override=0
Make a copy of this object.
OGRGeometry visitor default implementation.
Definition: ogr_geometry.h:289
void visit(const OGRPoint *) override
Visit OGRPoint.
Definition: ogr_geometry.h:293
OGRGeometry visitor default implementation.
Definition: ogr_geometry.h:213
void visit(OGRPoint *) override
Visit OGRPoint.
Definition: ogr_geometry.h:217
Simple container for a bounding region in 3D.
Definition: ogr_core.h:216
Simple container for a bounding region (rectangle)
Definition: ogr_core.h:61
A collection of 1 or more geometry objects.
Definition: ogr_geometry.h:2907
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:3044
const ChildType *const * end() const
Return end of sub-geometry iterator.
Definition: ogr_geometry.h:2961
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:3049
ChildType ** begin()
Return begin of sub-geometry iterator.
Definition: ogr_geometry.h:2941
const ChildType *const * begin() const
Return begin of sub-geometry iterator.
Definition: ogr_geometry.h:2955
ChildType ** end()
Return end of sub-geometry iterator.
Definition: ogr_geometry.h:2947
OGRGeometry * getGeometryRef(int)
Fetch geometry from container.
Definition: ogrgeometrycollection.cpp:259
OGRGeometryCollection()
Create an empty geometry collection.
OGRGeometry ChildType
Type of child elements.
Definition: ogr_geometry.h:2936
Create geometry objects from well known text/binary.
Definition: ogr_geometry.h:4193
static OGRErr createFromWkt(char **ppszInput, const OGRSpatialReference *poSRS, OGRGeometry **ppoGeom)
Deprecated.
Definition: ogr_geometry.h:4216
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:377
OGRCircularString * toCircularString()
Down-cast to OGRCircularString*.
Definition: ogr_geometry.h:767
OGRMultiPolygon * toMultiPolygon()
Down-cast to OGRMultiPolygon*.
Definition: ogr_geometry.h:945
OGRLinearRing * toLinearRing()
Down-cast to OGRLinearRing*.
Definition: ogr_geometry.h:748
OGRLineString * toLineString()
Down-cast to OGRLineString*.
Definition: ogr_geometry.h:729
virtual OGRGeometry * getCurveGeometry(const char *const *papszOptions=nullptr) const
Return curve version of this geometry.
Definition: ogrgeometry.cpp:3502
const OGRCurvePolygon * toCurvePolygon() const
Down-cast to OGRCurvePolygon*.
Definition: ogr_geometry.h:875
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:709
virtual void empty()=0
Clear geometry information.
virtual OGRBoolean Equals(const OGRGeometry *) const =0
Returns TRUE if two geometries are equivalent.
const OGRMultiPoint * toMultiPoint() const
Down-cast to OGRMultiPoint*.
Definition: ogr_geometry.h:915
OGRCurvePolygon * toCurvePolygon()
Down-cast to OGRCurvePolygon*.
Definition: ogr_geometry.h:865
const OGRMultiPolygon * toMultiPolygon() const
Down-cast to OGRMultiPolygon*.
Definition: ogr_geometry.h:955
OGRPolygon * toPolygon()
Down-cast to OGRPolygon*.
Definition: ogr_geometry.h:827
bool operator!=(const OGRGeometry &other) const
Returns if two geometries are different.
Definition: ogr_geometry.h:437
const OGRGeometryCollection * toGeometryCollection() const
Down-cast to OGRGeometryCollection*.
Definition: ogr_geometry.h:895
const OGRTriangulatedSurface * toTriangulatedSurface() const
Down-cast to OGRTriangulatedSurface*.
Definition: ogr_geometry.h:1033
OGRTriangulatedSurface * toTriangulatedSurface()
Down-cast to OGRTriangulatedSurface*.
Definition: ogr_geometry.h:1024
const OGRCurve * toCurve() const
Down-cast to OGRCurve*.
Definition: ogr_geometry.h:699
OGRMultiLineString * toMultiLineString()
Down-cast to OGRMultiLineString*.
Definition: ogr_geometry.h:925
OGRPolyhedralSurface * toPolyhedralSurface()
Down-cast to OGRPolyhedralSurface*.
Definition: ogr_geometry.h:1005
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:719
virtual OGRwkbGeometryType getGeometryType() const =0
Fetch geometry type.
virtual void accept(IOGRConstGeometryVisitor *visitor) const =0
Accept a visitor.
OGRCompoundCurve * toCompoundCurve()
Down-cast to OGRCompoundCurve*.
Definition: ogr_geometry.h:787
const OGRCompoundCurve * toCompoundCurve() const
Down-cast to OGRCompoundCurve*.
Definition: ogr_geometry.h:797
const OGRSurface * toSurface() const
Down-cast to OGRSurface*.
Definition: ogr_geometry.h:817
const OGRMultiCurve * toMultiCurve() const
Down-cast to OGRMultiCurve*.
Definition: ogr_geometry.h:975
OGRMultiCurve * toMultiCurve()
Down-cast to OGRMultiCurve*.
Definition: ogr_geometry.h:965
const OGRCircularString * toCircularString() const
Down-cast to OGRCircularString*.
Definition: ogr_geometry.h:777
const OGRLineString * toLineString() const
Down-cast to OGRLineString*.
Definition: ogr_geometry.h:739
bool operator==(const OGRGeometry &other) const
Returns if two geometries are equal.
Definition: ogr_geometry.h:431
OGRMultiSurface * toMultiSurface()
Down-cast to OGRMultiSurface*.
Definition: ogr_geometry.h:985
const OGRPolygon * toPolygon() const
Down-cast to OGRPolygon*.
Definition: ogr_geometry.h:837
OGRBoolean IsMeasured() const
Definition: ogr_geometry.h:459
OGRGeometryCollection * toGeometryCollection()
Down-cast to OGRGeometryCollection*.
Definition: ogr_geometry.h:885
virtual void accept(IOGRGeometryVisitor *visitor)=0
Accept a visitor.
OGRTriangle * toTriangle()
Down-cast to OGRTriangle*.
Definition: ogr_geometry.h:846
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.
const OGRMultiLineString * toMultiLineString() const
Down-cast to OGRMultiLineString*.
Definition: ogr_geometry.h:935
OGRMultiPoint * toMultiPoint()
Down-cast to OGRMultiPoint*.
Definition: ogr_geometry.h:905
OGRSurface * toSurface()
Down-cast to OGRSurface*.
Definition: ogr_geometry.h:807
virtual const char * getGeometryName() const =0
Fetch WKT name for geometry type.
const OGRTriangle * toTriangle() const
Down-cast to OGRTriangle*.
Definition: ogr_geometry.h:855
static OGRGeometry * FromHandle(OGRGeometryH hGeom)
Convert a OGRGeometryH to a OGRGeometry*.
Definition: ogr_geometry.h:661
OGRErr importFromWkt(char **ppszInput)
Deprecated.
Definition: ogr_geometry.h:486
const OGRLinearRing * toLinearRing() const
Down-cast to OGRLinearRing*.
Definition: ogr_geometry.h:757
virtual OGRBoolean IsEmpty() const =0
Returns TRUE (non-zero) if the object has no points.
OGRPoint * toPoint()
Down-cast to OGRPoint*.
Definition: ogr_geometry.h:670
OGRCurve * toCurve()
Down-cast to OGRCurve*.
Definition: ogr_geometry.h:689
OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const
Convert a geometry into well known text format.
Definition: ogrgeometry.cpp:1951
const OGRPoint * toPoint() const
Down-cast to OGRPoint*.
Definition: ogr_geometry.h:679
virtual OGRGeometry * getLinearGeometry(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const
Return, possibly approximate, non-curve version of this geometry.
Definition: ogrgeometry.cpp:3467
static OGRGeometryH ToHandle(OGRGeometry *poGeom)
Convert a OGRGeometry* to a OGRGeometryH.
Definition: ogr_geometry.h:653
OGRBoolean Is3D() const
Definition: ogr_geometry.h:453
virtual void closeRings()
Force rings to be closed.
Definition: ogrgeometry.cpp:5992
const OGRPolyhedralSurface * toPolyhedralSurface() const
Down-cast to OGRPolyhedralSurface*.
Definition: ogr_geometry.h:1015
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.
virtual std::string exportToWkt(const OGRWktOptions &opts=OGRWktOptions(), OGRErr *err=nullptr) const =0
Export a WKT geometry.
const OGRMultiSurface * toMultiSurface() const
Down-cast to OGRMultiSurface*.
Definition: ogr_geometry.h:995
Definition: ogr_geometry.h:1480
Concrete representation of a multi-vertex line.
Definition: ogr_geometry.h:1773
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1829
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1824
OGRLineString(const OGRLineString &other)
Copy constructor.
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:1819
OGRSimpleCurve * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:1813
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)
OGRLineString()
Create an empty line string.
virtual double get_Area() const override
Get the area of the (closed) curve.
Concrete representation of a closed ring.
Definition: ogr_geometry.h:1863
const OGRLineString * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:1925
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1935
OGRLinearRing(const OGRLinearRing &other)
Copy constructor.
OGRLinearRing()
Constructor.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1930
A collection of OGRCurve.
Definition: ogr_geometry.h:3889
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:3924
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:3995
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:3910
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:3985
OGRMultiCurve()
Create an empty multi curve collection.
OGRMultiCurve(const OGRMultiCurve &other)
Copy constructor.
OGRCurve * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3938
OGRCurve ChildType
Type of child elements.
Definition: ogr_geometry.h:3905
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:3930
const OGRCurve * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3944
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:3916
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:3979
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:3990
A collection of OGRLineString.
Definition: ogr_geometry.h:4045
OGRLineString * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:4090
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:4062
const OGRLineString * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:4096
OGRLineString ChildType
Type of child elements.
Definition: ogr_geometry.h:4057
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:4131
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:4082
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:4141
OGRMultiLineString()
Create an empty multi line string collection.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:4136
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:4076
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:4068
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:4125
OGRMultiLineString(const OGRMultiLineString &other)
Copy constructor.
A collection of OGRPoint.
Definition: ogr_geometry.h:3733
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:3753
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:3818
OGRPoint * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3781
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:3767
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:3773
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:3759
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:3824
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:3829
const OGRPoint * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3787
OGRMultiPoint()
Create an empty multi point collection.
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:3834
OGRMultiPoint(const OGRMultiPoint &other)
Copy constructor.
OGRPoint ChildType
Type of child elements.
Definition: ogr_geometry.h:3748
A collection of non-overlapping OGRPolygon.
Definition: ogr_geometry.h:3260
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:3350
const OGRPolygon * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3321
OGRPolygon ChildType
Type of child elements.
Definition: ogr_geometry.h:3282
OGRMultiPolygon(const OGRMultiPolygon &other)
Copy constructor.
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:3366
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:3293
OGRPolygon * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3315
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:3301
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:3307
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:3356
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:3361
OGRMultiPolygon()
Create an empty multi polygon collection.
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:3287
A collection of non-overlapping OGRSurface.
Definition: ogr_geometry.h:3103
OGRMultiSurface()
Create an empty multi surface collection.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:3203
OGRSurface * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3176
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:3134
OGRSurface ChildType
Type of child elements.
Definition: ogr_geometry.h:3115
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:3140
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:3192
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:3120
OGRMultiSurface(const OGRMultiSurface &other)
Copy constructor.
const OGRSurface * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3182
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:3208
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:3126
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:3198
Interface for a point iterator.
Definition: ogr_geometry.h:1314
virtual OGRBoolean getNextPoint(OGRPoint *p)=0
Returns the next point followed by the iterator.
Point class.
Definition: ogr_geometry.h:1151
double getM() const
Return m.
Definition: ogr_geometry.h:1224
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1285
void setX(double xIn)
Set x.
Definition: ogr_geometry.h:1235
OGRPoint(const OGRPoint &other)
Copy constructor.
void setZ(double zIn)
Set z.
Definition: ogr_geometry.h:1259
void setM(double mIn)
Set m.
Definition: ogr_geometry.h:1268
double getX() const
Return x.
Definition: ogr_geometry.h:1206
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1290
void setY(double yIn)
Set y.
Definition: ogr_geometry.h:1247
virtual OGRBoolean IsEmpty() const override
Returns TRUE (non-zero) if the object has no points.
Definition: ogr_geometry.h:1199
double getZ() const
Return z.
Definition: ogr_geometry.h:1218
double getY() const
Return y.
Definition: ogr_geometry.h:1212
Concrete class representing polygons.
Definition: ogr_geometry.h:2656
const OGRCurvePolygon * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2773
virtual OGRGeometry * getLinearGeometry(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const override
Return, possibly approximate, non-curve version of this geometry.
Definition: ogrpolygon.cpp:828
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2710
OGRLinearRing ChildType
Type of child elements.
Definition: ogr_geometry.h:2685
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const override
Returns if this geometry is or has curve geometry.
Definition: ogrpolygon.cpp:818
OGRPolygon()
Create an empty polygon.
virtual size_t WkbSize() const override
Returns size of related binary representation.
Definition: ogrpolygon.cpp:330
virtual OGRPolygon * CurvePolyToPoly(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const override
Return a polygon from a curve polygon.
Definition: ogrpolygon.cpp:808
OGRPolygon(const OGRPolygon &other)
Copy constructor.
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2704
OGRErr exportToWkb(unsigned char *, const OGRwkbExportOptions *=nullptr) const override
Convert a geometry into well known binary format.
Definition: ogrpolygon.cpp:431
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2696
OGRCurvePolygon * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2767
OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const
Convert a geometry into well known text format.
Definition: ogrgeometry.cpp:1951
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2783
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2690
virtual OGRErr importFromWkt(const char **ppszInput)=0
Assign geometry from well known text data.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2778
virtual void closeRings() override
Force rings to be closed.
Definition: ogrpolygon.cpp:796
PolyhedralSurface class.
Definition: ogr_geometry.h:3417
OGRErr exportToWkb(unsigned char *, const OGRwkbExportOptions *=nullptr) const override
Convert a geometry into well known binary format.
Definition: ogrpolyhedralsurface.cpp:283
virtual OGRBoolean IsEmpty() const override
Checks if the PolyhedralSurface is empty.
Definition: ogrpolyhedralsurface.cpp:908
virtual void setMeasured(OGRBoolean bIsMeasured) override
Set the type as Measured.
Definition: ogrpolyhedralsurface.cpp:936
bool hasEmptyParts() const override
Returns whether a geometry has empty parts/rings.
Definition: ogrpolyhedralsurface.cpp:1016
virtual void setCoordinateDimension(int nDimension) override
Set the coordinate dimension.
Definition: ogrpolyhedralsurface.cpp:957
int getNumGeometries() const
Fetch number of geometries in PolyhedralSurface.
Definition: ogrpolyhedralsurface.cpp:849
virtual OGRErr importFromWkb(const unsigned char *, size_t, OGRwkbVariant, size_t &nBytesConsumedOut) override
Assign geometry from well known binary data.
Definition: ogrpolyhedralsurface.cpp:195
virtual double get_GeodesicArea(const OGRSpatialReference *poSRSOverride=nullptr) const override
Get the area of the surface object, considered as a surface on the underlying ellipsoid of the SRS at...
Definition: ogrpolyhedralsurface.cpp:675
static OGRMultiPolygon * CastToMultiPolygon(OGRPolyhedralSurface *poPS)
Casts the OGRPolyhedralSurface to an OGRMultiPolygon.
Definition: ogrpolyhedralsurface.cpp:734
OGRPolygon * getGeometryRef(int i)
Fetch geometry from container.
Definition: ogrpolyhedralsurface.cpp:871
virtual void swapXY() override
Swap x and y coordinates.
Definition: ogrpolyhedralsurface.cpp:972
virtual void getEnvelope(OGREnvelope *psEnvelope) const override
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure.
Definition: ogrpolyhedralsurface.cpp:177
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:3448
virtual void flattenTo2D() override
Convert geometry to strictly 2D.
Definition: ogrpolyhedralsurface.cpp:508
OGRPolyhedralSurface(const OGRPolyhedralSurface &poGeom)
Copy constructor.
void removeEmptyParts() override
Remove empty parts/rings from this geometry.
Definition: ogrpolyhedralsurface.cpp:1025
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const override
Returns if this geometry is or has curve geometry.
Definition: ogrpolyhedralsurface.cpp:981
~OGRPolyhedralSurface() override
Destructor.
virtual void set3D(OGRBoolean bIs3D) override
Set the type as 3D geometry.
Definition: ogrpolyhedralsurface.cpp:921
virtual void assignSpatialReference(const OGRSpatialReference *poSR) override
Assign spatial reference to this object.
Definition: ogrpolyhedralsurface.cpp:1034
virtual OGRErr addGeometry(const OGRGeometry *)
Add a new geometry to a collection.
Definition: ogrpolyhedralsurface.cpp:753
OGRErr addGeometryDirectly(OGRGeometry *poNewGeom)
Add a geometry directly to the container.
Definition: ogrpolyhedralsurface.cpp:793
virtual OGRBoolean Equals(const OGRGeometry *) const override
Returns TRUE if two geometries are equivalent.
Definition: ogrpolyhedralsurface.cpp:607
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:3537
OGRPolygon ChildType
Type of child elements.
Definition: ogr_geometry.h:3443
virtual double get_Area() const override
Returns the area enclosed.
Definition: ogrpolyhedralsurface.cpp:648
virtual OGRErr transform(OGRCoordinateTransformation *) override
Apply arbitrary coordinate transformation to geometry.
Definition: ogrpolyhedralsurface.cpp:520
OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const
Convert a geometry into well known text format.
Definition: ogrgeometry.cpp:1951
virtual OGRErr PointOnSurface(OGRPoint *) const override
This method relates to the SFCOM ISurface::get_PointOnSurface() method.
Definition: ogrpolyhedralsurface.cpp:689
OGRPolyhedralSurface()
Create an empty PolyhedralSurface.
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:3454
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:3468
virtual OGRErr importFromWkt(const char **ppszInput)=0
Assign geometry from well known text data.
virtual size_t WkbSize() const override
Returns size of related binary representation.
Definition: ogrpolyhedralsurface.cpp:136
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:3462
virtual int getDimension() const override
Get the dimension of this object.
Definition: ogrpolyhedralsurface.cpp:150
virtual void empty() override
Clear geometry information.
Definition: ogrpolyhedralsurface.cpp:159
OGRErr removeGeometry(int iIndex, int bDelete=TRUE)
Remove a geometry from the container.
Definition: ogrpolyhedralsurface.cpp:1007
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:3542
Simple container for a position.
Definition: ogr_geometry.h:106
OGRRawPoint(double xIn, double yIn)
Constructor.
Definition: ogr_geometry.h:114
double x
x
Definition: ogr_geometry.h:119
double y
y
Definition: ogr_geometry.h:121
OGRRawPoint()
Constructor.
Definition: ogr_geometry.h:109
Abstract curve base class for OGRLineString and OGRCircularString.
Definition: ogr_geometry.h:1524
double getY(int i) const
Get Y at vertex.
Definition: ogr_geometry.h:1673
double getX(int i) const
Get X at vertex.
Definition: ogr_geometry.h:1668
void setZ(int, double)
Set the Z of a vertex in line string.
Definition: ogrlinestring.cpp:713
OGRPoint ChildType
Type of child elements.
Definition: ogr_geometry.h:1595
void setM(int, double)
Set the M of a vertex in line string.
Definition: ogrlinestring.cpp:746
virtual OGRSimpleCurve * clone() const override=0
Make a copy of this object.
virtual int getNumPoints() const override
Fetch vertex count.
Definition: ogr_geometry.h:1661
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:169
Abstract base class for 2 dimensional objects like polygons or curve polygons.
Definition: ogr_geometry.h:2400
virtual double get_Area() const =0
Get the area of the surface object.
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 OGRErr PointOnSurface(OGRPoint *poPoint) const
This method relates to the SFCOM ISurface::get_PointOnSurface() method.
Definition: ogr_geometry.h:2412
virtual OGRSurface * clone() const override=0
Make a copy of this object.
Triangle class.
Definition: ogr_geometry.h:2832
const OGRPolygon * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2872
virtual OGRwkbGeometryType getGeometryType() const override
Fetch geometry type.
Definition: ogrtriangle.cpp:167
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2877
virtual OGRErr importFromWkb(const unsigned char *, size_t, OGRwkbVariant, size_t &nBytesConsumedOut) override
Assign geometry from well known binary data.
Definition: ogrtriangle.cpp:194
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2882
OGRPolygon * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2866
OGRTriangle()
Constructor.
~OGRTriangle() override
Destructor.
virtual OGRErr addRingDirectly(OGRCurve *poNewRing) override
Add a ring to a polygon.
Definition: ogrtriangle.cpp:247
OGRTriangle(const OGRTriangle &other)
Copy constructor.
virtual OGRTriangle * clone() const override
Make a copy of this object.
Definition: ogrtriangle.cpp:148
OGRTriangle & operator=(const OGRTriangle &other)
Assignment operator.
Definition: ogrtriangle.cpp:135
virtual const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition: ogrtriangle.cpp:158
TriangulatedSurface class.
Definition: ogr_geometry.h:3594
~OGRTriangulatedSurface()
Destructor.
OGRTriangulatedSurface & operator=(const OGRTriangulatedSurface &other)
Assignment operator.
Definition: ogrtriangulatedsurface.cpp:83
virtual const char * getGeometryName() const override
Returns the geometry name of the TriangulatedSurface.
Definition: ogrtriangulatedsurface.cpp:124
virtual OGRwkbGeometryType getGeometryType() const override
Returns the WKB Type of TriangulatedSurface.
Definition: ogrtriangulatedsurface.cpp:138
const OGRTriangle * getGeometryRef(int i) const
See OGRPolyhedralSurface::getGeometryRef()
Definition: ogr_geometry.h:3654
OGRPolyhedralSurface * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:3667
virtual OGRTriangulatedSurface * clone() const override
Make a copy of this object.
Definition: ogrtriangulatedsurface.cpp:107
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:3678
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:3631
virtual OGRErr addGeometry(const OGRGeometry *)
Add a new geometry to a collection.
Definition: ogrpolyhedralsurface.cpp:753
const OGRPolyhedralSurface * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:3673
OGRTriangle ChildType
Type of child elements.
Definition: ogr_geometry.h:3612
OGRTriangle * getGeometryRef(int i)
See OGRPolyhedralSurface::getGeometryRef()
Definition: ogr_geometry.h:3648
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:3683
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:3623
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:3637
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:3617
OGRTriangulatedSurface()
Constructor.
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:1042
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1183
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition: cpl_port.h:976
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:185
void * OGRGeometryH
Opaque type for a geometry.
Definition: ogr_api.h:66
Core portability services for cross-platform OGR code.
int OGRBoolean
Type for a OGR boolean.
Definition: ogr_core.h:404
OGRwkbByteOrder
Enumeration to describe byte order.
Definition: ogr_core.h:620
@ wkbNDR
LSB/Intel/Vax: Least Significant Byte First
Definition: ogr_core.h:622
OGRwkbVariant
Output variants of WKB we support.
Definition: ogr_core.h:550
@ wkbVariantOldOgc
Old-style 99-402 extended dimension (Z) WKB types.
Definition: ogr_core.h:551
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:416
int OGRErr
Type for a OGR error.
Definition: ogr_core.h:387
OGRWktFormat
WKT Output formatting options.
Definition: ogr_geometry.h:64
@ 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:4313
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:2594
struct GEOSContextHandle_HS * GEOSContextHandle_t
GEOS context handle type.
Definition: ogr_geometry.h:127
OGRwkbGeometryType OGRFromOGCGeomType(const char *pszGeomType)
Map OGCgeometry format type to corresponding OGR constants.
Definition: ogrgeometry.cpp:2515
std::unique_ptr< OGRGeometry, OGRGeometryUniquePtrDeleter > OGRGeometryUniquePtr
Unique pointer type for OGRGeometry.
Definition: ogr_geometry.h:1051
struct GEOSGeom_t * GEOSGeom
GEOS geometry type.
Definition: ogr_geometry.h:125
void sfcgal_geometry_t
SFCGAL geometry type.
Definition: ogr_geometry.h:129
Coordinate systems services.
OGRLayer::FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition: ogrsf_frmts.h:434
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition: ogrsf_frmts.h:442
Geometry coordinate precision for a binary representation.
Definition: ogr_geometry.h:323
Geometry coordinate precision.
Definition: ogr_geomcoordinateprecision.h:50
Options for formatting WKT output.
Definition: ogr_geometry.h:72
int mPrecision
Precision of output for M coordinates. Interpretation depends on format.
Definition: ogr_geometry.h:81
int zPrecision
Precision of output for Z coordinates. Interpretation depends on format.
Definition: ogr_geometry.h:79
OGRWktOptions()
Constructor.
Definition: ogr_geometry.h:88
OGRWktOptions(const OGRWktOptions &)=default
Copy constructor.
int xyPrecision
Precision of output for X,Y coordinates. Interpretation depends on format.
Definition: ogr_geometry.h:77
WKB export options.
Definition: ogr_geometry.h:346