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;
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);
560 virtual
double Distance(const
OGRGeometry *) const;
567 BufferEx(
double dfDist,
585 DelaunayTriangulation(
double dfTolerance,
593 virtual
double Distance3D(const
OGRGeometry *poOtherGeom) const;
595 OGRGeometry *SetPrecision(
double dfGridSize,
int nFlags) const;
597 virtual
bool hasEmptyParts() const;
598 virtual
void removeEmptyParts();
603 CPL_WARN_DEPRECATED("Non standard method. "
604 "Use Intersects() instead");
606 CPL_WARN_DEPRECATED("Non standard method. "
607 "Use Equals() instead");
609 CPL_WARN_DEPRECATED("Non standard method. "
610 "Use SymDifference() instead");
612 CPL_WARN_DEPRECATED("Non standard method. "
613 "Use Boundary() instead");
618 static
int bGenerate_DB2_V72_BYTE_ORDER;
621 virtual
void swapXY();
623 bool IsRectangle() const;
654 return cpl::down_cast<OGRPoint *>(
this);
662 return cpl::down_cast<const OGRPoint *>(
this);
671 return cpl::down_cast<OGRCurve *>(
this);
680 return cpl::down_cast<const OGRCurve *>(
this);
689 return cpl::down_cast<OGRSimpleCurve *>(
this);
698 return cpl::down_cast<const OGRSimpleCurve *>(
this);
707 return cpl::down_cast<OGRLineString *>(
this);
716 return cpl::down_cast<const OGRLineString *>(
this);
724 return cpl::down_cast<OGRLinearRing *>(
this);
732 return cpl::down_cast<const OGRLinearRing *>(
this);
741 return cpl::down_cast<OGRCircularString *>(
this);
750 return cpl::down_cast<const OGRCircularString *>(
this);
759 return cpl::down_cast<OGRCompoundCurve *>(
this);
768 return cpl::down_cast<const OGRCompoundCurve *>(
this);
777 return cpl::down_cast<OGRSurface *>(
this);
786 return cpl::down_cast<const OGRSurface *>(
this);
795 return cpl::down_cast<OGRPolygon *>(
this);
804 return cpl::down_cast<const OGRPolygon *>(
this);
812 return cpl::down_cast<OGRTriangle *>(
this);
820 return cpl::down_cast<const OGRTriangle *>(
this);
829 return cpl::down_cast<OGRCurvePolygon *>(
this);
838 return cpl::down_cast<const OGRCurvePolygon *>(
this);
847 return cpl::down_cast<OGRGeometryCollection *>(
this);
856 return cpl::down_cast<const OGRGeometryCollection *>(
this);
865 return cpl::down_cast<OGRMultiPoint *>(
this);
874 return cpl::down_cast<const OGRMultiPoint *>(
this);
883 return cpl::down_cast<OGRMultiLineString *>(
this);
892 return cpl::down_cast<const OGRMultiLineString *>(
this);
901 return cpl::down_cast<OGRMultiPolygon *>(
this);
910 return cpl::down_cast<const OGRMultiPolygon *>(
this);
919 return cpl::down_cast<OGRMultiCurve *>(
this);
928 return cpl::down_cast<const OGRMultiCurve *>(
this);
937 return cpl::down_cast<OGRMultiSurface *>(
this);
946 return cpl::down_cast<const OGRMultiSurface *>(
this);
955 return cpl::down_cast<OGRPolyhedralSurface *>(
this);
964 return cpl::down_cast<const OGRPolyhedralSurface *>(
this);
972 return cpl::down_cast<OGRTriangulatedSurface *>(
this);
980 return cpl::down_cast<const OGRTriangulatedSurface *>(
this);
985struct CPL_DLL OGRGeometryUniquePtrDeleter
994typedef std::unique_ptr<OGRGeometry, OGRGeometryUniquePtrDeleter>
998#define OGR_FORBID_DOWNCAST_TO(name) \
999 inline OGR##name *to##name() = delete; \
1000 inline const OGR##name *to##name() const = delete;
1002#define OGR_FORBID_DOWNCAST_TO_POINT OGR_FORBID_DOWNCAST_TO(Point)
1003#define OGR_FORBID_DOWNCAST_TO_CURVE OGR_FORBID_DOWNCAST_TO(Curve)
1004#define OGR_FORBID_DOWNCAST_TO_SIMPLE_CURVE OGR_FORBID_DOWNCAST_TO(SimpleCurve)
1005#define OGR_FORBID_DOWNCAST_TO_LINESTRING OGR_FORBID_DOWNCAST_TO(LineString)
1006#define OGR_FORBID_DOWNCAST_TO_LINEARRING OGR_FORBID_DOWNCAST_TO(LinearRing)
1007#define OGR_FORBID_DOWNCAST_TO_CIRCULARSTRING \
1008 OGR_FORBID_DOWNCAST_TO(CircularString)
1009#define OGR_FORBID_DOWNCAST_TO_COMPOUNDCURVE \
1010 OGR_FORBID_DOWNCAST_TO(CompoundCurve)
1011#define OGR_FORBID_DOWNCAST_TO_SURFACE OGR_FORBID_DOWNCAST_TO(Surface)
1012#define OGR_FORBID_DOWNCAST_TO_CURVEPOLYGON OGR_FORBID_DOWNCAST_TO(CurvePolygon)
1013#define OGR_FORBID_DOWNCAST_TO_POLYGON OGR_FORBID_DOWNCAST_TO(Polygon)
1014#define OGR_FORBID_DOWNCAST_TO_TRIANGLE OGR_FORBID_DOWNCAST_TO(Triangle)
1015#define OGR_FORBID_DOWNCAST_TO_MULTIPOINT OGR_FORBID_DOWNCAST_TO(MultiPoint)
1016#define OGR_FORBID_DOWNCAST_TO_MULTICURVE OGR_FORBID_DOWNCAST_TO(MultiCurve)
1017#define OGR_FORBID_DOWNCAST_TO_MULTILINESTRING \
1018 OGR_FORBID_DOWNCAST_TO(MultiLineString)
1019#define OGR_FORBID_DOWNCAST_TO_MULTISURFACE OGR_FORBID_DOWNCAST_TO(MultiSurface)
1020#define OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON OGR_FORBID_DOWNCAST_TO(MultiPolygon)
1021#define OGR_FORBID_DOWNCAST_TO_GEOMETRYCOLLECTION \
1022 OGR_FORBID_DOWNCAST_TO(GeometryCollection)
1023#define OGR_FORBID_DOWNCAST_TO_POLYHEDRALSURFACE \
1024 OGR_FORBID_DOWNCAST_TO(PolyhedralSurface)
1025#define OGR_FORBID_DOWNCAST_TO_TIN OGR_FORBID_DOWNCAST_TO(TriangulatedSurface)
1027#define OGR_ALLOW_UPCAST_TO(name) \
1028 inline OGR##name *to##name() \
1032 inline const OGR##name *to##name() const \
1037#ifndef SUPPRESS_OGR_ALLOW_CAST_TO_THIS_WARNING
1038#define CAST_TO_THIS_WARNING CPL_WARN_DEPRECATED("Casting to this is useless")
1040#define CAST_TO_THIS_WARNING
1043#define OGR_ALLOW_CAST_TO_THIS(name) \
1044 inline OGR##name *to##name() CAST_TO_THIS_WARNING \
1048 inline const OGR##name *to##name() const CAST_TO_THIS_WARNING \
1053#define OGR_FORBID_DOWNCAST_TO_ALL_CURVES \
1054 OGR_FORBID_DOWNCAST_TO_CURVE \
1055 OGR_FORBID_DOWNCAST_TO_SIMPLE_CURVE \
1056 OGR_FORBID_DOWNCAST_TO_LINESTRING \
1057 OGR_FORBID_DOWNCAST_TO_LINEARRING \
1058 OGR_FORBID_DOWNCAST_TO_CIRCULARSTRING \
1059 OGR_FORBID_DOWNCAST_TO_COMPOUNDCURVE
1061#define OGR_FORBID_DOWNCAST_TO_ALL_SURFACES \
1062 OGR_FORBID_DOWNCAST_TO_SURFACE \
1063 OGR_FORBID_DOWNCAST_TO_CURVEPOLYGON \
1064 OGR_FORBID_DOWNCAST_TO_POLYGON \
1065 OGR_FORBID_DOWNCAST_TO_TRIANGLE \
1066 OGR_FORBID_DOWNCAST_TO_POLYHEDRALSURFACE \
1067 OGR_FORBID_DOWNCAST_TO_TIN
1069#define OGR_FORBID_DOWNCAST_TO_ALL_SINGLES \
1070 OGR_FORBID_DOWNCAST_TO_POINT \
1071 OGR_FORBID_DOWNCAST_TO_ALL_CURVES \
1072 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1074#define OGR_FORBID_DOWNCAST_TO_ALL_MULTI \
1075 OGR_FORBID_DOWNCAST_TO_GEOMETRYCOLLECTION \
1076 OGR_FORBID_DOWNCAST_TO_MULTIPOINT \
1077 OGR_FORBID_DOWNCAST_TO_MULTICURVE \
1078 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING \
1079 OGR_FORBID_DOWNCAST_TO_MULTISURFACE \
1080 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
1104 OGRPoint(
double x,
double y,
double z);
1105 OGRPoint(
double x,
double y,
double z,
double m);
1109 static OGRPoint *createXYM(
double x,
double y,
double m);
1116 size_t WkbSize()
const override;
1118 size_t &nBytesConsumedOut)
override;
1119 OGRErr exportToWkb(
unsigned char *,
1126 OGRErr importFromWkt(
const char **)
override;
1137 OGRErr *err =
nullptr)
const override;
1140 int getDimension()
const override;
1142 void empty()
override;
1143 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
1148 return !(flags & OGR_G_NOT_EMPTY_POINT);
1177 bool setCoordinateDimension(
int nDimension)
override;
1185 if (std::isnan(x) || std::isnan(y))
1186 flags &= ~OGR_G_NOT_EMPTY_POINT;
1188 flags |= OGR_G_NOT_EMPTY_POINT;
1197 if (std::isnan(x) || std::isnan(y))
1198 flags &= ~OGR_G_NOT_EMPTY_POINT;
1200 flags |= OGR_G_NOT_EMPTY_POINT;
1218 flags |= OGR_G_MEASURED;
1227 const char *getGeometryName()
const override;
1230 void flattenTo2D()
override;
1234 visitor->
visit(
this);
1239 visitor->
visit(
this);
1242 void swapXY()
override;
1244 OGR_ALLOW_CAST_TO_THIS(Point)
1245 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
1246 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1247 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
1285 virtual OGRCurveCasterToLineString GetCasterToLineString()
const = 0;
1286 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const = 0;
1291 virtual int ContainsPoint(
const OGRPoint *p)
const;
1292 virtual int IntersectsPoint(
const OGRPoint *p)
const;
1296 class CPL_DLL ConstIterator
1299 std::unique_ptr<Private> m_poPrivate;
1302 ConstIterator(
const OGRCurve *poSelf,
bool bStart);
1303 ConstIterator(ConstIterator &&oOther)
noexcept;
1304 ConstIterator &operator=(ConstIterator &&oOther);
1307 ConstIterator &operator++();
1308 bool operator!=(
const ConstIterator &it)
const;
1312 friend inline ConstIterator
end(
const OGRCurve *);
1330 ConstIterator
begin()
const;
1332 ConstIterator
end()
const;
1341 virtual int get_IsClosed()
const;
1345 const char *
const *papszOptions =
nullptr)
const = 0;
1346 int getDimension()
const override;
1357 virtual int isClockwise()
const;
1365 return cpl::down_cast<OGRSimpleCurve *>(
this);
1373 return cpl::down_cast<const OGRSimpleCurve *>(
this);
1380 OGR_FORBID_DOWNCAST_TO_POINT
1381 OGR_ALLOW_CAST_TO_THIS(Curve)
1382 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1383 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
1388inline OGRCurve::ConstIterator
begin(
const OGRCurve *poCurve)
1390 return poCurve->begin();
1394inline OGRCurve::ConstIterator
end(
const OGRCurve *poCurve)
1396 return poCurve->end();
1442 void setX(
double xIn);
1446 void setY(
double yIn);
1450 void setZ(
double zIn);
1454 void setM(
double mIn);
1478 int nPointCount = 0;
1479 int m_nPointCapacity = 0;
1481 double *padfZ =
nullptr;
1482 double *padfM =
nullptr;
1489 OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
int bHasM,
1494 virtual double get_LinearArea()
const;
1504 class CPL_DLL Iterator
1507 std::unique_ptr<Private> m_poPrivate;
1512 Iterator(Iterator &&oOther)
noexcept;
1516 Iterator &operator++();
1517 bool operator!=(
const Iterator &it)
const;
1523 class CPL_DLL ConstIterator
1526 std::unique_ptr<Private> m_poPrivate;
1531 ConstIterator &&oOther)
noexcept;
1535 ConstIterator &operator++();
1536 bool operator!=(
const ConstIterator &it)
const;
1569 ConstIterator
begin()
const;
1571 ConstIterator
end()
const;
1574 size_t WkbSize()
const override;
1576 size_t &nBytesConsumedOut)
override;
1578 exportToWkb(
unsigned char *,
1585 OGRErr importFromWkt(
const char **)
override;
1596 OGRErr *err =
nullptr)
const override;
1599 void empty()
override;
1600 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
1606 double get_Length()
const override;
1607 void StartPoint(
OGRPoint *)
const override;
1608 void EndPoint(
OGRPoint *)
const override;
1609 void Value(
double,
OGRPoint *)
const override;
1610 virtual double Project(
const OGRPoint *)
const;
1611 virtual OGRLineString *getSubLine(
double,
double,
int)
const;
1619 void getPoint(
int,
OGRPoint *)
const;
1623 return paoPoints[i].
x;
1628 return paoPoints[i].
y;
1631 double getZ(
int i)
const;
1632 double getM(
int i)
const;
1638 bool setCoordinateDimension(
int nDimension)
override;
1640 bool setMeasured(
OGRBoolean bIsMeasured)
override;
1641 bool setNumPoints(
int nNewPointCount,
int bZeroizeNewContent = TRUE);
1643 bool setPoint(
int,
double,
double);
1644 bool setZ(
int,
double);
1645 bool setM(
int,
double);
1646 bool setPoint(
int,
double,
double,
double);
1647 bool setPointM(
int,
double,
double,
double);
1648 bool setPoint(
int,
double,
double,
double,
double);
1649 bool setPoints(
int,
const OGRRawPoint *,
const double * =
nullptr);
1650 bool setPointsM(
int,
const OGRRawPoint *,
const double *);
1651 bool setPoints(
int,
const OGRRawPoint *,
const double *,
const double *);
1652 bool setPoints(
int,
const double *padfX,
const double *padfY,
1653 const double *padfZIn =
nullptr);
1654 bool setPointsM(
int,
const double *padfX,
const double *padfY,
1655 const double *padfMIn =
nullptr);
1656 bool setPoints(
int,
const double *padfX,
const double *padfY,
1657 const double *padfZIn,
const double *padfMIn);
1659 bool addPoint(
double,
double);
1660 bool addPoint(
double,
double,
double);
1661 bool addPointM(
double,
double,
double);
1662 bool addPoint(
double,
double,
double,
double);
1664 bool removePoint(
int);
1666 void getPoints(
OGRRawPoint *,
double * =
nullptr)
const;
1667 void getPoints(
void *pabyX,
int nXStride,
void *pabyY,
int nYStride,
1668 void *pabyZ =
nullptr,
int nZStride = 0,
1669 void *pabyM =
nullptr,
int nMStride = 0)
const;
1671 void addSubLineString(
const OGRLineString *,
int nStartVertex = 0,
1672 int nEndVertex = -1);
1673 void reversePoints()
override;
1678 void flattenTo2D()
override;
1679 bool segmentize(
double dfMaxLength)
override;
1681 void swapXY()
override;
1683 OGR_ALLOW_UPCAST_TO(Curve)
1684 OGR_ALLOW_CAST_TO_THIS(SimpleCurve)
1691 return poCurve->begin();
1697 return poCurve->end();
1703 return poCurve->begin();
1709 return poCurve->end();
1735 OGRCurveCasterToLineString GetCasterToLineString()
const override;
1736 OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1738 double get_AreaOfCurveSegments()
const override;
1754 CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
1755 const char *
const *papszOptions =
nullptr)
const override;
1757 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
1766 const char *getGeometryName()
const override;
1783 visitor->
visit(
this);
1788 visitor->
visit(
this);
1791 OGR_ALLOW_UPCAST_TO(SimpleCurve)
1792 OGR_ALLOW_CAST_TO_THIS(LineString)
1826 size_t WkbSize()
const override;
1828 size_t &nBytesConsumedOut)
override;
1829 OGRErr exportToWkb(
unsigned char *,
1838 virtual size_t _WkbSize(
int _flags)
const;
1840 const unsigned char *,
size_t,
1841 size_t &nBytesConsumedOut);
1842 virtual OGRErr _exportToWkb(
int _flags,
unsigned char *,
1845 OGRCurveCasterToLineString GetCasterToLineString()
const override;
1846 OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1864 const char *getGeometryName()
const override;
1868 void reverseWindingOrder()
1869 CPL_WARN_DEPRECATED("Use reversePoints() instead");
1872 void closeRings() override;
1874 int bTestEnvelope = TRUE) const;
1876 int bTestEnvelope = TRUE) const;
1893 visitor->
visit(
this);
1898 visitor->
visit(
this);
1901 OGR_ALLOW_UPCAST_TO(LineString)
1902 OGR_ALLOW_CAST_TO_THIS(LinearRing)
1923 void ExtendEnvelopeWithCircular(
OGREnvelope *psEnvelope)
const;
1925 int IsFullCircle(
double &cx,
double &cy,
double &square_R)
const;
1929 OGRCurveCasterToLineString GetCasterToLineString()
const override;
1930 OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1931 int IntersectsPoint(
const OGRPoint *p)
const override;
1932 int ContainsPoint(
const OGRPoint *p)
const override;
1933 double get_AreaOfCurveSegments()
const override;
1950 size_t &nBytesConsumedOut)
override;
1951 OGRErr exportToWkb(
unsigned char *,
1958 OGRErr importFromWkt(
const char **)
override;
1969 OGRErr *err =
nullptr)
const override;
1973 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
1978 double get_Length()
const override;
1980 CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
1981 const char *
const *papszOptions =
nullptr)
const override;
1982 void Value(
double,
OGRPoint *)
const override;
1983 double get_Area()
const override;
1984 virtual double get_GeodesicArea(
1986 virtual double get_GeodesicLength(
1991 const char *getGeometryName()
const override;
1992 bool segmentize(
double dfMaxLength)
override;
1994 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
1996 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
1997 const char *
const *papszOptions =
nullptr)
const override;
2013 visitor->
visit(
this);
2018 visitor->
visit(
this);
2021 OGR_ALLOW_UPCAST_TO(SimpleCurve)
2022 OGR_ALLOW_CAST_TO_THIS(CircularString)
2039class CPL_DLL OGRCurveCollection
2047 int nCurveCount = 0;
2051 OGRCurveCollection() =
default;
2052 OGRCurveCollection(
const OGRCurveCollection &other);
2053 OGRCurveCollection(OGRCurveCollection &&other);
2054 ~OGRCurveCollection();
2056 OGRCurveCollection &operator=(
const OGRCurveCollection &other);
2057 OGRCurveCollection &operator=(OGRCurveCollection &&other);
2072 return papoCurves + nCurveCount;
2085 return papoCurves + nCurveCount;
2095 size_t WkbSize()
const;
2097 const unsigned char *pabyData,
size_t &nSize,
2098 size_t &nDataOffset,
2100 size_t nMinSubGeomSize,
2103 importBodyFromWkb(
OGRGeometry *poGeom,
const unsigned char *pabyData,
2104 size_t nSize,
bool bAcceptCompoundCurve,
2112 OGRBoolean Equals(
const OGRCurveCollection *poOCC)
const;
2113 bool setCoordinateDimension(
OGRGeometry *poGeom,
int nNewDimension);
2118 int getNumCurves()
const;
2120 const OGRCurve *getCurve(
int)
const;
2123 OGRErr removeCurve(
int iIndex,
bool bDelete =
true);
2125 bool hasEmptyParts()
const;
2126 void removeEmptyParts();
2128 void reversePoints();
2132 bool segmentize(
double dfMaxLength);
2134 OGRBoolean hasCurveGeometry(
int bLookForNonLinear)
const;
2155 OGRCurveCollection oCC{};
2157 OGRErr addCurveDirectlyInternal(
OGRCurve *poCurve,
double dfToleranceEps,
2163 OGRLineString *CurveToLineInternal(
double dfMaxAngleStepSizeDegrees,
2164 const char *
const *papszOptions,
2165 int bIsLinearRing)
const;
2176 OGRCurveCasterToLineString GetCasterToLineString()
const override;
2177 OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
2222 size_t WkbSize()
const override;
2224 size_t &nBytesConsumedOut)
override;
2225 OGRErr exportToWkb(
unsigned char *,
2232 OGRErr importFromWkt(
const char **)
override;
2243 OGRErr *err =
nullptr)
const override;
2247 void empty()
override;
2248 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
2253 double get_Length()
const override;
2254 void StartPoint(
OGRPoint *)
const override;
2255 void EndPoint(
OGRPoint *)
const override;
2256 void Value(
double,
OGRPoint *)
const override;
2258 CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
2259 const char *
const *papszOptions =
nullptr)
const override;
2261 int getNumPoints()
const override;
2262 double get_AreaOfCurveSegments()
const override;
2263 double get_Area()
const override;
2264 virtual double get_GeodesicArea(
2266 virtual double get_GeodesicLength(
2273 int getNumCurves()
const;
2275 const OGRCurve *getCurve(
int)
const;
2278 bool setCoordinateDimension(
int nDimension)
override;
2280 bool setMeasured(
OGRBoolean bIsMeasured)
override;
2288 static constexpr double DEFAULT_TOLERANCE_EPSILON = 1e-14;
2291 double dfToleranceEps = DEFAULT_TOLERANCE_EPSILON);
2293 double dfToleranceEps = DEFAULT_TOLERANCE_EPSILON);
2294 OGRErr addCurve(std::unique_ptr<OGRCurve>,
2295 double dfToleranceEps = DEFAULT_TOLERANCE_EPSILON);
2298 void reversePoints()
override;
2302 const char *getGeometryName()
const override;
2304 void flattenTo2D()
override;
2305 bool segmentize(
double dfMaxLength)
override;
2307 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2309 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2310 const char *
const *papszOptions =
nullptr)
const override;
2314 visitor->
visit(
this);
2319 visitor->
visit(
this);
2322 void swapXY()
override;
2324 bool hasEmptyParts()
const override;
2325 void removeEmptyParts()
override;
2327 OGR_ALLOW_UPCAST_TO(Curve)
2328 OGR_ALLOW_CAST_TO_THIS(CompoundCurve)
2336 return poCurve->
begin();
2343 return poCurve->
end();
2349 return poCurve->
begin();
2355 return poCurve->
end();
2373 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const = 0;
2374 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
const = 0;
2394 OGR_FORBID_DOWNCAST_TO_POINT
2395 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
2396 OGR_ALLOW_CAST_TO_THIS(Surface)
2397 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
2424 virtual bool isRingCorrectType(
const OGRCurve *poRing)
const;
2426 virtual bool checkRing(
const OGRCurve *poNewRing)
const;
2427 OGRErr addRingDirectlyInternal(
OGRCurve *poCurve,
int bNeedRealloc);
2437 OGRCurveCollection oCC{};
2439 OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2440 virtual OGRSurfaceCasterToCurvePolygon
2441 GetCasterToCurvePolygon()
const override;
2489 const char *getGeometryName()
const override;
2492 void empty()
override;
2494 void flattenTo2D()
override;
2496 bool segmentize(
double dfMaxLength)
override;
2498 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2500 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2501 const char *
const *papszOptions =
nullptr)
const override;
2502 virtual double get_GeodesicArea(
2504 virtual double get_GeodesicLength(
2508 double get_Area()
const override;
2510 double get_Length()
const override;
2513 size_t WkbSize()
const override;
2515 size_t &nBytesConsumedOut)
override;
2516 OGRErr exportToWkb(
unsigned char *,
2523 OGRErr importFromWkt(
const char **)
override;
2534 OGRErr *err =
nullptr)
const override;
2537 int getDimension()
const override;
2538 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
2543 CurvePolyToPoly(
double dfMaxAngleStepSizeDegrees = 0,
2544 const char *
const *papszOptions =
nullptr)
const;
2552 bool setCoordinateDimension(
int nDimension)
override;
2554 bool setMeasured(
OGRBoolean bIsMeasured)
override;
2561 OGRErr addRing(std::unique_ptr<OGRCurve>);
2564 const OGRCurve *getExteriorRingCurve()
const;
2565 int getNumInteriorRings()
const;
2566 OGRCurve *getInteriorRingCurve(
int);
2567 const OGRCurve *getInteriorRingCurve(
int)
const;
2569 OGRCurve *stealExteriorRingCurve();
2571 OGRErr removeRing(
int iIndex,
bool bDelete =
true);
2575 visitor->
visit(
this);
2580 visitor->
visit(
this);
2583 void swapXY()
override;
2585 bool hasEmptyParts()
const override;
2586 void removeEmptyParts()
override;
2588 OGR_ALLOW_UPCAST_TO(Surface)
2589 OGR_ALLOW_CAST_TO_THIS(CurvePolygon)
2597 return poGeom->
begin();
2604 return poGeom->
end();
2610 return poGeom->
begin();
2616 return poGeom->
end();
2644 bool isRingCorrectType(
const OGRCurve *poRing)
const override;
2646 bool checkRing(
const OGRCurve *poNewRing)
const override;
2647 virtual OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
2649 int &nMaxPoints,
double *&padfZ);
2653 OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2654 virtual OGRSurfaceCasterToCurvePolygon
2655 GetCasterToCurvePolygon()
const override;
2662 OGRPolygon(
double x1,
double y1,
double x2,
double y2);
2681 return reinterpret_cast<ChildType **
>(oCC.begin());
2687 return reinterpret_cast<ChildType **
>(oCC.end());
2694 return reinterpret_cast<const ChildType *
const *
>(oCC.begin());
2700 return reinterpret_cast<const ChildType *
const *
>(oCC.end());
2704 const char *getGeometryName()
const override;
2708 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2710 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
2712 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2713 const char *
const *papszOptions =
nullptr)
const override;
2716 size_t WkbSize()
const override;
2718 size_t &nBytesConsumedOut)
override;
2719 OGRErr exportToWkb(
unsigned char *,
2726 OGRErr importFromWkt(
const char **)
override;
2737 OGRErr *err =
nullptr)
const override;
2741 CurvePolyToPoly(
double dfMaxAngleStepSizeDegrees = 0,
2742 const char *
const *papszOptions =
nullptr)
const override;
2768 visitor->
visit(
this);
2773 visitor->
visit(
this);
2776 void closeRings()
override;
2778 OGR_ALLOW_UPCAST_TO(CurvePolygon)
2779 OGR_ALLOW_CAST_TO_THIS(Polygon)
2786 return poGeom->
begin();
2792 return poGeom->
end();
2798 return poGeom->
begin();
2804 return poGeom->
end();
2823 bool quickValidityCheck()
const;
2827 OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2828 virtual OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
2831 double *&padfZ)
override;
2846 const char *getGeometryName()
const override;
2852 size_t &nBytesConsumedOut)
override;
2871 visitor->
visit(
this);
2876 visitor->
visit(
this);
2883 OGR_ALLOW_UPCAST_TO(Polygon)
2884 OGR_ALLOW_CAST_TO_THIS(Triangle)
2900 OGRErr importFromWktInternal(
const char **ppszInput,
int nRecLevel);
2909 const std::string &exclude = std::string())
const;
2914 OGRErr importFromWkbInternal(
const unsigned char *pabyData,
size_t nSize,
2916 size_t &nBytesConsumedOut);
2944 return papoGeoms + nGeomCount;
2957 return papoGeoms + nGeomCount;
2961 const char *getGeometryName()
const override;
2964 void empty()
override;
2966 void flattenTo2D()
override;
2968 bool segmentize(
double dfMaxLength)
override;
2970 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2972 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
2974 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2975 const char *
const *papszOptions =
nullptr)
const override;
2978 virtual double get_GeodesicLength(
2982 size_t WkbSize()
const override;
2984 size_t &nBytesConsumedOut)
override;
2985 OGRErr exportToWkb(
unsigned char *,
2992 OGRErr importFromWkt(
const char **)
override;
3003 OGRErr *err =
nullptr)
const override;
3005 virtual double get_Length()
const;
3006 virtual double get_Area()
const;
3009 int getDimension()
const override;
3010 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
3014 int getNumGeometries()
const;
3022 bool setCoordinateDimension(
int nDimension)
override;
3024 bool setMeasured(
OGRBoolean bIsMeasured)
override;
3027 OGRErr addGeometry(std::unique_ptr<OGRGeometry> geom);
3028 virtual OGRErr removeGeometry(
int iIndex,
int bDelete = TRUE);
3029 std::unique_ptr<OGRGeometry> stealGeometry(
int iIndex);
3031 bool hasEmptyParts()
const override;
3032 void removeEmptyParts()
override;
3037 void closeRings()
override;
3039 void swapXY()
override;
3043 visitor->
visit(
this);
3048 visitor->
visit(
this);
3054 OGR_FORBID_DOWNCAST_TO_POINT
3055 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
3056 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
3057 OGR_ALLOW_CAST_TO_THIS(GeometryCollection)
3065 return poGeom->
begin();
3072 return poGeom->
end();
3078 return poGeom->
begin();
3084 return poGeom->
end();
3122 return reinterpret_cast<ChildType **
>(papoGeoms);
3128 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3135 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3141 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3146 const char *getGeometryName()
const override;
3154 OGRErr importFromWkt(
const char **)
override;
3165 OGRErr *err =
nullptr)
const override;
3171 int getDimension()
const override;
3188 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3204 visitor->
visit(
this);
3209 visitor->
visit(
this);
3214 OGR_ALLOW_CAST_TO_THIS(MultiSurface)
3215 OGR_ALLOW_UPCAST_TO(GeometryCollection)
3216 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
3217 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING
3218 OGR_FORBID_DOWNCAST_TO_MULTICURVE
3226 return poGeom->
begin();
3233 return poGeom->
end();
3239 return poGeom->
begin();
3245 return poGeom->
end();
3267 OGRErr _addGeometryWithExpectedSubGeometryType(
3269 OGRErr _addGeometryDirectlyWithExpectedSubGeometryType(
3292 return reinterpret_cast<ChildType **
>(papoGeoms);
3298 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3305 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3311 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3329 const char *getGeometryName()
const override;
3338 size_t &nBytesConsumedOut)
override;
3345 OGRErr *err =
nullptr)
const override;
3349 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3365 visitor->
visit(
this);
3370 visitor->
visit(
this);
3375 OGR_ALLOW_CAST_TO_THIS(MultiPolygon)
3376 OGR_ALLOW_UPCAST_TO(MultiSurface)
3384 return poGeom->
begin();
3391 return poGeom->
end();
3397 return poGeom->
begin();
3403 return poGeom->
end();
3423 OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
3424 virtual OGRSurfaceCasterToCurvePolygon
3425 GetCasterToCurvePolygon()
const override;
3427 virtual const char *getSubGeometryName()
const;
3432 virtual OGRPolyhedralSurfaceCastToMultiPolygon
3433 GetCasterToMultiPolygon()
const;
3479 size_t WkbSize()
const override;
3480 const char *getGeometryName()
const override;
3483 size_t &nBytesConsumedOut)
override;
3484 OGRErr exportToWkb(
unsigned char *,
3491 OGRErr importFromWkt(
const char **)
override;
3502 OGRErr *err =
nullptr)
const override;
3505 int getDimension()
const override;
3507 void empty()
override;
3510 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
3513 void flattenTo2D()
override;
3516 double get_Area()
const override;
3517 virtual double get_GeodesicArea(
3519 double get_Length()
const override;
3520 virtual double get_GeodesicLength(
3527 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3530 OGRErr addGeometry(std::unique_ptr<OGRGeometry> poNewGeom);
3532 int getNumGeometries()
const;
3534 const OGRPolygon *getGeometryRef(
int i)
const;
3537 bool setCoordinateDimension(
int nDimension)
override;
3539 bool setMeasured(
OGRBoolean bIsMeasured)
override;
3540 void swapXY()
override;
3541 OGRErr removeGeometry(
int iIndex,
int bDelete = TRUE);
3543 bool hasEmptyParts()
const override;
3544 void removeEmptyParts()
override;
3548 visitor->
visit(
this);
3553 visitor->
visit(
this);
3559 OGR_ALLOW_CAST_TO_THIS(PolyhedralSurface)
3560 OGR_ALLOW_UPCAST_TO(Surface)
3568 return poGeom->
begin();
3575 return poGeom->
end();
3581 return poGeom->
begin();
3587 return poGeom->
end();
3606 const char *getSubGeometryName()
const override;
3609 virtual OGRPolyhedralSurfaceCastToMultiPolygon
3610 GetCasterToMultiPolygon()
const override;
3633 return reinterpret_cast<ChildType **
>(oMP.begin());
3639 return reinterpret_cast<ChildType **
>(oMP.end());
3646 return reinterpret_cast<const ChildType *
const *
>(oMP.begin());
3652 return reinterpret_cast<const ChildType *
const *
>(oMP.end());
3655 const char *getGeometryName()
const override;
3692 visitor->
visit(
this);
3697 visitor->
visit(
this);
3703 OGR_ALLOW_CAST_TO_THIS(TriangulatedSurface)
3704 OGR_ALLOW_UPCAST_TO(PolyhedralSurface)
3712 return poGeom->
begin();
3719 return poGeom->
end();
3725 return poGeom->
begin();
3731 return poGeom->
end();
3747 OGRErr importFromWkt_Bracketed(
const char **,
int bHasM,
int bHasZ);
3771 return reinterpret_cast<ChildType **
>(papoGeoms);
3777 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3784 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3790 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3808 const char *getGeometryName()
const override;
3816 OGRErr importFromWkt(
const char **)
override;
3827 OGRErr *err =
nullptr)
const override;
3830 int getDimension()
const override;
3846 visitor->
visit(
this);
3851 visitor->
visit(
this);
3856 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3858 OGR_ALLOW_CAST_TO_THIS(MultiPoint)
3859 OGR_ALLOW_UPCAST_TO(GeometryCollection)
3860 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING
3861 OGR_FORBID_DOWNCAST_TO_MULTICURVE
3862 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
3863 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
3870 return poGeom->
begin();
3876 return poGeom->
end();
3882 return poGeom->
begin();
3888 return poGeom->
end();
3930 return reinterpret_cast<ChildType **
>(papoGeoms);
3936 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3943 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3949 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3967 const char *getGeometryName()
const override;
3975 OGRErr importFromWkt(
const char **)
override;
3986 OGRErr *err =
nullptr)
const override;
3989 int getDimension()
const override;
3993 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
4009 visitor->
visit(
this);
4014 visitor->
visit(
this);
4019 OGR_ALLOW_CAST_TO_THIS(MultiCurve)
4020 OGR_ALLOW_UPCAST_TO(GeometryCollection)
4021 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
4022 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
4023 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
4030 return poGeom->
begin();
4036 return poGeom->
end();
4042 return poGeom->
begin();
4048 return poGeom->
end();
4085 return reinterpret_cast<ChildType **
>(papoGeoms);
4091 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
4098 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
4104 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
4122 const char *getGeometryName()
const override;
4131 size_t &nBytesConsumedOut)
override;
4138 OGRErr *err =
nullptr)
const override;
4142 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
4158 visitor->
visit(
this);
4163 visitor->
visit(
this);
4168 OGR_ALLOW_CAST_TO_THIS(MultiLineString)
4169 OGR_ALLOW_UPCAST_TO(MultiCurve)
4170 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
4171 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
4172 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
4180 return poGeom->
begin();
4187 return poGeom->
end();
4193 return poGeom->
begin();
4199 return poGeom->
end();
4214 static OGRErr createFromFgfInternal(
const unsigned char *pabyData,
4217 int *pnBytesConsumed,
int nRecLevel);
4222 size_t =
static_cast<size_t>(-1),
4224 static OGRErr createFromWkb(
const void *pabyData,
4227 size_t &nBytesConsumedOut);
4232 static std::pair<std::unique_ptr<OGRGeometry>,
OGRErr>
4241 CPL_WARN_DEPRECATED(
"Use createFromWkt(const char**, ...) instead")
4243 return createFromWkt(
const_cast<const char **
>(ppszInput), poSRS,
4251 static OGRGeometry *createFromGeoJson(
const char *,
int = -1);
4259 bool bOnlyInOrder =
true);
4266 const char *
const *papszOptions =
nullptr);
4268 static std::unique_ptr<OGRGeometry>
4269 makeCompatibleWith(std::unique_ptr<OGRGeometry>,
4276 int *pbResultValidGeometry,
4277 const char **papszOptions =
nullptr);
4278 static bool haveGEOS();
4285 std::unique_ptr<Private> d;
4293 static bool isTransformWithOptionsRegularTransform(
4300 char **papszOptions,
4303 static double GetDefaultArcStepSize();
4306 approximateArcAngles(
double dfX,
double dfY,
double dfZ,
4307 double dfPrimaryRadius,
double dfSecondaryAxis,
4308 double dfRotation,
double dfStartAngle,
4309 double dfEndAngle,
double dfMaxAngleStepSizeDegrees,
4310 const bool bUseMaxGap =
false);
4312 static int GetCurveParameters(
double x0,
double y0,
double x1,
double y1,
4313 double x2,
double y2,
double &R,
double &cx,
4314 double &cy,
double &alpha0,
double &alpha1,
4317 curveToLineString(
double x0,
double y0,
double z0,
double x1,
double y1,
4318 double z1,
double x2,
double y2,
double z2,
int bHasZ,
4319 double dfMaxAngleStepSizeDegrees,
4320 const char *
const *papszOptions =
nullptr);
4323 const char *
const *papszOptions =
nullptr);
4328 bool bCamelCase =
false,
4329 bool bAddZM =
false,
4330 bool bSpaceBeforeZM =
false);
4333typedef struct _OGRPreparedGeometry OGRPreparedGeometry;
4335struct CPL_DLL OGRPreparedGeometryUniquePtrDeleter
4337 void operator()(OGRPreparedGeometry *)
const;
4344typedef std::unique_ptr<OGRPreparedGeometry,
4345 OGRPreparedGeometryUniquePtrDeleter>
The CPLJSONArray class holds JSON object from CPLJSONDocument.
Definition cpl_json.h:56
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:1921
OGRCircularString()=default
Create an empty circular string.
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2016
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:2006
OGRCircularString(const OGRCircularString &other)
Copy constructor.
OGRSimpleCurve * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:2000
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:2011
Utility class to store a collection of curves.
Definition ogr_geometry.h:2153
const ChildType *const * end() const
Return end of curve iterator.
Definition ogr_geometry.h:2216
OGRCompoundCurve()=default
Create an empty compound curve.
const ChildType *const * begin() const
Return begin of curve iterator.
Definition ogr_geometry.h:2210
OGRCompoundCurve(const OGRCompoundCurve &other)
Copy constructor.
OGRCurve ChildType
Type of child elements.
Definition ogr_geometry.h:2193
OGRCompoundCurve(OGRCompoundCurve &&other)=default
Move constructor.
ChildType ** end()
Return end of curve iterator.
Definition ogr_geometry.h:2203
OGRCompoundCurve & operator=(OGRCompoundCurve &&other)=default
Move assignment operator.
ChildType ** begin()
Return begin of curve iterator.
Definition ogr_geometry.h:2197
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2317
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2312
Concrete class representing curve polygons.
Definition ogr_geometry.h:2417
OGRCurvePolygon()=default
Create an empty curve polygon.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2573
OGRCurvePolygon & operator=(OGRCurvePolygon &&other)=default
Move assignment operator.
OGRCurve ChildType
Type of child elements.
Definition ogr_geometry.h:2460
OGRCurvePolygon(OGRCurvePolygon &&)=default
Move constructor.
const ChildType *const * end() const
Return end of curve iterator.
Definition ogr_geometry.h:2483
const ChildType *const * begin() const
Return begin of curve iterator.
Definition ogr_geometry.h:2477
ChildType ** begin()
Return begin of curve iterator.
Definition ogr_geometry.h:2464
ChildType ** end()
Return end of curve iterator.
Definition ogr_geometry.h:2470
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2578
OGRCurvePolygon(const OGRCurvePolygon &)
Copy constructor.
Abstract curve base class for OGRLineString, OGRCircularString and OGRCompoundCurve.
Definition ogr_geometry.h:1278
virtual OGRPointIterator * getPointIterator() const =0
Returns a point iterator over the curve.
OGRCurve * clone() const override=0
Make a copy of this object.
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...
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:1371
virtual double get_Length() const =0
Returns the length of the curve.
OGRPoint ChildType
Type of child elements.
Definition ogr_geometry.h:1321
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:1363
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 Value(double, OGRPoint *) const =0
Fetch point at given distance along curve.
virtual int getNumPoints() const =0
Return the number of points of a curve geometry.
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...
virtual void StartPoint(OGRPoint *) const =0
Return the curve start point.
virtual void EndPoint(OGRPoint *) const =0
Return the curve end point.
virtual OGRLineString * CurveToLine(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const =0
Return a linestring from a curve geometry.
virtual void reversePoints()=0
Reverse point order.
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:199
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:2899
ChildType ** end()
Return end of sub-geometry iterator.
Definition ogr_geometry.h:2942
OGRGeometryCollection()=default
Create an empty geometry collection.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3041
const ChildType *const * begin() const
Return begin of sub-geometry iterator.
Definition ogr_geometry.h:2949
const ChildType *const * end() const
Return end of sub-geometry iterator.
Definition ogr_geometry.h:2955
ChildType ** begin()
Return begin of sub-geometry iterator.
Definition ogr_geometry.h:2936
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3046
OGRGeometry * getGeometryRef(int)
Fetch geometry from container.
Definition ogrgeometrycollection.cpp:293
OGRGeometry ChildType
Type of child elements.
Definition ogr_geometry.h:2932
Create geometry objects from well known text/binary.
Definition ogr_geometry.h:4213
static OGRErr createFromWkt(char **ppszInput, const OGRSpatialReference *poSRS, OGRGeometry **ppoGeom)
Deprecated.
Definition ogr_geometry.h:4238
Abstract base class for all geometry classes.
Definition ogr_geometry.h:357
const OGRSurface * toSurface() const
Down-cast to OGRSurface*.
Definition ogr_geometry.h:784
const OGRCurvePolygon * toCurvePolygon() const
Down-cast to OGRCurvePolygon*.
Definition ogr_geometry.h:836
const OGRMultiCurve * toMultiCurve() const
Down-cast to OGRMultiCurve*.
Definition ogr_geometry.h:926
const OGRPolyhedralSurface * toPolyhedralSurface() const
Down-cast to OGRPolyhedralSurface*.
Definition ogr_geometry.h:962
const OGRMultiPoint * toMultiPoint() const
Down-cast to OGRMultiPoint*.
Definition ogr_geometry.h:872
const OGRMultiPolygon * toMultiPolygon() const
Down-cast to OGRMultiPolygon*.
Definition ogr_geometry.h:908
OGRPolyhedralSurface * toPolyhedralSurface()
Down-cast to OGRPolyhedralSurface*.
Definition ogr_geometry.h:953
const OGRMultiSurface * toMultiSurface() const
Down-cast to OGRMultiSurface*.
Definition ogr_geometry.h:944
OGRPoint * toPoint()
Down-cast to OGRPoint*.
Definition ogr_geometry.h:652
virtual OGRGeometry * clone() const =0
Make a copy of this object.
virtual OGRErr transform(OGRCoordinateTransformation *poCT)=0
Apply arbitrary coordinate transformation to geometry.
virtual OGRErr importFromWkt(const char **ppszInput)=0
Assign geometry from well known text data.
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:810
OGRLineString * toLineString()
Down-cast to OGRLineString*.
Definition ogr_geometry.h:705
const OGRLinearRing * toLinearRing() const
Down-cast to OGRLinearRing*.
Definition ogr_geometry.h:730
const OGRPoint * toPoint() const
Down-cast to OGRPoint*.
Definition ogr_geometry.h:660
virtual void empty()=0
Clear geometry information.
virtual OGRBoolean IsEmpty() const =0
Returns TRUE (non-zero) if the object has no points.
OGRMultiLineString * toMultiLineString()
Down-cast to OGRMultiLineString*.
Definition ogr_geometry.h:881
OGRMultiSurface * toMultiSurface()
Down-cast to OGRMultiSurface*.
Definition ogr_geometry.h:935
static OGRGeometry * FromHandle(OGRGeometryH hGeom)
Convert a OGRGeometryH to a OGRGeometry*.
Definition ogr_geometry.h:644
virtual void flattenTo2D()=0
Convert geometry to strictly 2D.
virtual void accept(IOGRConstGeometryVisitor *visitor) const =0
Accept a visitor.
const OGRGeometryCollection * toGeometryCollection() const
Down-cast to OGRGeometryCollection*.
Definition ogr_geometry.h:854
const OGRMultiLineString * toMultiLineString() const
Down-cast to OGRMultiLineString*.
Definition ogr_geometry.h:890
virtual OGRBoolean Equals(const OGRGeometry *) const =0
Returns TRUE if two geometries are equivalent.
virtual int getDimension() const =0
Get the dimension of this object.
const OGRCircularString * toCircularString() const
Down-cast to OGRCircularString*.
Definition ogr_geometry.h:748
OGRPolygon * toPolygon()
Down-cast to OGRPolygon*.
Definition ogr_geometry.h:793
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:722
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:917
const OGRCompoundCurve * toCompoundCurve() const
Down-cast to OGRCompoundCurve*.
Definition ogr_geometry.h:766
virtual OGRwkbGeometryType getGeometryType() const =0
Fetch geometry type.
OGRGeometryCollection * toGeometryCollection()
Down-cast to OGRGeometryCollection*.
Definition ogr_geometry.h:845
OGRMultiPolygon * toMultiPolygon()
Down-cast to OGRMultiPolygon*.
Definition ogr_geometry.h:899
const OGRPolygon * toPolygon() const
Down-cast to OGRPolygon*.
Definition ogr_geometry.h:802
OGRCompoundCurve * toCompoundCurve()
Down-cast to OGRCompoundCurve*.
Definition ogr_geometry.h:757
OGRErr importFromWkt(char **ppszInput)
Deprecated.
Definition ogr_geometry.h:468
const OGRLineString * toLineString() const
Down-cast to OGRLineString*.
Definition ogr_geometry.h:714
OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const
Convert a geometry into well known text format.
Definition ogrgeometry.cpp:1961
OGRCircularString * toCircularString()
Down-cast to OGRCircularString*.
Definition ogr_geometry.h:739
const OGRCurve * toCurve() const
Down-cast to OGRCurve*.
Definition ogr_geometry.h:678
OGRCurvePolygon * toCurvePolygon()
Down-cast to OGRCurvePolygon*.
Definition ogr_geometry.h:827
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:696
static OGRGeometryH ToHandle(OGRGeometry *poGeom)
Convert a OGRGeometry* to a OGRGeometryH.
Definition ogr_geometry.h:637
OGRBoolean Is3D() const
Definition ogr_geometry.h:435
OGRMultiPoint * toMultiPoint()
Down-cast to OGRMultiPoint*.
Definition ogr_geometry.h:863
virtual const char * getGeometryName() const =0
Fetch WKT name for geometry type.
const OGRTriangulatedSurface * toTriangulatedSurface() const
Down-cast to OGRTriangulatedSurface*.
Definition ogr_geometry.h:978
const OGRTriangle * toTriangle() const
Down-cast to OGRTriangle*.
Definition ogr_geometry.h:818
OGRSurface * toSurface()
Down-cast to OGRSurface*.
Definition ogr_geometry.h:775
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:687
OGRTriangulatedSurface * toTriangulatedSurface()
Down-cast to OGRTriangulatedSurface*.
Definition ogr_geometry.h:970
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:669
Definition ogr_geometry.h:1427
~OGRIteratedPoint() override
Destructor.
Concrete representation of a multi-vertex line.
Definition ogr_geometry.h:1726
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:1770
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:1786
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:1781
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:1776
OGRLineString()=default
Create an empty line string.
Concrete representation of a closed ring.
Definition ogr_geometry.h:1820
OGRLinearRing()=default
Constructor.
OGRLinearRing & operator=(OGRLinearRing &&other)=default
Move assignment operator.
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:1896
const OGRLineString * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:1886
OGRLinearRing(const OGRLinearRing &other)
Copy constructor.
OGRLinearRing(OGRLinearRing &&other)=default
Move constructor.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:1891
A collection of OGRCurve.
Definition ogr_geometry.h:3903
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3941
OGRMultiCurve()=default
Create an empty multi curve collection.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3947
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3934
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:4012
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:4002
OGRMultiCurve & operator=(OGRMultiCurve &&other)=default
Move assignment operator.
const OGRCurve * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3961
OGRCurve * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3955
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:4007
OGRMultiCurve(const OGRMultiCurve &other)
Copy constructor.
OGRCurve ChildType
Type of child elements.
Definition ogr_geometry.h:3924
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3928
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3996
OGRMultiCurve(OGRMultiCurve &&other)=default
Move constructor.
A collection of OGRLineString.
Definition ogr_geometry.h:4062
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:4161
OGRLineString ChildType
Type of child elements.
Definition ogr_geometry.h:4079
OGRLineString * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:4110
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:4145
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:4089
OGRMultiLineString()=default
Create an empty multi line string collection.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:4102
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:4096
OGRMultiLineString(OGRMultiLineString &&other)=default
Move constructor.
const OGRLineString * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:4116
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:4083
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:4151
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:4156
A collection of OGRPoint.
Definition ogr_geometry.h:3745
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3833
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:3788
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3769
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3849
OGRMultiPoint(const OGRMultiPoint &other)
Copy constructor.
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3782
OGRMultiPoint(OGRMultiPoint &&other)=default
Move constructor.
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3839
OGRPoint ChildType
Type of child elements.
Definition ogr_geometry.h:3765
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3844
const OGRPoint * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3802
OGRPoint * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3796
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3775
A collection of non-overlapping OGRPolygon.
Definition ogr_geometry.h:3259
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3363
OGRPolygon ChildType
Type of child elements.
Definition ogr_geometry.h:3286
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:3317
OGRMultiPolygon()=default
Create an empty multi polygon collection.
const OGRPolygon * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3323
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3309
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3296
OGRMultiPolygon(OGRMultiPolygon &&other)=default
Move constructor.
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3290
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3352
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3303
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3368
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3358
A collection of non-overlapping OGRSurface.
Definition ogr_geometry.h:3099
const OGRSurface * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3181
OGRMultiSurface & operator=(OGRMultiSurface &&other)=default
Move assignment operator.
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3120
OGRSurface ChildType
Type of child elements.
Definition ogr_geometry.h:3116
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3197
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3133
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3139
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3207
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:3126
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3202
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3191
OGRSurface * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition ogr_geometry.h:3175
Interface for a point iterator.
Definition ogr_geometry.h:1260
virtual OGRBoolean getNextPoint(OGRPoint *p)=0
Returns the next point followed by the iterator.
Point class.
Definition ogr_geometry.h:1095
double getM() const
Return m.
Definition ogr_geometry.h:1171
void setX(double xIn)
Set x.
Definition ogr_geometry.h:1182
OGRPoint(const OGRPoint &other)
Copy constructor.
OGRPoint & operator=(OGRPoint &&other)=default
Move assignment operator.
void setZ(double zIn)
Set z.
Definition ogr_geometry.h:1206
void setM(double mIn)
Set m.
Definition ogr_geometry.h:1215
double getX() const
Return x.
Definition ogr_geometry.h:1153
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:1232
OGRBoolean IsEmpty() const override
Returns TRUE (non-zero) if the object has no points.
Definition ogr_geometry.h:1146
void setY(double yIn)
Set y.
Definition ogr_geometry.h:1194
double getZ() const
Return z.
Definition ogr_geometry.h:1165
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:1237
double getY() const
Return y.
Definition ogr_geometry.h:1159
OGRPoint(OGRPoint &&other)=default
Move constructor.
Concrete class representing polygons.
Definition ogr_geometry.h:2635
OGRPolygon & operator=(OGRPolygon &&other)=default
Move assignment operator.
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2771
OGRLinearRing ChildType
Type of child elements.
Definition ogr_geometry.h:2675
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:2679
OGRPolygon(OGRPolygon &&other)=default
Move constructor.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2766
const OGRCurvePolygon * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:2761
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:2685
OGRPolygon(const OGRPolygon &other)
Copy constructor.
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:2692
OGRPolygon()=default
Create an empty polygon.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:2698
OGRCurvePolygon * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:2755
PolyhedralSurface class.
Definition ogr_geometry.h:3418
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3460
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3473
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:3467
OGRPolyhedralSurface(OGRPolyhedralSurface &&other)=default
Move constructor.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3546
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3454
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:3551
OGRPolygon ChildType
Type of child elements.
Definition ogr_geometry.h:3450
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:1473
double getY(int i) const
Get Y at vertex.
Definition ogr_geometry.h:1626
double getX(int i) const
Get X at vertex.
Definition ogr_geometry.h:1621
OGRSimpleCurve()=default
Constructor.
OGRSimpleCurve * clone() const override=0
Make a copy of this object.
OGRPoint ChildType
Type of child elements.
Definition ogr_geometry.h:1550
int getNumPoints() const override
Fetch vertex count.
Definition ogr_geometry.h:1614
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:2370
virtual double get_GeodesicLength(const OGRSpatialReference *poSRSOverride=nullptr) const =0
Get the length of the surface, where curve edges are geodesic lines on the underlying ellipsoid of th...
virtual 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_Area() const =0
Get the area of the surface object.
OGRSurface * clone() const override=0
Make a copy of this object.
virtual double get_Length() const =0
Get the length of the surface.
Triangle class.
Definition ogr_geometry.h:2819
OGRTriangle()=default
Constructor.
const OGRPolygon * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:2864
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2874
OGRTriangle(OGRTriangle &&other)=default
Move constructor.
OGRPolygon * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:2858
OGRTriangle & operator=(OGRTriangle &&other)=default
Move assignment operator.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2869
OGRTriangle(const OGRTriangle &other)
Copy constructor.
TriangulatedSurface class.
Definition ogr_geometry.h:3602
const OGRTriangle * getGeometryRef(int i) const
See OGRPolyhedralSurface::getGeometryRef()
Definition ogr_geometry.h:3666
OGRTriangle * getGeometryRef(int i)
See OGRPolyhedralSurface::getGeometryRef()
Definition ogr_geometry.h:3660
OGRTriangulatedSurface(OGRTriangulatedSurface &&other)=default
Move constructor.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3650
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3644
OGRPolyhedralSurface * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3679
const OGRPolyhedralSurface * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3685
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3695
OGRTriangulatedSurface & operator=(OGRTriangulatedSurface &&other)=default
Move assignment operator.
OGRTriangle ChildType
Type of child elements.
Definition ogr_geometry.h:3627
OGRTriangulatedSurface()=default
Constructor.
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3631
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3637
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3690
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:936
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1087
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition cpl_port.h:870
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:175
Forward definitions of GDAL/OGR/OSR C handle types.
void * OGRGeometryH
Opaque type for a geometry.
Definition gdal_fwd.h:96
Core portability services for cross-platform OGR code.
int OGRBoolean
Type for a OGR boolean.
Definition ogr_core.h:386
OGRwkbByteOrder
Enumeration to describe byte order.
Definition ogr_core.h:607
@ wkbNDR
LSB/Intel/Vax: Least Significant Byte First
Definition ogr_core.h:609
OGRwkbVariant
Output variants of WKB we support.
Definition ogr_core.h:540
@ wkbVariantOldOgc
Old-style 99-402 extended dimension (Z) WKB types.
Definition ogr_core.h:541
OGRwkbGeometryType
List of well known binary geometry types.
Definition ogr_core.h:405
int OGRErr
Type for a OGR error.
Definition ogr_core.h:370
Geometry coordinate precision class.
const char * OGRToOGCGeomType(OGRwkbGeometryType eGeomType, bool bCamelCase=false, bool bAddZM=false, bool bSpaceBeforeZM=false)
Map OGR geometry format constants to corresponding OGC geometry type.
Definition ogrgeometry.cpp:2605
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:4346
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:2526
std::unique_ptr< OGRGeometry, OGRGeometryUniquePtrDeleter > OGRGeometryUniquePtr
Unique pointer type for OGRGeometry.
Definition ogr_geometry.h:995
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:470
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition ogrsf_frmts.h:478
Geometry coordinate precision.
Definition ogr_geomcoordinateprecision.h:40
WKB export options.
Definition ogr_geometry.h:326