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();
304 int nXYBitPrecision =
363 friend class OGRCurveCollection;
365 unsigned int flags = 0;
367 OGRErr importPreambleFromWkt(
const char **ppszInput,
int *pbHasZ,
368 int *pbHasM,
bool *pbIsEmpty);
369 OGRErr importCurveCollectionFromWkt(
370 const char **ppszInput,
int bAllowEmptyComponent,
int bAllowLineString,
371 int bAllowCurve,
int bAllowCompoundCurve,
373 OGRErr importPreambleFromWkb(
const unsigned char *pabyData,
size_t nSize,
376 OGRErr importPreambleOfCollectionFromWkb(
const unsigned char *pabyData,
377 size_t &nSize,
size_t &nDataOffset,
379 size_t nMinSubGeomSize,
385 void HomogenizeDimensionalityWith(
OGRGeometry *poOtherGeom);
399 static const unsigned int OGR_G_NOT_EMPTY_POINT = 0x1;
400 static const unsigned int OGR_G_3D = 0x2;
401 static const unsigned int OGR_G_MEASURED = 0x4;
415 return CPL_TO_BOOL(Equals(&other));
421 return !CPL_TO_BOOL(Equals(&other));
426 virtual int getCoordinateDimension()
const;
427 int CoordinateDimension()
const;
429 virtual OGRBoolean IsValid(std::string *posReason =
nullptr)
const;
437 return (flags & OGR_G_3D) != 0;
443 return (flags & OGR_G_MEASURED) != 0;
453 virtual
size_t WkbSize() const = 0;
454 OGRErr importFromWkb(const
GByte *,
size_t = static_cast<
size_t>(-1),
457 size_t &nBytesConsumedOut) = 0;
460 virtual
OGRErr exportToWkb(
unsigned char *,
462 virtual
OGRErr importFromWkt(const
char **ppszInput) = 0;
470 CPL_WARN_DEPRECATED(
"Use importFromWkt(const char**) instead")
473 return importFromWkt(
const_cast<const char **
>(ppszInput));
477 OGRErr exportToWkt(
char **ppszDstText,
485 OGRErr *err =
nullptr)
const = 0;
491 void dumpReadable(FILE *,
const char * =
nullptr,
493 std::string dumpReadable(
const char * =
nullptr,
496 virtual char *exportToGML(
const char *
const *papszOptions =
nullptr)
const;
497 virtual char *exportToKML()
const;
498 virtual char *exportToJson(
CSLConstList papszOptions =
nullptr)
const;
511 virtual
OGRBoolean hasCurveGeometry(
int bLookForNonLinear = FALSE) const;
515 double dfMaxAngleStepSizeDegrees = 0,
527 virtual
void closeRings();
529 virtual
bool setCoordinateDimension(
int nDimension);
531 virtual
bool setMeasured(
OGRBoolean bIsMeasured);
543 virtual bool segmentize(
double dfMaxLength);
565 ConcaveHullOfPolygons(
double dfLengthRatio,
bool bIsTight,
572 BufferEx(
double dfDist,
596 DelaunayTriangulation(
double dfTolerance,
606 double Distance3D(const
OGRGeometry *poOtherGeom) const;
608 OGRGeometry *SetPrecision(
double dfGridSize,
int nFlags) const;
610 virtual
bool hasEmptyParts() const;
611 virtual
void removeEmptyParts();
616 CPL_WARN_DEPRECATED("Non standard method. "
617 "Use Intersects() instead");
619 CPL_WARN_DEPRECATED("Non standard method. "
620 "Use Equals() instead");
622 CPL_WARN_DEPRECATED("Non standard method. "
623 "Use SymDifference() instead");
625 CPL_WARN_DEPRECATED("Non standard method. "
626 "Use Boundary() instead");
631 static
int bGenerate_DB2_V72_BYTE_ORDER;
634 virtual
void swapXY();
636 bool IsRectangle() const;
667 return cpl::down_cast<OGRPoint *>(
this);
675 return cpl::down_cast<const OGRPoint *>(
this);
684 return cpl::down_cast<OGRCurve *>(
this);
693 return cpl::down_cast<const OGRCurve *>(
this);
702 return cpl::down_cast<OGRSimpleCurve *>(
this);
711 return cpl::down_cast<const OGRSimpleCurve *>(
this);
720 return cpl::down_cast<OGRLineString *>(
this);
729 return cpl::down_cast<const OGRLineString *>(
this);
737 return cpl::down_cast<OGRLinearRing *>(
this);
745 return cpl::down_cast<const OGRLinearRing *>(
this);
754 return cpl::down_cast<OGRCircularString *>(
this);
763 return cpl::down_cast<const OGRCircularString *>(
this);
772 return cpl::down_cast<OGRCompoundCurve *>(
this);
781 return cpl::down_cast<const OGRCompoundCurve *>(
this);
790 return cpl::down_cast<OGRSurface *>(
this);
799 return cpl::down_cast<const OGRSurface *>(
this);
808 return cpl::down_cast<OGRPolygon *>(
this);
817 return cpl::down_cast<const OGRPolygon *>(
this);
825 return cpl::down_cast<OGRTriangle *>(
this);
833 return cpl::down_cast<const OGRTriangle *>(
this);
842 return cpl::down_cast<OGRCurvePolygon *>(
this);
851 return cpl::down_cast<const OGRCurvePolygon *>(
this);
860 return cpl::down_cast<OGRGeometryCollection *>(
this);
869 return cpl::down_cast<const OGRGeometryCollection *>(
this);
878 return cpl::down_cast<OGRMultiPoint *>(
this);
887 return cpl::down_cast<const OGRMultiPoint *>(
this);
896 return cpl::down_cast<OGRMultiLineString *>(
this);
905 return cpl::down_cast<const OGRMultiLineString *>(
this);
914 return cpl::down_cast<OGRMultiPolygon *>(
this);
923 return cpl::down_cast<const OGRMultiPolygon *>(
this);
932 return cpl::down_cast<OGRMultiCurve *>(
this);
941 return cpl::down_cast<const OGRMultiCurve *>(
this);
950 return cpl::down_cast<OGRMultiSurface *>(
this);
959 return cpl::down_cast<const OGRMultiSurface *>(
this);
968 return cpl::down_cast<OGRPolyhedralSurface *>(
this);
977 return cpl::down_cast<const OGRPolyhedralSurface *>(
this);
985 return cpl::down_cast<OGRTriangulatedSurface *>(
this);
993 return cpl::down_cast<const OGRTriangulatedSurface *>(
this);
998struct CPL_DLL OGRGeometryUniquePtrDeleter
1007typedef std::unique_ptr<OGRGeometry, OGRGeometryUniquePtrDeleter>
1011#define OGR_FORBID_DOWNCAST_TO(name) \
1012 inline OGR##name *to##name() = delete; \
1013 inline const OGR##name *to##name() const = delete;
1015#define OGR_FORBID_DOWNCAST_TO_POINT OGR_FORBID_DOWNCAST_TO(Point)
1016#define OGR_FORBID_DOWNCAST_TO_CURVE OGR_FORBID_DOWNCAST_TO(Curve)
1017#define OGR_FORBID_DOWNCAST_TO_SIMPLE_CURVE OGR_FORBID_DOWNCAST_TO(SimpleCurve)
1018#define OGR_FORBID_DOWNCAST_TO_LINESTRING OGR_FORBID_DOWNCAST_TO(LineString)
1019#define OGR_FORBID_DOWNCAST_TO_LINEARRING OGR_FORBID_DOWNCAST_TO(LinearRing)
1020#define OGR_FORBID_DOWNCAST_TO_CIRCULARSTRING \
1021 OGR_FORBID_DOWNCAST_TO(CircularString)
1022#define OGR_FORBID_DOWNCAST_TO_COMPOUNDCURVE \
1023 OGR_FORBID_DOWNCAST_TO(CompoundCurve)
1024#define OGR_FORBID_DOWNCAST_TO_SURFACE OGR_FORBID_DOWNCAST_TO(Surface)
1025#define OGR_FORBID_DOWNCAST_TO_CURVEPOLYGON OGR_FORBID_DOWNCAST_TO(CurvePolygon)
1026#define OGR_FORBID_DOWNCAST_TO_POLYGON OGR_FORBID_DOWNCAST_TO(Polygon)
1027#define OGR_FORBID_DOWNCAST_TO_TRIANGLE OGR_FORBID_DOWNCAST_TO(Triangle)
1028#define OGR_FORBID_DOWNCAST_TO_MULTIPOINT OGR_FORBID_DOWNCAST_TO(MultiPoint)
1029#define OGR_FORBID_DOWNCAST_TO_MULTICURVE OGR_FORBID_DOWNCAST_TO(MultiCurve)
1030#define OGR_FORBID_DOWNCAST_TO_MULTILINESTRING \
1031 OGR_FORBID_DOWNCAST_TO(MultiLineString)
1032#define OGR_FORBID_DOWNCAST_TO_MULTISURFACE OGR_FORBID_DOWNCAST_TO(MultiSurface)
1033#define OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON OGR_FORBID_DOWNCAST_TO(MultiPolygon)
1034#define OGR_FORBID_DOWNCAST_TO_GEOMETRYCOLLECTION \
1035 OGR_FORBID_DOWNCAST_TO(GeometryCollection)
1036#define OGR_FORBID_DOWNCAST_TO_POLYHEDRALSURFACE \
1037 OGR_FORBID_DOWNCAST_TO(PolyhedralSurface)
1038#define OGR_FORBID_DOWNCAST_TO_TIN OGR_FORBID_DOWNCAST_TO(TriangulatedSurface)
1040#define OGR_ALLOW_UPCAST_TO(name) \
1041 inline OGR##name *to##name() \
1045 inline const OGR##name *to##name() const \
1050#ifndef SUPPRESS_OGR_ALLOW_CAST_TO_THIS_WARNING
1051#define CAST_TO_THIS_WARNING CPL_WARN_DEPRECATED("Casting to this is useless")
1053#define CAST_TO_THIS_WARNING
1056#define OGR_ALLOW_CAST_TO_THIS(name) \
1057 inline OGR##name *to##name() CAST_TO_THIS_WARNING \
1061 inline const OGR##name *to##name() const CAST_TO_THIS_WARNING \
1066#define OGR_FORBID_DOWNCAST_TO_ALL_CURVES \
1067 OGR_FORBID_DOWNCAST_TO_CURVE \
1068 OGR_FORBID_DOWNCAST_TO_SIMPLE_CURVE \
1069 OGR_FORBID_DOWNCAST_TO_LINESTRING \
1070 OGR_FORBID_DOWNCAST_TO_LINEARRING \
1071 OGR_FORBID_DOWNCAST_TO_CIRCULARSTRING \
1072 OGR_FORBID_DOWNCAST_TO_COMPOUNDCURVE
1074#define OGR_FORBID_DOWNCAST_TO_ALL_SURFACES \
1075 OGR_FORBID_DOWNCAST_TO_SURFACE \
1076 OGR_FORBID_DOWNCAST_TO_CURVEPOLYGON \
1077 OGR_FORBID_DOWNCAST_TO_POLYGON \
1078 OGR_FORBID_DOWNCAST_TO_TRIANGLE \
1079 OGR_FORBID_DOWNCAST_TO_POLYHEDRALSURFACE \
1080 OGR_FORBID_DOWNCAST_TO_TIN
1082#define OGR_FORBID_DOWNCAST_TO_ALL_SINGLES \
1083 OGR_FORBID_DOWNCAST_TO_POINT \
1084 OGR_FORBID_DOWNCAST_TO_ALL_CURVES \
1085 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1087#define OGR_FORBID_DOWNCAST_TO_ALL_MULTI \
1088 OGR_FORBID_DOWNCAST_TO_GEOMETRYCOLLECTION \
1089 OGR_FORBID_DOWNCAST_TO_MULTIPOINT \
1090 OGR_FORBID_DOWNCAST_TO_MULTICURVE \
1091 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING \
1092 OGR_FORBID_DOWNCAST_TO_MULTISURFACE \
1093 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
1117 OGRPoint(
double x,
double y,
double z);
1118 OGRPoint(
double x,
double y,
double z,
double m);
1122 static OGRPoint *createXYM(
double x,
double y,
double m);
1129 size_t WkbSize()
const override;
1131 size_t &nBytesConsumedOut)
override;
1132 OGRErr exportToWkb(
unsigned char *,
1139 OGRErr importFromWkt(
const char **)
override;
1150 OGRErr *err =
nullptr)
const override;
1153 int getDimension()
const override;
1155 void empty()
override;
1156 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
1161 return !(flags & OGR_G_NOT_EMPTY_POINT);
1190 bool setCoordinateDimension(
int nDimension)
override;
1198 if (std::isnan(x) || std::isnan(y))
1199 flags &= ~OGR_G_NOT_EMPTY_POINT;
1201 flags |= OGR_G_NOT_EMPTY_POINT;
1210 if (std::isnan(x) || std::isnan(y))
1211 flags &= ~OGR_G_NOT_EMPTY_POINT;
1213 flags |= OGR_G_NOT_EMPTY_POINT;
1231 flags |= OGR_G_MEASURED;
1240 const char *getGeometryName()
const override;
1243 void flattenTo2D()
override;
1247 visitor->
visit(
this);
1252 visitor->
visit(
this);
1255 void swapXY()
override;
1257 OGR_ALLOW_CAST_TO_THIS(Point)
1258 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
1259 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1260 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
1298 virtual OGRCurveCasterToLineString GetCasterToLineString()
const = 0;
1299 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const = 0;
1304 virtual int ContainsPoint(
const OGRPoint *p)
const;
1305 virtual int IntersectsPoint(
const OGRPoint *p)
const;
1309 class CPL_DLL ConstIterator
1312 std::unique_ptr<Private> m_poPrivate;
1315 ConstIterator(
const OGRCurve *poSelf,
bool bStart);
1316 ConstIterator(ConstIterator &&oOther)
noexcept;
1317 ConstIterator &operator=(ConstIterator &&oOther);
1320 ConstIterator &operator++();
1321 bool operator!=(
const ConstIterator &it)
const;
1325 friend inline ConstIterator
end(
const OGRCurve *);
1343 ConstIterator
begin()
const;
1345 ConstIterator
end()
const;
1354 virtual int get_IsClosed()
const;
1358 const char *
const *papszOptions =
nullptr)
const = 0;
1359 int getDimension()
const override;
1370 virtual int isClockwise()
const;
1378 return cpl::down_cast<OGRSimpleCurve *>(
this);
1386 return cpl::down_cast<const OGRSimpleCurve *>(
this);
1393 OGR_FORBID_DOWNCAST_TO_POINT
1394 OGR_ALLOW_CAST_TO_THIS(Curve)
1395 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1396 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
1401inline OGRCurve::ConstIterator
begin(
const OGRCurve *poCurve)
1403 return poCurve->begin();
1407inline OGRCurve::ConstIterator
end(
const OGRCurve *poCurve)
1409 return poCurve->end();
1455 void setX(
double xIn);
1459 void setY(
double yIn);
1463 void setZ(
double zIn);
1467 void setM(
double mIn);
1491 int nPointCount = 0;
1492 int m_nPointCapacity = 0;
1494 double *padfZ =
nullptr;
1495 double *padfM =
nullptr;
1502 OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
int bHasM,
1507 virtual double get_LinearArea()
const;
1517 class CPL_DLL Iterator
1520 std::unique_ptr<Private> m_poPrivate;
1525 Iterator(Iterator &&oOther)
noexcept;
1529 Iterator &operator++();
1530 bool operator!=(
const Iterator &it)
const;
1536 class CPL_DLL ConstIterator
1539 std::unique_ptr<Private> m_poPrivate;
1544 ConstIterator &&oOther)
noexcept;
1548 ConstIterator &operator++();
1549 bool operator!=(
const ConstIterator &it)
const;
1582 ConstIterator
begin()
const;
1584 ConstIterator
end()
const;
1587 size_t WkbSize()
const override;
1589 size_t &nBytesConsumedOut)
override;
1591 exportToWkb(
unsigned char *,
1598 OGRErr importFromWkt(
const char **)
override;
1609 OGRErr *err =
nullptr)
const override;
1612 void empty()
override;
1613 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
1619 double get_Length()
const override;
1620 void StartPoint(
OGRPoint *)
const override;
1621 void EndPoint(
OGRPoint *)
const override;
1622 void Value(
double,
OGRPoint *)
const override;
1623 virtual double Project(
const OGRPoint *)
const;
1624 virtual OGRLineString *getSubLine(
double,
double,
int)
const;
1632 void getPoint(
int,
OGRPoint *)
const;
1636 return paoPoints[i].
x;
1641 return paoPoints[i].
y;
1644 double getZ(
int i)
const;
1645 double getM(
int i)
const;
1651 bool setCoordinateDimension(
int nDimension)
override;
1653 bool setMeasured(
OGRBoolean bIsMeasured)
override;
1654 bool setNumPoints(
int nNewPointCount,
int bZeroizeNewContent = TRUE);
1656 bool setPoint(
int,
double,
double);
1657 bool setZ(
int,
double);
1658 bool setM(
int,
double);
1659 bool setPoint(
int,
double,
double,
double);
1660 bool setPointM(
int,
double,
double,
double);
1661 bool setPoint(
int,
double,
double,
double,
double);
1662 bool setPoints(
int,
const OGRRawPoint *,
const double * =
nullptr);
1663 bool setPointsM(
int,
const OGRRawPoint *,
const double *);
1664 bool setPoints(
int,
const OGRRawPoint *,
const double *,
const double *);
1665 bool setPoints(
int,
const double *padfX,
const double *padfY,
1666 const double *padfZIn =
nullptr);
1667 bool setPointsM(
int,
const double *padfX,
const double *padfY,
1668 const double *padfMIn =
nullptr);
1669 bool setPoints(
int,
const double *padfX,
const double *padfY,
1670 const double *padfZIn,
const double *padfMIn);
1672 bool addPoint(
double,
double);
1673 bool addPoint(
double,
double,
double);
1674 bool addPointM(
double,
double,
double);
1675 bool addPoint(
double,
double,
double,
double);
1677 bool removePoint(
int);
1679 void getPoints(
OGRRawPoint *,
double * =
nullptr)
const;
1680 void getPoints(
void *pabyX,
int nXStride,
void *pabyY,
int nYStride,
1681 void *pabyZ =
nullptr,
int nZStride = 0,
1682 void *pabyM =
nullptr,
int nMStride = 0)
const;
1684 void addSubLineString(
const OGRLineString *,
int nStartVertex = 0,
1685 int nEndVertex = -1);
1686 void reversePoints()
override;
1691 void flattenTo2D()
override;
1692 bool segmentize(
double dfMaxLength)
override;
1694 void swapXY()
override;
1696 OGR_ALLOW_UPCAST_TO(Curve)
1697 OGR_ALLOW_CAST_TO_THIS(SimpleCurve)
1704 return poCurve->begin();
1710 return poCurve->end();
1716 return poCurve->begin();
1722 return poCurve->end();
1748 OGRCurveCasterToLineString GetCasterToLineString()
const override;
1749 OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1751 double get_AreaOfCurveSegments()
const override;
1767 CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
1768 const char *
const *papszOptions =
nullptr)
const override;
1770 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
1779 const char *getGeometryName()
const override;
1796 visitor->
visit(
this);
1801 visitor->
visit(
this);
1804 OGR_ALLOW_UPCAST_TO(SimpleCurve)
1805 OGR_ALLOW_CAST_TO_THIS(LineString)
1839 size_t WkbSize()
const override;
1841 size_t &nBytesConsumedOut)
override;
1842 OGRErr exportToWkb(
unsigned char *,
1851 virtual size_t _WkbSize(
int _flags)
const;
1853 const unsigned char *,
size_t,
1854 size_t &nBytesConsumedOut);
1855 virtual OGRErr _exportToWkb(
int _flags,
unsigned char *,
1858 OGRCurveCasterToLineString GetCasterToLineString()
const override;
1859 OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1877 const char *getGeometryName()
const override;
1881 void reverseWindingOrder()
1882 CPL_WARN_DEPRECATED("Use reversePoints() instead");
1885 void closeRings() override;
1887 int bTestEnvelope = TRUE) const;
1889 int bTestEnvelope = TRUE) const;
1906 visitor->
visit(
this);
1911 visitor->
visit(
this);
1914 OGR_ALLOW_UPCAST_TO(LineString)
1915 OGR_ALLOW_CAST_TO_THIS(LinearRing)
1936 void ExtendEnvelopeWithCircular(
OGREnvelope *psEnvelope)
const;
1937 OGRBoolean IsValidFast(std::string *posReason =
nullptr)
const;
1938 int IsFullCircle(
double &cx,
double &cy,
double &square_R)
const;
1942 OGRCurveCasterToLineString GetCasterToLineString()
const override;
1943 OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1944 int IntersectsPoint(
const OGRPoint *p)
const override;
1945 int ContainsPoint(
const OGRPoint *p)
const override;
1946 double get_AreaOfCurveSegments()
const override;
1963 size_t &nBytesConsumedOut)
override;
1964 OGRErr exportToWkb(
unsigned char *,
1971 OGRErr importFromWkt(
const char **)
override;
1982 OGRErr *err =
nullptr)
const override;
1985 OGRBoolean IsValid(std::string *posReason =
nullptr)
const override;
1986 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
1991 double get_Length()
const override;
1993 CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
1994 const char *
const *papszOptions =
nullptr)
const override;
1995 void Value(
double,
OGRPoint *)
const override;
1996 double get_Area()
const override;
1997 virtual double get_GeodesicArea(
1999 virtual double get_GeodesicLength(
2004 const char *getGeometryName()
const override;
2005 bool segmentize(
double dfMaxLength)
override;
2007 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2009 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2010 const char *
const *papszOptions =
nullptr)
const override;
2026 visitor->
visit(
this);
2031 visitor->
visit(
this);
2034 OGR_ALLOW_UPCAST_TO(SimpleCurve)
2035 OGR_ALLOW_CAST_TO_THIS(CircularString)
2052class CPL_DLL OGRCurveCollection
2060 int nCurveCount = 0;
2064 OGRCurveCollection() =
default;
2065 OGRCurveCollection(
const OGRCurveCollection &other);
2066 OGRCurveCollection(OGRCurveCollection &&other);
2067 ~OGRCurveCollection();
2069 OGRCurveCollection &operator=(
const OGRCurveCollection &other);
2070 OGRCurveCollection &operator=(OGRCurveCollection &&other);
2085 return papoCurves + nCurveCount;
2098 return papoCurves + nCurveCount;
2108 size_t WkbSize()
const;
2110 const unsigned char *pabyData,
size_t &nSize,
2111 size_t &nDataOffset,
2113 size_t nMinSubGeomSize,
2116 importBodyFromWkb(
OGRGeometry *poGeom,
const unsigned char *pabyData,
2117 size_t nSize,
bool bAcceptCompoundCurve,
2125 OGRBoolean Equals(
const OGRCurveCollection *poOCC)
const;
2126 bool setCoordinateDimension(
OGRGeometry *poGeom,
int nNewDimension);
2131 int getNumCurves()
const;
2133 const OGRCurve *getCurve(
int)
const;
2136 OGRErr removeCurve(
int iIndex,
bool bDelete =
true);
2138 bool hasEmptyParts()
const;
2139 void removeEmptyParts();
2141 void reversePoints();
2145 bool segmentize(
double dfMaxLength);
2147 OGRBoolean hasCurveGeometry(
int bLookForNonLinear)
const;
2168 OGRCurveCollection oCC{};
2170 OGRErr addCurveDirectlyInternal(
OGRCurve *poCurve,
double dfToleranceEps,
2176 OGRLineString *CurveToLineInternal(
double dfMaxAngleStepSizeDegrees,
2177 const char *
const *papszOptions,
2178 int bIsLinearRing)
const;
2189 OGRCurveCasterToLineString GetCasterToLineString()
const override;
2190 OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
2235 size_t WkbSize()
const override;
2237 size_t &nBytesConsumedOut)
override;
2238 OGRErr exportToWkb(
unsigned char *,
2245 OGRErr importFromWkt(
const char **)
override;
2256 OGRErr *err =
nullptr)
const override;
2260 void empty()
override;
2261 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
2266 double get_Length()
const override;
2267 void StartPoint(
OGRPoint *)
const override;
2268 void EndPoint(
OGRPoint *)
const override;
2269 void Value(
double,
OGRPoint *)
const override;
2271 CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
2272 const char *
const *papszOptions =
nullptr)
const override;
2274 int getNumPoints()
const override;
2275 double get_AreaOfCurveSegments()
const override;
2276 double get_Area()
const override;
2277 virtual double get_GeodesicArea(
2279 virtual double get_GeodesicLength(
2286 int getNumCurves()
const;
2288 const OGRCurve *getCurve(
int)
const;
2291 bool setCoordinateDimension(
int nDimension)
override;
2293 bool setMeasured(
OGRBoolean bIsMeasured)
override;
2301 static constexpr double DEFAULT_TOLERANCE_EPSILON = 1e-14;
2304 double dfToleranceEps = DEFAULT_TOLERANCE_EPSILON);
2306 double dfToleranceEps = DEFAULT_TOLERANCE_EPSILON);
2307 OGRErr addCurve(std::unique_ptr<OGRCurve>,
2308 double dfToleranceEps = DEFAULT_TOLERANCE_EPSILON);
2311 void reversePoints()
override;
2315 const char *getGeometryName()
const override;
2317 void flattenTo2D()
override;
2318 bool segmentize(
double dfMaxLength)
override;
2320 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2322 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2323 const char *
const *papszOptions =
nullptr)
const override;
2327 visitor->
visit(
this);
2332 visitor->
visit(
this);
2335 void swapXY()
override;
2337 bool hasEmptyParts()
const override;
2338 void removeEmptyParts()
override;
2340 OGR_ALLOW_UPCAST_TO(Curve)
2341 OGR_ALLOW_CAST_TO_THIS(CompoundCurve)
2349 return poCurve->
begin();
2356 return poCurve->
end();
2362 return poCurve->
begin();
2368 return poCurve->
end();
2386 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const = 0;
2387 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
const = 0;
2407 OGR_FORBID_DOWNCAST_TO_POINT
2408 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
2409 OGR_ALLOW_CAST_TO_THIS(Surface)
2410 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
2437 virtual bool isRingCorrectType(
const OGRCurve *poRing)
const;
2439 virtual bool checkRing(
const OGRCurve *poNewRing)
const;
2440 OGRErr addRingDirectlyInternal(
OGRCurve *poCurve,
int bNeedRealloc);
2450 OGRCurveCollection oCC{};
2452 OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2453 virtual OGRSurfaceCasterToCurvePolygon
2454 GetCasterToCurvePolygon()
const override;
2502 const char *getGeometryName()
const override;
2505 void empty()
override;
2507 void flattenTo2D()
override;
2509 bool segmentize(
double dfMaxLength)
override;
2511 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2513 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2514 const char *
const *papszOptions =
nullptr)
const override;
2515 virtual double get_GeodesicArea(
2517 virtual double get_GeodesicLength(
2521 double get_Area()
const override;
2523 double get_Length()
const override;
2526 size_t WkbSize()
const override;
2528 size_t &nBytesConsumedOut)
override;
2529 OGRErr exportToWkb(
unsigned char *,
2536 OGRErr importFromWkt(
const char **)
override;
2547 OGRErr *err =
nullptr)
const override;
2550 int getDimension()
const override;
2551 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
2556 CurvePolyToPoly(
double dfMaxAngleStepSizeDegrees = 0,
2557 const char *
const *papszOptions =
nullptr)
const;
2565 bool setCoordinateDimension(
int nDimension)
override;
2567 bool setMeasured(
OGRBoolean bIsMeasured)
override;
2574 OGRErr addRing(std::unique_ptr<OGRCurve>);
2577 const OGRCurve *getExteriorRingCurve()
const;
2578 int getNumInteriorRings()
const;
2579 OGRCurve *getInteriorRingCurve(
int);
2580 const OGRCurve *getInteriorRingCurve(
int)
const;
2582 OGRCurve *stealExteriorRingCurve();
2584 OGRErr removeRing(
int iIndex,
bool bDelete =
true);
2588 visitor->
visit(
this);
2593 visitor->
visit(
this);
2596 void swapXY()
override;
2598 bool hasEmptyParts()
const override;
2599 void removeEmptyParts()
override;
2601 OGR_ALLOW_UPCAST_TO(Surface)
2602 OGR_ALLOW_CAST_TO_THIS(CurvePolygon)
2610 return poGeom->
begin();
2617 return poGeom->
end();
2623 return poGeom->
begin();
2629 return poGeom->
end();
2657 bool isRingCorrectType(
const OGRCurve *poRing)
const override;
2659 bool checkRing(
const OGRCurve *poNewRing)
const override;
2660 virtual OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
2662 int &nMaxPoints,
double *&padfZ);
2666 OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2667 virtual OGRSurfaceCasterToCurvePolygon
2668 GetCasterToCurvePolygon()
const override;
2675 OGRPolygon(
double x1,
double y1,
double x2,
double y2);
2694 return reinterpret_cast<ChildType **
>(oCC.begin());
2700 return reinterpret_cast<ChildType **
>(oCC.end());
2707 return reinterpret_cast<const ChildType *
const *
>(oCC.begin());
2713 return reinterpret_cast<const ChildType *
const *
>(oCC.end());
2717 const char *getGeometryName()
const override;
2721 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2723 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
2725 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2726 const char *
const *papszOptions =
nullptr)
const override;
2729 size_t WkbSize()
const override;
2731 size_t &nBytesConsumedOut)
override;
2732 OGRErr exportToWkb(
unsigned char *,
2739 OGRErr importFromWkt(
const char **)
override;
2750 OGRErr *err =
nullptr)
const override;
2754 CurvePolyToPoly(
double dfMaxAngleStepSizeDegrees = 0,
2755 const char *
const *papszOptions =
nullptr)
const override;
2781 visitor->
visit(
this);
2786 visitor->
visit(
this);
2789 void closeRings()
override;
2791 OGR_ALLOW_UPCAST_TO(CurvePolygon)
2792 OGR_ALLOW_CAST_TO_THIS(Polygon)
2799 return poGeom->
begin();
2805 return poGeom->
end();
2811 return poGeom->
begin();
2817 return poGeom->
end();
2836 bool quickValidityCheck()
const;
2840 OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2841 virtual OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
2844 double *&padfZ)
override;
2859 const char *getGeometryName()
const override;
2865 size_t &nBytesConsumedOut)
override;
2884 visitor->
visit(
this);
2889 visitor->
visit(
this);
2896 OGR_ALLOW_UPCAST_TO(Polygon)
2897 OGR_ALLOW_CAST_TO_THIS(Triangle)
2913 OGRErr importFromWktInternal(
const char **ppszInput,
int nRecLevel);
2922 const std::string &exclude = std::string())
const;
2927 OGRErr importFromWkbInternal(
const unsigned char *pabyData,
size_t nSize,
2929 size_t &nBytesConsumedOut);
2957 return papoGeoms + nGeomCount;
2970 return papoGeoms + nGeomCount;
2974 const char *getGeometryName()
const override;
2977 void empty()
override;
2979 void flattenTo2D()
override;
2981 bool segmentize(
double dfMaxLength)
override;
2983 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2985 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
2987 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2988 const char *
const *papszOptions =
nullptr)
const override;
2991 virtual double get_GeodesicLength(
2995 size_t WkbSize()
const override;
2997 size_t &nBytesConsumedOut)
override;
2998 OGRErr exportToWkb(
unsigned char *,
3005 OGRErr importFromWkt(
const char **)
override;
3016 OGRErr *err =
nullptr)
const override;
3018 virtual double get_Length()
const;
3019 virtual double get_Area()
const;
3022 int getDimension()
const override;
3023 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
3027 int getNumGeometries()
const;
3035 bool setCoordinateDimension(
int nDimension)
override;
3037 bool setMeasured(
OGRBoolean bIsMeasured)
override;
3040 OGRErr addGeometry(std::unique_ptr<OGRGeometry> geom);
3041 OGRErr addGeometryComponents(std::unique_ptr<OGRGeometryCollection> geom);
3042 virtual OGRErr removeGeometry(
int iIndex,
int bDelete = TRUE);
3043 std::unique_ptr<OGRGeometry> stealGeometry(
int iIndex);
3045 bool hasEmptyParts()
const override;
3046 void removeEmptyParts()
override;
3051 void closeRings()
override;
3053 void swapXY()
override;
3057 visitor->
visit(
this);
3062 visitor->
visit(
this);
3068 OGR_FORBID_DOWNCAST_TO_POINT
3069 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
3070 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
3071 OGR_ALLOW_CAST_TO_THIS(GeometryCollection)
3079 return poGeom->
begin();
3086 return poGeom->
end();
3092 return poGeom->
begin();
3098 return poGeom->
end();
3136 return reinterpret_cast<ChildType **
>(papoGeoms);
3142 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3149 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3155 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3160 const char *getGeometryName()
const override;
3168 OGRErr importFromWkt(
const char **)
override;
3179 OGRErr *err =
nullptr)
const override;
3185 int getDimension()
const override;
3202 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3218 visitor->
visit(
this);
3223 visitor->
visit(
this);
3228 OGR_ALLOW_CAST_TO_THIS(MultiSurface)
3229 OGR_ALLOW_UPCAST_TO(GeometryCollection)
3230 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
3231 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING
3232 OGR_FORBID_DOWNCAST_TO_MULTICURVE
3240 return poGeom->
begin();
3247 return poGeom->
end();
3253 return poGeom->
begin();
3259 return poGeom->
end();
3281 OGRErr _addGeometryWithExpectedSubGeometryType(
3283 OGRErr _addGeometryDirectlyWithExpectedSubGeometryType(
3306 return reinterpret_cast<ChildType **
>(papoGeoms);
3312 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3319 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3325 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3343 const char *getGeometryName()
const override;
3352 size_t &nBytesConsumedOut)
override;
3359 OGRErr *err =
nullptr)
const override;
3363 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3379 visitor->
visit(
this);
3384 visitor->
visit(
this);
3389 OGR_ALLOW_CAST_TO_THIS(MultiPolygon)
3390 OGR_ALLOW_UPCAST_TO(MultiSurface)
3398 return poGeom->
begin();
3405 return poGeom->
end();
3411 return poGeom->
begin();
3417 return poGeom->
end();
3437 OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
3438 virtual OGRSurfaceCasterToCurvePolygon
3439 GetCasterToCurvePolygon()
const override;
3441 virtual const char *getSubGeometryName()
const;
3446 virtual OGRPolyhedralSurfaceCastToMultiPolygon
3447 GetCasterToMultiPolygon()
const;
3493 size_t WkbSize()
const override;
3494 const char *getGeometryName()
const override;
3497 size_t &nBytesConsumedOut)
override;
3498 OGRErr exportToWkb(
unsigned char *,
3505 OGRErr importFromWkt(
const char **)
override;
3516 OGRErr *err =
nullptr)
const override;
3519 int getDimension()
const override;
3521 void empty()
override;
3524 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
3527 void flattenTo2D()
override;
3530 double get_Area()
const override;
3531 virtual double get_GeodesicArea(
3533 double get_Length()
const override;
3534 virtual double get_GeodesicLength(
3541 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3544 OGRErr addGeometry(std::unique_ptr<OGRGeometry> poNewGeom);
3546 int getNumGeometries()
const;
3548 const OGRPolygon *getGeometryRef(
int i)
const;
3551 bool setCoordinateDimension(
int nDimension)
override;
3553 bool setMeasured(
OGRBoolean bIsMeasured)
override;
3554 void swapXY()
override;
3555 OGRErr removeGeometry(
int iIndex,
int bDelete = TRUE);
3557 bool hasEmptyParts()
const override;
3558 void removeEmptyParts()
override;
3562 visitor->
visit(
this);
3567 visitor->
visit(
this);
3573 OGR_ALLOW_CAST_TO_THIS(PolyhedralSurface)
3574 OGR_ALLOW_UPCAST_TO(Surface)
3582 return poGeom->
begin();
3589 return poGeom->
end();
3595 return poGeom->
begin();
3601 return poGeom->
end();
3620 const char *getSubGeometryName()
const override;
3623 virtual OGRPolyhedralSurfaceCastToMultiPolygon
3624 GetCasterToMultiPolygon()
const override;
3647 return reinterpret_cast<ChildType **
>(oMP.begin());
3653 return reinterpret_cast<ChildType **
>(oMP.end());
3660 return reinterpret_cast<const ChildType *
const *
>(oMP.begin());
3666 return reinterpret_cast<const ChildType *
const *
>(oMP.end());
3669 const char *getGeometryName()
const override;
3706 visitor->
visit(
this);
3711 visitor->
visit(
this);
3717 OGR_ALLOW_CAST_TO_THIS(TriangulatedSurface)
3718 OGR_ALLOW_UPCAST_TO(PolyhedralSurface)
3726 return poGeom->
begin();
3733 return poGeom->
end();
3739 return poGeom->
begin();
3745 return poGeom->
end();
3761 OGRErr importFromWkt_Bracketed(
const char **,
int bHasM,
int bHasZ);
3785 return reinterpret_cast<ChildType **
>(papoGeoms);
3791 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3798 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3804 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3822 const char *getGeometryName()
const override;
3830 OGRErr importFromWkt(
const char **)
override;
3841 OGRErr *err =
nullptr)
const override;
3844 int getDimension()
const override;
3860 visitor->
visit(
this);
3865 visitor->
visit(
this);
3870 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3872 OGR_ALLOW_CAST_TO_THIS(MultiPoint)
3873 OGR_ALLOW_UPCAST_TO(GeometryCollection)
3874 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING
3875 OGR_FORBID_DOWNCAST_TO_MULTICURVE
3876 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
3877 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
3884 return poGeom->
begin();
3890 return poGeom->
end();
3896 return poGeom->
begin();
3902 return poGeom->
end();
3944 return reinterpret_cast<ChildType **
>(papoGeoms);
3950 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3957 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3963 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3981 const char *getGeometryName()
const override;
3989 OGRErr importFromWkt(
const char **)
override;
4000 OGRErr *err =
nullptr)
const override;
4003 int getDimension()
const override;
4007 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
4023 visitor->
visit(
this);
4028 visitor->
visit(
this);
4033 OGR_ALLOW_CAST_TO_THIS(MultiCurve)
4034 OGR_ALLOW_UPCAST_TO(GeometryCollection)
4035 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
4036 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
4037 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
4044 return poGeom->
begin();
4050 return poGeom->
end();
4056 return poGeom->
begin();
4062 return poGeom->
end();
4099 return reinterpret_cast<ChildType **
>(papoGeoms);
4105 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
4112 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
4118 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
4136 const char *getGeometryName()
const override;
4145 size_t &nBytesConsumedOut)
override;
4152 OGRErr *err =
nullptr)
const override;
4156 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
4172 visitor->
visit(
this);
4177 visitor->
visit(
this);
4182 OGR_ALLOW_CAST_TO_THIS(MultiLineString)
4183 OGR_ALLOW_UPCAST_TO(MultiCurve)
4184 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
4185 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
4186 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
4194 return poGeom->
begin();
4201 return poGeom->
end();
4207 return poGeom->
begin();
4213 return poGeom->
end();
4228 static OGRErr createFromFgfInternal(
const unsigned char *pabyData,
4231 int *pnBytesConsumed,
int nRecLevel);
4236 size_t =
static_cast<size_t>(-1),
4238 static OGRErr createFromWkb(
const void *pabyData,
4241 size_t &nBytesConsumedOut);
4246 static std::pair<std::unique_ptr<OGRGeometry>,
OGRErr>
4255 CPL_WARN_DEPRECATED(
"Use createFromWkt(const char**, ...) instead")
4257 return createFromWkt(
const_cast<const char **
>(ppszInput), poSRS,
4265 static OGRGeometry *createFromGeoJson(
const char *,
int = -1);
4273 bool bOnlyInOrder =
true);
4280 const char *
const *papszOptions =
nullptr)
4282 CPL_WARN_DEPRECATED(
"Use variant that accepts and returns a "
4283 "std::unique_ptr<OGRGeometry")
4287 static std::unique_ptr<OGRGeometry>
4289 const char *
const *papszOptions =
nullptr);
4291 static std::unique_ptr<OGRGeometry>
4292 makeCompatibleWith(std::unique_ptr<OGRGeometry>,
4297 static std::unique_ptr<OGRGeometry>
4298 organizePolygons(std::vector<std::unique_ptr<OGRGeometry>> &apoPolygons,
4299 bool *pbResultValidGeometry =
nullptr,
4304 int *pbResultValidGeometry,
4307 CPL_WARN_DEPRECATED(
"Use variant that accepts a "
4308 "std::vector<std::unique_ptr<OGRGeometry>>&")
4312 static bool haveGEOS();
4319 std::unique_ptr<Private> d;
4327 static bool isTransformWithOptionsRegularTransform(
4337 static double GetDefaultArcStepSize();
4340 approximateArcAngles(
double dfX,
double dfY,
double dfZ,
4341 double dfPrimaryRadius,
double dfSecondaryAxis,
4342 double dfRotation,
double dfStartAngle,
4343 double dfEndAngle,
double dfMaxAngleStepSizeDegrees,
4344 const bool bUseMaxGap =
false);
4346 static int GetCurveParameters(
double x0,
double y0,
double x1,
double y1,
4347 double x2,
double y2,
double &R,
double &cx,
4348 double &cy,
double &alpha0,
double &alpha1,
4351 curveToLineString(
double x0,
double y0,
double z0,
double x1,
double y1,
4352 double z1,
double x2,
double y2,
double z2,
int bHasZ,
4353 double dfMaxAngleStepSizeDegrees,
4354 const char *
const *papszOptions =
nullptr);
4357 const char *
const *papszOptions =
nullptr);
4362 bool bCamelCase =
false,
4363 bool bAddZM =
false,
4364 bool bSpaceBeforeZM =
false);
4367typedef struct _OGRPreparedGeometry OGRPreparedGeometry;
4369struct CPL_DLL OGRPreparedGeometryUniquePtrDeleter
4371 void operator()(OGRPreparedGeometry *)
const;
4378typedef std::unique_ptr<OGRPreparedGeometry,
4379 OGRPreparedGeometryUniquePtrDeleter>
The CPLJSONArray class holds JSON object from CPLJSONDocument.
Definition cpl_json.h:60
OGRGeometry visitor interface.
Definition ogr_geometry.h:222
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 ~IOGRConstGeometryVisitor()
Destructor/.
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 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:148
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()
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:1934
OGRCircularString()=default
Create an empty circular string.
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2029
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:2019
OGRCircularString(const OGRCircularString &other)
Copy constructor.
OGRSimpleCurve * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:2013
OGRCircularString & operator=(OGRCircularString &&other)=default
Move assignment operator.
OGRCircularString(OGRCircularString &&other)=default
Move constructor.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2024
Utility class to store a collection of curves.
Definition ogr_geometry.h:2166
const ChildType *const * end() const
Return end of curve iterator.
Definition ogr_geometry.h:2229
OGRCompoundCurve()=default
Create an empty compound curve.
const ChildType *const * begin() const
Return begin of curve iterator.
Definition ogr_geometry.h:2223
OGRCompoundCurve(const OGRCompoundCurve &other)
Copy constructor.
OGRCurve ChildType
Type of child elements.
Definition ogr_geometry.h:2206
OGRCompoundCurve(OGRCompoundCurve &&other)=default
Move constructor.
ChildType ** end()
Return end of curve iterator.
Definition ogr_geometry.h:2216
OGRCompoundCurve & operator=(OGRCompoundCurve &&other)=default
Move assignment operator.
ChildType ** begin()
Return begin of curve iterator.
Definition ogr_geometry.h:2210
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2330
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2325
Concrete class representing curve polygons.
Definition ogr_geometry.h:2430
OGRCurvePolygon()=default
Create an empty curve polygon.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2586
OGRCurvePolygon & operator=(OGRCurvePolygon &&other)=default
Move assignment operator.
OGRCurve ChildType
Type of child elements.
Definition ogr_geometry.h:2473
OGRCurvePolygon(OGRCurvePolygon &&)=default
Move constructor.
const ChildType *const * end() const
Return end of curve iterator.
Definition ogr_geometry.h:2496
const ChildType *const * begin() const
Return begin of curve iterator.
Definition ogr_geometry.h:2490
ChildType ** begin()
Return begin of curve iterator.
Definition ogr_geometry.h:2477
ChildType ** end()
Return end of curve iterator.
Definition ogr_geometry.h:2483
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2591
OGRCurvePolygon(const OGRCurvePolygon &)
Copy constructor.
Abstract curve base class for OGRLineString, OGRCircularString and OGRCompoundCurve.
Definition ogr_geometry.h:1291
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.
OGRCurve * clone() const override=0
Make a copy of this object.
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:1384
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:1334
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:1376
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 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:268
void visit(const OGRPoint *) override
Visit OGRPoint.
Definition ogr_geometry.h:272
OGRGeometry visitor default implementation.
Definition ogr_geometry.h:194
void visit(OGRPoint *) override
Visit OGRPoint.
Definition ogr_geometry.h:198
Simple container for a bounding region in 3D.
Definition ogr_core.h:217
Simple container for a bounding region (rectangle)
Definition ogr_core.h:44
Geometry coordinate precision for a binary representation.
Definition ogr_geometry.h:302
A collection of 1 or more geometry objects.
Definition ogr_geometry.h:2912
ChildType ** end()
Return end of sub-geometry iterator.
Definition ogr_geometry.h:2955
OGRGeometryCollection()=default
Create an empty geometry collection.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3055
const ChildType *const * begin() const
Return begin of sub-geometry iterator.
Definition ogr_geometry.h:2962
const ChildType *const * end() const
Return end of sub-geometry iterator.
Definition ogr_geometry.h:2968
ChildType ** begin()
Return begin of sub-geometry iterator.
Definition ogr_geometry.h:2949
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3060
OGRGeometry * getGeometryRef(int)
Fetch geometry from container.
Definition ogrgeometrycollection.cpp:293
OGRGeometry ChildType
Type of child elements.
Definition ogr_geometry.h:2945
Create geometry objects from well known text/binary.
Definition ogr_geometry.h:4227
static OGRErr createFromWkt(char **ppszInput, const OGRSpatialReference *poSRS, OGRGeometry **ppoGeom)
Deprecated.
Definition ogr_geometry.h:4252
Abstract base class for all geometry classes.
Definition ogr_geometry.h:357
const OGRSurface * toSurface() const
Down-cast to OGRSurface*.
Definition ogr_geometry.h:797
const OGRCurvePolygon * toCurvePolygon() const
Down-cast to OGRCurvePolygon*.
Definition ogr_geometry.h:849
const OGRMultiCurve * toMultiCurve() const
Down-cast to OGRMultiCurve*.
Definition ogr_geometry.h:939
const OGRPolyhedralSurface * toPolyhedralSurface() const
Down-cast to OGRPolyhedralSurface*.
Definition ogr_geometry.h:975
const OGRMultiPoint * toMultiPoint() const
Down-cast to OGRMultiPoint*.
Definition ogr_geometry.h:885
virtual void empty()=0
Clear geometry information.
const OGRMultiPolygon * toMultiPolygon() const
Down-cast to OGRMultiPolygon*.
Definition ogr_geometry.h:921
virtual OGRBoolean Equals(const OGRGeometry *) const =0
Returns TRUE if two geometries are equivalent.
OGRPolyhedralSurface * toPolyhedralSurface()
Down-cast to OGRPolyhedralSurface*.
Definition ogr_geometry.h:966
const OGRMultiSurface * toMultiSurface() const
Down-cast to OGRMultiSurface*.
Definition ogr_geometry.h:957
OGRPoint * toPoint()
Down-cast to OGRPoint*.
Definition ogr_geometry.h:665
bool operator!=(const OGRGeometry &other) const
Returns if two geometries are different.
Definition ogr_geometry.h:419
OGRTriangle * toTriangle()
Down-cast to OGRTriangle*.
Definition ogr_geometry.h:823
OGRLineString * toLineString()
Down-cast to OGRLineString*.
Definition ogr_geometry.h:718
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:673
OGRMultiLineString * toMultiLineString()
Down-cast to OGRMultiLineString*.
Definition ogr_geometry.h:894
OGRMultiSurface * toMultiSurface()
Down-cast to OGRMultiSurface*.
Definition ogr_geometry.h:948
static OGRGeometry * FromHandle(OGRGeometryH hGeom)
Convert a OGRGeometryH to a OGRGeometry*.
Definition ogr_geometry.h:657
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:867
const OGRMultiLineString * toMultiLineString() const
Down-cast to OGRMultiLineString*.
Definition ogr_geometry.h:903
const OGRCircularString * toCircularString() const
Down-cast to OGRCircularString*.
Definition ogr_geometry.h:761
OGRPolygon * toPolygon()
Down-cast to OGRPolygon*.
Definition ogr_geometry.h:806
bool operator==(const OGRGeometry &other) const
Returns if two geometries are equal.
Definition ogr_geometry.h:413
OGRLinearRing * toLinearRing()
Down-cast to OGRLinearRing*.
Definition ogr_geometry.h:735
OGRBoolean IsMeasured() const
Definition ogr_geometry.h:441
virtual void accept(IOGRGeometryVisitor *visitor)=0
Accept a visitor.
OGRMultiCurve * toMultiCurve()
Down-cast to OGRMultiCurve*.
Definition ogr_geometry.h:930
const OGRCompoundCurve * toCompoundCurve() const
Down-cast to OGRCompoundCurve*.
Definition ogr_geometry.h:779
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:858
virtual const char * getGeometryName() const =0
Fetch WKT name for geometry type.
OGRMultiPolygon * toMultiPolygon()
Down-cast to OGRMultiPolygon*.
Definition ogr_geometry.h:912
const OGRPolygon * toPolygon() const
Down-cast to OGRPolygon*.
Definition ogr_geometry.h:815
OGRCompoundCurve * toCompoundCurve()
Down-cast to OGRCompoundCurve*.
Definition ogr_geometry.h:770
OGRErr importFromWkt(char **ppszInput)
Deprecated.
Definition ogr_geometry.h:468
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:727
OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const
Convert a geometry into well known text format.
Definition ogrgeometry.cpp:1968
OGRCircularString * toCircularString()
Down-cast to OGRCircularString*.
Definition ogr_geometry.h:752
const OGRCurve * toCurve() const
Down-cast to OGRCurve*.
Definition ogr_geometry.h:691
OGRCurvePolygon * toCurvePolygon()
Down-cast to OGRCurvePolygon*.
Definition ogr_geometry.h:840
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:709
static OGRGeometryH ToHandle(OGRGeometry *poGeom)
Convert a OGRGeometry* to a OGRGeometryH.
Definition ogr_geometry.h:650
OGRBoolean Is3D() const
Definition ogr_geometry.h:435
OGRMultiPoint * toMultiPoint()
Down-cast to OGRMultiPoint*.
Definition ogr_geometry.h:876
const OGRTriangulatedSurface * toTriangulatedSurface() const
Down-cast to OGRTriangulatedSurface*.
Definition ogr_geometry.h:991
const OGRTriangle * toTriangle() const
Down-cast to OGRTriangle*.
Definition ogr_geometry.h:831
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:788
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:700
OGRTriangulatedSurface * toTriangulatedSurface()
Down-cast to OGRTriangulatedSurface*.
Definition ogr_geometry.h:983
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:682
Definition ogr_geometry.h:1440
~OGRIteratedPoint() override
Destructor.
Concrete representation of a multi-vertex line.
Definition ogr_geometry.h:1739
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:1783
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:1799
OGRLineString(const OGRLineString &other)
Copy constructor.
double get_Area() const override
Get the area of the (closed) curve.
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...
int isClockwise() const override
Returns TRUE if the ring has clockwise winding (or less than 2 points)
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:1794
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:1789
OGRLineString()=default
Create an empty line string.
Concrete representation of a closed ring.
Definition ogr_geometry.h:1833
OGRLinearRing()=default
Constructor.
OGRLinearRing & operator=(OGRLinearRing &&other)=default
Move assignment operator.
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:1909
const OGRLineString * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:1899
OGRLinearRing(const OGRLinearRing &other)
Copy constructor.
OGRLinearRing(OGRLinearRing &&other)=default
Move constructor.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:1904
A collection of OGRCurve.
Definition ogr_geometry.h:3917
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3955
OGRMultiCurve()=default
Create an empty multi curve collection.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3961
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3948
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:4026
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:4016
OGRMultiCurve & operator=(OGRMultiCurve &&other)=default
Move assignment operator.
const OGRCurve * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3975
OGRCurve * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3969
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:4021
OGRMultiCurve(const OGRMultiCurve &other)
Copy constructor.
OGRCurve ChildType
Type of child elements.
Definition ogr_geometry.h:3938
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3942
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:4010
OGRMultiCurve(OGRMultiCurve &&other)=default
Move constructor.
A collection of OGRLineString.
Definition ogr_geometry.h:4076
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:4175
OGRLineString ChildType
Type of child elements.
Definition ogr_geometry.h:4093
OGRLineString * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:4124
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:4159
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:4103
OGRMultiLineString()=default
Create an empty multi line string collection.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:4116
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:4110
OGRMultiLineString(OGRMultiLineString &&other)=default
Move constructor.
const OGRLineString * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:4130
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:4097
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:4165
OGRMultiLineString & operator=(OGRMultiLineString &&other)=default
Move assignment operator.
OGRMultiLineString(const OGRMultiLineString &other)
Copy constructor.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:4170
A collection of OGRPoint.
Definition ogr_geometry.h:3759
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3847
OGRMultiPoint & operator=(OGRMultiPoint &&other)=default
Move assignment operator.
OGRMultiPoint()=default
Create an empty multi point collection.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3802
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3783
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3863
OGRMultiPoint(const OGRMultiPoint &other)
Copy constructor.
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3796
OGRMultiPoint(OGRMultiPoint &&other)=default
Move constructor.
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3853
OGRPoint ChildType
Type of child elements.
Definition ogr_geometry.h:3779
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3858
const OGRPoint * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3816
OGRPoint * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3810
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3789
A collection of non-overlapping OGRPolygon.
Definition ogr_geometry.h:3273
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3377
OGRPolygon ChildType
Type of child elements.
Definition ogr_geometry.h:3300
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:3331
OGRMultiPolygon()=default
Create an empty multi polygon collection.
const OGRPolygon * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3337
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3323
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3310
OGRMultiPolygon(OGRMultiPolygon &&other)=default
Move constructor.
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3304
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3366
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3317
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3382
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3372
A collection of non-overlapping OGRSurface.
Definition ogr_geometry.h:3113
const OGRSurface * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3195
OGRMultiSurface & operator=(OGRMultiSurface &&other)=default
Move assignment operator.
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3134
OGRSurface ChildType
Type of child elements.
Definition ogr_geometry.h:3130
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3211
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3147
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3153
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3221
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:3140
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3216
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3205
OGRSurface * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3189
Interface for a point iterator.
Definition ogr_geometry.h:1273
virtual OGRBoolean getNextPoint(OGRPoint *p)=0
Returns the next point followed by the iterator.
Point class.
Definition ogr_geometry.h:1108
double getM() const
Return m.
Definition ogr_geometry.h:1184
void setX(double xIn)
Set x.
Definition ogr_geometry.h:1195
OGRPoint(const OGRPoint &other)
Copy constructor.
OGRPoint & operator=(OGRPoint &&other)=default
Move assignment operator.
void setZ(double zIn)
Set z.
Definition ogr_geometry.h:1219
void setM(double mIn)
Set m.
Definition ogr_geometry.h:1228
double getX() const
Return x.
Definition ogr_geometry.h:1166
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:1245
OGRBoolean IsEmpty() const override
Returns TRUE (non-zero) if the object has no points.
Definition ogr_geometry.h:1159
void setY(double yIn)
Set y.
Definition ogr_geometry.h:1207
double getZ() const
Return z.
Definition ogr_geometry.h:1178
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:1250
double getY() const
Return y.
Definition ogr_geometry.h:1172
OGRPoint(OGRPoint &&other)=default
Move constructor.
Concrete class representing polygons.
Definition ogr_geometry.h:2648
OGRPolygon & operator=(OGRPolygon &&other)=default
Move assignment operator.
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2784
OGRLinearRing ChildType
Type of child elements.
Definition ogr_geometry.h:2688
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:2692
OGRPolygon(OGRPolygon &&other)=default
Move constructor.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2779
const OGRCurvePolygon * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:2774
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:2698
OGRPolygon(const OGRPolygon &other)
Copy constructor.
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:2705
OGRPolygon()=default
Create an empty polygon.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:2711
OGRCurvePolygon * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:2768
PolyhedralSurface class.
Definition ogr_geometry.h:3432
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3474
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3487
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:3481
OGRPolyhedralSurface(OGRPolyhedralSurface &&other)=default
Move constructor.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3560
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3468
OGRPolyhedralSurface()=default
Create an empty PolyhedralSurface.
virtual OGRErr addGeometry(const OGRGeometry *)
Add a new geometry to a collection.
Definition ogrpolyhedralsurface.cpp:744
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3565
OGRPolygon ChildType
Type of child elements.
Definition ogr_geometry.h:3464
OGRPolyhedralSurface & operator=(OGRPolyhedralSurface &&other)=default
Move assignment operator.
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:1486
double getY(int i) const
Get Y at vertex.
Definition ogr_geometry.h:1639
double getX(int i) const
Get X at vertex.
Definition ogr_geometry.h:1634
OGRSimpleCurve()=default
Constructor.
OGRSimpleCurve * clone() const override=0
Make a copy of this object.
OGRPoint ChildType
Type of child elements.
Definition ogr_geometry.h:1563
int getNumPoints() const override
Fetch vertex count.
Definition ogr_geometry.h:1627
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:2383
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 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...
OGRSurface * clone() const override=0
Make a copy of this object.
Triangle class.
Definition ogr_geometry.h:2832
OGRTriangle()=default
Constructor.
const OGRPolygon * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:2877
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2887
OGRTriangle(OGRTriangle &&other)=default
Move constructor.
OGRPolygon * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:2871
OGRTriangle & operator=(OGRTriangle &&other)=default
Move assignment operator.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2882
OGRTriangle(const OGRTriangle &other)
Copy constructor.
TriangulatedSurface class.
Definition ogr_geometry.h:3616
const OGRTriangle * getGeometryRef(int i) const
See OGRPolyhedralSurface::getGeometryRef()
Definition ogr_geometry.h:3680
OGRTriangle * getGeometryRef(int i)
See OGRPolyhedralSurface::getGeometryRef()
Definition ogr_geometry.h:3674
OGRTriangulatedSurface(OGRTriangulatedSurface &&other)=default
Move constructor.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3664
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3658
OGRPolyhedralSurface * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3693
const OGRPolyhedralSurface * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3699
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3709
OGRTriangulatedSurface & operator=(OGRTriangulatedSurface &&other)=default
Move assignment operator.
OGRTriangle ChildType
Type of child elements.
Definition ogr_geometry.h:3641
OGRTriangulatedSurface()=default
Constructor.
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3645
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3651
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3704
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
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:1101
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1252
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition cpl_port.h:1035
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:165
Forward definitions of GDAL/OGR/OSR C handle types.
void * OGRGeometryH
Opaque type for a geometry.
Definition gdal_fwd.h:96
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:625
@ wkbNDR
LSB/Intel/Vax: Least Significant Byte First
Definition ogr_core.h:627
OGRwkbVariant
Output variants of WKB we support.
Definition ogr_core.h:558
@ wkbVariantOldOgc
Old-style 99-402 extended dimension (Z) WKB types.
Definition ogr_core.h:559
OGRwkbGeometryType
List of well known binary geometry types.
Definition ogr_core.h:423
int OGRErr
Type for a OGR error.
Definition ogr_core.h:388
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:2725
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:4380
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:2646
std::unique_ptr< OGRGeometry, OGRGeometryUniquePtrDeleter > OGRGeometryUniquePtr
Unique pointer type for OGRGeometry.
Definition ogr_geometry.h:1008
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:478
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition ogrsf_frmts.h:486
Geometry coordinate precision.
Definition ogr_geomcoordinateprecision.h:40
WKB export options.
Definition ogr_geometry.h:326