32#ifndef OGR_GEOMETRY_H_INCLUDED
33#define OGR_GEOMETRY_H_INCLUDED
38#include "ogr_geomcoordinateprecision.h"
52#ifndef DEFINEH_OGRGeometryH
53#define DEFINEH_OGRGeometryH
83 bool round = getDefaultRound();
89 : xyPrecision(getDefaultPrecision()), zPrecision(xyPrecision),
90 mPrecision(zPrecision)
98 static int getDefaultPrecision();
99 static bool getDefaultRound();
324 int nXYBitPrecision =
383 friend class OGRCurveCollection;
385 unsigned int flags = 0;
387 OGRErr importPreambleFromWkt(
const char **ppszInput,
int *pbHasZ,
388 int *pbHasM,
bool *pbIsEmpty);
389 OGRErr importCurveCollectionFromWkt(
390 const char **ppszInput,
int bAllowEmptyComponent,
int bAllowLineString,
391 int bAllowCurve,
int bAllowCompoundCurve,
393 OGRErr importPreambleFromWkb(
const unsigned char *pabyData,
size_t nSize,
396 OGRErr importPreambleOfCollectionFromWkb(
const unsigned char *pabyData,
397 size_t &nSize,
size_t &nDataOffset,
399 size_t nMinSubGeomSize,
405 void HomogenizeDimensionalityWith(
OGRGeometry *poOtherGeom);
419 static const unsigned int OGR_G_NOT_EMPTY_POINT = 0x1;
420 static const unsigned int OGR_G_3D = 0x2;
421 static const unsigned int OGR_G_MEASURED = 0x4;
433 return CPL_TO_BOOL(Equals(&other));
439 return !CPL_TO_BOOL(Equals(&other));
444 virtual int getCoordinateDimension()
const;
445 int CoordinateDimension()
const;
455 return (flags & OGR_G_3D) != 0;
461 return (flags & OGR_G_MEASURED) != 0;
471 virtual
size_t WkbSize() const = 0;
472 OGRErr importFromWkb(const
GByte *,
size_t = static_cast<
size_t>(-1),
475 size_t &nBytesConsumedOut) = 0;
478 virtual
OGRErr exportToWkb(
unsigned char *,
480 virtual
OGRErr importFromWkt(const
char **ppszInput) = 0;
488 CPL_WARN_DEPRECATED(
"Use importFromWkt(const char**) instead")
491 return importFromWkt(
const_cast<const char **
>(ppszInput));
495 OGRErr exportToWkt(
char **ppszDstText,
503 OGRErr *err =
nullptr)
const = 0;
509 void dumpReadable(FILE *,
const char * =
nullptr,
511 std::string dumpReadable(
const char * =
nullptr,
514 virtual char *exportToGML(
const char *
const *papszOptions =
nullptr)
const;
515 virtual char *exportToKML()
const;
516 virtual char *exportToJson(
CSLConstList papszOptions =
nullptr)
const;
528 virtual OGRBoolean hasCurveGeometry(
int bLookForNonLinear = FALSE)
const;
532 double dfMaxAngleStepSizeDegrees = 0,
544 virtual
void closeRings();
546 virtual
void setCoordinateDimension(
int nDimension);
548 virtual
void setMeasured(
OGRBoolean bIsMeasured);
560 virtual void segmentize(
double dfMaxLength);
577 virtual
double Distance(const
OGRGeometry *) const;
599 DelaunayTriangulation(
double dfTolerance,
604 virtual
double Distance3D(const
OGRGeometry *poOtherGeom) const;
606 OGRGeometry *SetPrecision(
double dfGridSize,
int nFlags) const;
611 CPL_WARN_DEPRECATED("Non standard method. "
612 "Use Intersects() instead");
614 CPL_WARN_DEPRECATED("Non standard method. "
615 "Use Equals() instead");
617 CPL_WARN_DEPRECATED("Non standard method. "
618 "Use SymDifference() instead");
620 CPL_WARN_DEPRECATED("Non standard method. "
621 "Use Boundary() instead");
626 static
int bGenerate_DB2_V72_BYTE_ORDER;
629 virtual
void swapXY();
663 return cpl::down_cast<OGRPoint *>(
this);
672 return cpl::down_cast<const OGRPoint *>(
this);
682 return cpl::down_cast<OGRCurve *>(
this);
692 return cpl::down_cast<const OGRCurve *>(
this);
702 return cpl::down_cast<OGRSimpleCurve *>(
this);
712 return cpl::down_cast<const OGRSimpleCurve *>(
this);
722 return cpl::down_cast<OGRLineString *>(
this);
732 return cpl::down_cast<const OGRLineString *>(
this);
741 return cpl::down_cast<OGRLinearRing *>(
this);
750 return cpl::down_cast<const OGRLinearRing *>(
this);
760 return cpl::down_cast<OGRCircularString *>(
this);
770 return cpl::down_cast<const OGRCircularString *>(
this);
780 return cpl::down_cast<OGRCompoundCurve *>(
this);
790 return cpl::down_cast<const OGRCompoundCurve *>(
this);
800 return cpl::down_cast<OGRSurface *>(
this);
810 return cpl::down_cast<const OGRSurface *>(
this);
820 return cpl::down_cast<OGRPolygon *>(
this);
830 return cpl::down_cast<const OGRPolygon *>(
this);
839 return cpl::down_cast<OGRTriangle *>(
this);
848 return cpl::down_cast<const OGRTriangle *>(
this);
858 return cpl::down_cast<OGRCurvePolygon *>(
this);
868 return cpl::down_cast<const OGRCurvePolygon *>(
this);
878 return cpl::down_cast<OGRGeometryCollection *>(
this);
888 return cpl::down_cast<const OGRGeometryCollection *>(
this);
898 return cpl::down_cast<OGRMultiPoint *>(
this);
908 return cpl::down_cast<const OGRMultiPoint *>(
this);
918 return cpl::down_cast<OGRMultiLineString *>(
this);
928 return cpl::down_cast<const OGRMultiLineString *>(
this);
938 return cpl::down_cast<OGRMultiPolygon *>(
this);
948 return cpl::down_cast<const OGRMultiPolygon *>(
this);
958 return cpl::down_cast<OGRMultiCurve *>(
this);
968 return cpl::down_cast<const OGRMultiCurve *>(
this);
978 return cpl::down_cast<OGRMultiSurface *>(
this);
988 return cpl::down_cast<const OGRMultiSurface *>(
this);
998 return cpl::down_cast<OGRPolyhedralSurface *>(
this);
1008 return cpl::down_cast<const OGRPolyhedralSurface *>(
this);
1017 return cpl::down_cast<OGRTriangulatedSurface *>(
this);
1026 return cpl::down_cast<const OGRTriangulatedSurface *>(
this);
1031struct CPL_DLL OGRGeometryUniquePtrDeleter
1041typedef std::unique_ptr<OGRGeometry, OGRGeometryUniquePtrDeleter>
1045#define OGR_FORBID_DOWNCAST_TO(name) \
1046 inline OGR##name *to##name() = delete; \
1047 inline const OGR##name *to##name() const = delete;
1049#define OGR_FORBID_DOWNCAST_TO_POINT OGR_FORBID_DOWNCAST_TO(Point)
1050#define OGR_FORBID_DOWNCAST_TO_CURVE OGR_FORBID_DOWNCAST_TO(Curve)
1051#define OGR_FORBID_DOWNCAST_TO_SIMPLE_CURVE OGR_FORBID_DOWNCAST_TO(SimpleCurve)
1052#define OGR_FORBID_DOWNCAST_TO_LINESTRING OGR_FORBID_DOWNCAST_TO(LineString)
1053#define OGR_FORBID_DOWNCAST_TO_LINEARRING OGR_FORBID_DOWNCAST_TO(LinearRing)
1054#define OGR_FORBID_DOWNCAST_TO_CIRCULARSTRING \
1055 OGR_FORBID_DOWNCAST_TO(CircularString)
1056#define OGR_FORBID_DOWNCAST_TO_COMPOUNDCURVE \
1057 OGR_FORBID_DOWNCAST_TO(CompoundCurve)
1058#define OGR_FORBID_DOWNCAST_TO_SURFACE OGR_FORBID_DOWNCAST_TO(Surface)
1059#define OGR_FORBID_DOWNCAST_TO_CURVEPOLYGON OGR_FORBID_DOWNCAST_TO(CurvePolygon)
1060#define OGR_FORBID_DOWNCAST_TO_POLYGON OGR_FORBID_DOWNCAST_TO(Polygon)
1061#define OGR_FORBID_DOWNCAST_TO_TRIANGLE OGR_FORBID_DOWNCAST_TO(Triangle)
1062#define OGR_FORBID_DOWNCAST_TO_MULTIPOINT OGR_FORBID_DOWNCAST_TO(MultiPoint)
1063#define OGR_FORBID_DOWNCAST_TO_MULTICURVE OGR_FORBID_DOWNCAST_TO(MultiCurve)
1064#define OGR_FORBID_DOWNCAST_TO_MULTILINESTRING \
1065 OGR_FORBID_DOWNCAST_TO(MultiLineString)
1066#define OGR_FORBID_DOWNCAST_TO_MULTISURFACE OGR_FORBID_DOWNCAST_TO(MultiSurface)
1067#define OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON OGR_FORBID_DOWNCAST_TO(MultiPolygon)
1068#define OGR_FORBID_DOWNCAST_TO_GEOMETRYCOLLECTION \
1069 OGR_FORBID_DOWNCAST_TO(GeometryCollection)
1070#define OGR_FORBID_DOWNCAST_TO_POLYHEDRALSURFACE \
1071 OGR_FORBID_DOWNCAST_TO(PolyhedralSurface)
1072#define OGR_FORBID_DOWNCAST_TO_TIN OGR_FORBID_DOWNCAST_TO(TriangulatedSurface)
1074#define OGR_ALLOW_UPCAST_TO(name) \
1075 inline OGR##name *to##name() \
1079 inline const OGR##name *to##name() const \
1084#ifndef SUPPRESS_OGR_ALLOW_CAST_TO_THIS_WARNING
1085#define CAST_TO_THIS_WARNING CPL_WARN_DEPRECATED("Casting to this is useless")
1087#define CAST_TO_THIS_WARNING
1090#define OGR_ALLOW_CAST_TO_THIS(name) \
1091 inline OGR##name *to##name() CAST_TO_THIS_WARNING \
1095 inline const OGR##name *to##name() const CAST_TO_THIS_WARNING \
1100#define OGR_FORBID_DOWNCAST_TO_ALL_CURVES \
1101 OGR_FORBID_DOWNCAST_TO_CURVE \
1102 OGR_FORBID_DOWNCAST_TO_SIMPLE_CURVE \
1103 OGR_FORBID_DOWNCAST_TO_LINESTRING \
1104 OGR_FORBID_DOWNCAST_TO_LINEARRING \
1105 OGR_FORBID_DOWNCAST_TO_CIRCULARSTRING \
1106 OGR_FORBID_DOWNCAST_TO_COMPOUNDCURVE
1108#define OGR_FORBID_DOWNCAST_TO_ALL_SURFACES \
1109 OGR_FORBID_DOWNCAST_TO_SURFACE \
1110 OGR_FORBID_DOWNCAST_TO_CURVEPOLYGON \
1111 OGR_FORBID_DOWNCAST_TO_POLYGON \
1112 OGR_FORBID_DOWNCAST_TO_TRIANGLE \
1113 OGR_FORBID_DOWNCAST_TO_POLYHEDRALSURFACE \
1114 OGR_FORBID_DOWNCAST_TO_TIN
1116#define OGR_FORBID_DOWNCAST_TO_ALL_SINGLES \
1117 OGR_FORBID_DOWNCAST_TO_POINT \
1118 OGR_FORBID_DOWNCAST_TO_ALL_CURVES \
1119 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1121#define OGR_FORBID_DOWNCAST_TO_ALL_MULTI \
1122 OGR_FORBID_DOWNCAST_TO_GEOMETRYCOLLECTION \
1123 OGR_FORBID_DOWNCAST_TO_MULTIPOINT \
1124 OGR_FORBID_DOWNCAST_TO_MULTICURVE \
1125 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING \
1126 OGR_FORBID_DOWNCAST_TO_MULTISURFACE \
1127 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
1151 OGRPoint(
double x,
double y,
double z);
1152 OGRPoint(
double x,
double y,
double z,
double m);
1154 static OGRPoint *createXYM(
double x,
double y,
double m);
1160 size_t WkbSize()
const override;
1162 size_t &nBytesConsumedOut)
override;
1163 OGRErr exportToWkb(
unsigned char *,
1170 OGRErr importFromWkt(
const char **)
override;
1181 OGRErr *err =
nullptr)
const override;
1184 virtual int getDimension()
const override;
1185 virtual OGRPoint *clone()
const override;
1186 virtual void empty()
override;
1187 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
1188 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
1192 return !(flags & OGR_G_NOT_EMPTY_POINT);
1221 virtual void setCoordinateDimension(
int nDimension)
override;
1229 if (std::isnan(x) || std::isnan(y))
1230 flags &= ~OGR_G_NOT_EMPTY_POINT;
1232 flags |= OGR_G_NOT_EMPTY_POINT;
1241 if (std::isnan(x) || std::isnan(y))
1242 flags &= ~OGR_G_NOT_EMPTY_POINT;
1244 flags |= OGR_G_NOT_EMPTY_POINT;
1262 flags |= OGR_G_MEASURED;
1271 virtual const char *getGeometryName()
const override;
1274 virtual void flattenTo2D()
override;
1278 visitor->
visit(
this);
1283 visitor->
visit(
this);
1286 virtual void swapXY()
override;
1288 OGR_ALLOW_CAST_TO_THIS(Point)
1289 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
1290 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1291 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
1329 virtual OGRCurveCasterToLineString GetCasterToLineString()
const = 0;
1330 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const = 0;
1335 virtual int ContainsPoint(
const OGRPoint *p)
const;
1336 virtual int IntersectsPoint(
const OGRPoint *p)
const;
1340 class CPL_DLL ConstIterator
1343 std::unique_ptr<Private> m_poPrivate;
1346 ConstIterator(
const OGRCurve *poSelf,
bool bStart);
1347 ConstIterator(ConstIterator &&oOther)
noexcept;
1348 ConstIterator &operator=(ConstIterator &&oOther);
1351 ConstIterator &operator++();
1352 bool operator!=(
const ConstIterator &it)
const;
1356 friend inline ConstIterator
end(
const OGRCurve *);
1376 ConstIterator
begin()
const;
1378 ConstIterator
end()
const;
1387 virtual int get_IsClosed()
const;
1391 const char *
const *papszOptions =
nullptr)
const = 0;
1392 virtual int getDimension()
const override;
1401 virtual int isClockwise()
const;
1408 return cpl::down_cast<OGRSimpleCurve *>(
this);
1416 return cpl::down_cast<const OGRSimpleCurve *>(
this);
1423 OGR_FORBID_DOWNCAST_TO_POINT
1424 OGR_ALLOW_CAST_TO_THIS(Curve)
1425 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1426 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
1431inline OGRCurve::ConstIterator
begin(
const OGRCurve *poCurve)
1433 return poCurve->begin();
1437inline OGRCurve::ConstIterator
end(
const OGRCurve *poCurve)
1439 return poCurve->end();
1485 void setX(
double xIn);
1489 void setY(
double yIn);
1493 void setZ(
double zIn);
1497 void setM(
double mIn);
1520 int m_nPointCapacity = 0;
1530 OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
int bHasM,
1535 virtual double get_LinearArea()
const;
1541 class CPL_DLL Iterator
1544 std::unique_ptr<Private> m_poPrivate;
1549 Iterator(Iterator &&oOther)
noexcept;
1553 Iterator &operator++();
1554 bool operator!=(
const Iterator &it)
const;
1560 class CPL_DLL ConstIterator
1563 std::unique_ptr<Private> m_poPrivate;
1568 ConstIterator &&oOther)
noexcept;
1572 ConstIterator &operator++();
1573 bool operator!=(
const ConstIterator &it)
const;
1606 ConstIterator
begin()
const;
1608 ConstIterator
end()
const;
1611 virtual size_t WkbSize()
const override;
1613 size_t &nBytesConsumedOut)
override;
1615 exportToWkb(
unsigned char *,
1622 OGRErr importFromWkt(
const char **)
override;
1633 OGRErr *err =
nullptr)
const override;
1636 virtual void empty()
override;
1637 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
1638 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
1643 virtual double get_Length()
const override;
1644 virtual void StartPoint(
OGRPoint *)
const override;
1645 virtual void EndPoint(
OGRPoint *)
const override;
1646 virtual void Value(
double,
OGRPoint *)
const override;
1647 virtual double Project(
const OGRPoint *)
const;
1648 virtual OGRLineString *getSubLine(
double,
double,
int)
const;
1656 void getPoint(
int,
OGRPoint *)
const;
1660 return paoPoints[i].
x;
1665 return paoPoints[i].
y;
1668 double getZ(
int i)
const;
1669 double getM(
int i)
const;
1675 virtual void setCoordinateDimension(
int nDimension)
override;
1676 virtual void set3D(
OGRBoolean bIs3D)
override;
1677 virtual void setMeasured(
OGRBoolean bIsMeasured)
override;
1678 void setNumPoints(
int nNewPointCount,
int bZeroizeNewContent = TRUE);
1680 void setPoint(
int,
double,
double);
1681 void setZ(
int,
double);
1682 void setM(
int,
double);
1683 void setPoint(
int,
double,
double,
double);
1684 void setPointM(
int,
double,
double,
double);
1685 void setPoint(
int,
double,
double,
double,
double);
1686 void setPoints(
int,
const OGRRawPoint *,
const double * =
nullptr);
1687 void setPointsM(
int,
const OGRRawPoint *,
const double *);
1688 void setPoints(
int,
const OGRRawPoint *,
const double *,
const double *);
1689 void setPoints(
int,
const double *padfX,
const double *padfY,
1690 const double *padfZIn =
nullptr);
1691 void setPointsM(
int,
const double *padfX,
const double *padfY,
1692 const double *padfMIn =
nullptr);
1693 void setPoints(
int,
const double *padfX,
const double *padfY,
1694 const double *padfZIn,
const double *padfMIn);
1696 void addPoint(
double,
double);
1697 void addPoint(
double,
double,
double);
1698 void addPointM(
double,
double,
double);
1699 void addPoint(
double,
double,
double,
double);
1701 bool removePoint(
int);
1703 void getPoints(
OGRRawPoint *,
double * =
nullptr)
const;
1704 void getPoints(
void *pabyX,
int nXStride,
void *pabyY,
int nYStride,
1705 void *pabyZ =
nullptr,
int nZStride = 0,
1706 void *pabyM =
nullptr,
int nMStride = 0)
const;
1708 void addSubLineString(
const OGRLineString *,
int nStartVertex = 0,
1709 int nEndVertex = -1);
1710 void reversePoints(
void);
1715 virtual void flattenTo2D()
override;
1716 virtual void segmentize(
double dfMaxLength)
override;
1718 virtual void swapXY()
override;
1720 OGR_ALLOW_UPCAST_TO(Curve)
1721 OGR_ALLOW_CAST_TO_THIS(SimpleCurve)
1728 return poCurve->begin();
1734 return poCurve->end();
1740 return poCurve->begin();
1746 return poCurve->end();
1772 virtual OGRCurveCasterToLineString GetCasterToLineString()
const override;
1773 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1775 virtual double get_AreaOfCurveSegments()
const override;
1789 CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
1790 const char *
const *papszOptions =
nullptr)
const override;
1792 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
1799 virtual const char *getGeometryName()
const override;
1816 visitor->
visit(
this);
1821 visitor->
visit(
this);
1824 OGR_ALLOW_UPCAST_TO(SimpleCurve)
1825 OGR_ALLOW_CAST_TO_THIS(LineString)
1859 virtual size_t WkbSize()
const override;
1861 size_t &nBytesConsumedOut)
override;
1862 OGRErr exportToWkb(
unsigned char *,
1871 virtual size_t _WkbSize(
int _flags)
const;
1873 const unsigned char *,
size_t,
1874 size_t &nBytesConsumedOut);
1875 virtual OGRErr _exportToWkb(
int _flags,
unsigned char *,
1878 virtual OGRCurveCasterToLineString GetCasterToLineString()
const override;
1879 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1893 virtual const char *getGeometryName()
const override;
1895 virtual void reverseWindingOrder();
1896 virtual void closeRings()
override;
1898 int bTestEnvelope = TRUE)
const;
1900 int bTestEnvelope = TRUE)
const;
1917 visitor->
visit(
this);
1922 visitor->
visit(
this);
1925 OGR_ALLOW_UPCAST_TO(LineString)
1926 OGR_ALLOW_CAST_TO_THIS(LinearRing)
1948 void ExtendEnvelopeWithCircular(
OGREnvelope *psEnvelope)
const;
1950 int IsFullCircle(
double &cx,
double &cy,
double &square_R)
const;
1954 virtual OGRCurveCasterToLineString GetCasterToLineString()
const override;
1955 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1956 virtual int IntersectsPoint(
const OGRPoint *p)
const override;
1957 virtual int ContainsPoint(
const OGRPoint *p)
const override;
1958 virtual double get_AreaOfCurveSegments()
const override;
1970 size_t &nBytesConsumedOut)
override;
1971 OGRErr exportToWkb(
unsigned char *,
1978 OGRErr importFromWkt(
const char **)
override;
1989 OGRErr *err =
nullptr)
const override;
1993 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
1994 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
1998 virtual double get_Length()
const override;
2000 CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
2001 const char *
const *papszOptions =
nullptr)
const override;
2002 virtual void Value(
double,
OGRPoint *)
const override;
2003 virtual double get_Area()
const override;
2004 virtual double get_GeodesicArea(
2009 virtual const char *getGeometryName()
const override;
2010 virtual void segmentize(
double dfMaxLength)
override;
2012 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2014 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2015 const char *
const *papszOptions =
nullptr)
const override;
2031 visitor->
visit(
this);
2036 visitor->
visit(
this);
2039 OGR_ALLOW_UPCAST_TO(SimpleCurve)
2040 OGR_ALLOW_CAST_TO_THIS(CircularString)
2058class CPL_DLL OGRCurveCollection
2066 int nCurveCount = 0;
2070 OGRCurveCollection();
2071 OGRCurveCollection(
const OGRCurveCollection &other);
2072 ~OGRCurveCollection();
2074 OGRCurveCollection &operator=(
const OGRCurveCollection &other);
2090 return papoCurves + nCurveCount;
2104 return papoCurves + nCurveCount;
2114 size_t WkbSize()
const;
2116 const unsigned char *pabyData,
size_t &nSize,
2117 size_t &nDataOffset,
2119 size_t nMinSubGeomSize,
2122 importBodyFromWkb(
OGRGeometry *poGeom,
const unsigned char *pabyData,
2123 size_t nSize,
bool bAcceptCompoundCurve,
2131 OGRBoolean Equals(
const OGRCurveCollection *poOCC)
const;
2132 void setCoordinateDimension(
OGRGeometry *poGeom,
int nNewDimension);
2137 int getNumCurves()
const;
2139 const OGRCurve *getCurve(
int)
const;
2142 OGRErr removeCurve(
int iIndex,
bool bDelete =
true);
2146 void segmentize(
double dfMaxLength);
2148 OGRBoolean hasCurveGeometry(
int bLookForNonLinear)
const;
2170 OGRCurveCollection oCC{};
2172 OGRErr addCurveDirectlyInternal(
OGRCurve *poCurve,
double dfToleranceEps,
2178 OGRLineString *CurveToLineInternal(
double dfMaxAngleStepSizeDegrees,
2179 const char *
const *papszOptions,
2180 int bIsLinearRing)
const;
2191 virtual OGRCurveCasterToLineString GetCasterToLineString()
const override;
2192 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
2234 virtual size_t WkbSize()
const override;
2236 size_t &nBytesConsumedOut)
override;
2237 OGRErr exportToWkb(
unsigned char *,
2244 OGRErr importFromWkt(
const char **)
override;
2255 OGRErr *err =
nullptr)
const override;
2259 virtual void empty()
override;
2260 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
2261 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
2265 virtual double get_Length()
const override;
2266 virtual void StartPoint(
OGRPoint *)
const override;
2267 virtual void EndPoint(
OGRPoint *)
const override;
2268 virtual void Value(
double,
OGRPoint *)
const override;
2270 CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
2271 const char *
const *papszOptions =
nullptr)
const override;
2273 virtual int getNumPoints()
const override;
2274 virtual double get_AreaOfCurveSegments()
const override;
2275 virtual double get_Area()
const override;
2276 virtual double get_GeodesicArea(
2283 int getNumCurves()
const;
2285 const OGRCurve *getCurve(
int)
const;
2288 virtual void setCoordinateDimension(
int nDimension)
override;
2289 virtual void set3D(
OGRBoolean bIs3D)
override;
2290 virtual void setMeasured(
OGRBoolean bIsMeasured)
override;
2298 static constexpr double DEFAULT_TOLERANCE_EPSILON = 1e-14;
2301 double dfToleranceEps = DEFAULT_TOLERANCE_EPSILON);
2303 double dfToleranceEps = DEFAULT_TOLERANCE_EPSILON);
2304 OGRErr addCurve(std::unique_ptr<OGRCurve>,
2305 double dfToleranceEps = DEFAULT_TOLERANCE_EPSILON);
2311 virtual const char *getGeometryName()
const override;
2313 virtual void flattenTo2D()
override;
2314 virtual void segmentize(
double dfMaxLength)
override;
2316 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2318 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2319 const char *
const *papszOptions =
nullptr)
const override;
2323 visitor->
visit(
this);
2328 visitor->
visit(
this);
2331 virtual void swapXY()
override;
2333 OGR_ALLOW_UPCAST_TO(Curve)
2334 OGR_ALLOW_CAST_TO_THIS(CompoundCurve)
2342 return poCurve->
begin();
2349 return poCurve->
end();
2355 return poCurve->
begin();
2361 return poCurve->
end();
2379 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const = 0;
2380 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
const = 0;
2390 return PointOnSurfaceInternal(poPoint);
2400 OGR_FORBID_DOWNCAST_TO_POINT
2401 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
2402 OGR_ALLOW_CAST_TO_THIS(Surface)
2403 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
2430 virtual int checkRing(
OGRCurve *poNewRing)
const;
2431 OGRErr addRingDirectlyInternal(
OGRCurve *poCurve,
int bNeedRealloc);
2441 OGRCurveCollection oCC{};
2443 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2444 virtual OGRSurfaceCasterToCurvePolygon
2445 GetCasterToCurvePolygon()
const override;
2490 virtual const char *getGeometryName()
const override;
2493 virtual void empty()
override;
2495 virtual void flattenTo2D()
override;
2497 virtual void segmentize(
double dfMaxLength)
override;
2499 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2501 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2502 const char *
const *papszOptions =
nullptr)
const override;
2503 virtual double get_GeodesicArea(
2507 virtual double get_Area()
const override;
2510 virtual size_t WkbSize()
const override;
2512 size_t &nBytesConsumedOut)
override;
2513 OGRErr exportToWkb(
unsigned char *,
2520 OGRErr importFromWkt(
const char **)
override;
2531 OGRErr *err =
nullptr)
const override;
2534 virtual int getDimension()
const override;
2535 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
2536 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
2540 CurvePolyToPoly(
double dfMaxAngleStepSizeDegrees = 0,
2541 const char *
const *papszOptions =
nullptr)
const;
2549 virtual void setCoordinateDimension(
int nDimension)
override;
2550 virtual void set3D(
OGRBoolean bIs3D)
override;
2551 virtual void setMeasured(
OGRBoolean bIsMeasured)
override;
2558 OGRErr addRing(std::unique_ptr<OGRCurve>);
2561 const OGRCurve *getExteriorRingCurve()
const;
2562 int getNumInteriorRings()
const;
2563 OGRCurve *getInteriorRingCurve(
int);
2564 const OGRCurve *getInteriorRingCurve(
int)
const;
2566 OGRCurve *stealExteriorRingCurve();
2568 OGRErr removeRing(
int iIndex,
bool bDelete =
true);
2572 visitor->
visit(
this);
2577 visitor->
visit(
this);
2580 virtual void swapXY()
override;
2582 OGR_ALLOW_UPCAST_TO(Surface)
2583 OGR_ALLOW_CAST_TO_THIS(CurvePolygon)
2591 return poGeom->
begin();
2598 return poGeom->
end();
2604 return poGeom->
begin();
2610 return poGeom->
end();
2638 virtual int checkRing(
OGRCurve *poNewRing)
const override;
2639 virtual OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
2641 int &nMaxPoints,
double *&padfZ);
2645 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2646 virtual OGRSurfaceCasterToCurvePolygon
2647 GetCasterToCurvePolygon()
const override;
2665 return reinterpret_cast<ChildType **
>(oCC.begin());
2671 return reinterpret_cast<ChildType **
>(oCC.end());
2679 return reinterpret_cast<const ChildType *
const *
>(oCC.begin());
2685 return reinterpret_cast<const ChildType *
const *
>(oCC.end());
2689 virtual const char *getGeometryName()
const override;
2693 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2695 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
2697 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2698 const char *
const *papszOptions =
nullptr)
const override;
2701 virtual size_t WkbSize()
const override;
2703 size_t &nBytesConsumedOut)
override;
2704 OGRErr exportToWkb(
unsigned char *,
2711 OGRErr importFromWkt(
const char **)
override;
2722 OGRErr *err =
nullptr)
const override;
2726 CurvePolyToPoly(
double dfMaxAngleStepSizeDegrees = 0,
2727 const char *
const *papszOptions =
nullptr)
const override;
2753 visitor->
visit(
this);
2758 visitor->
visit(
this);
2761 virtual void closeRings()
override;
2763 OGR_ALLOW_UPCAST_TO(CurvePolygon)
2764 OGR_ALLOW_CAST_TO_THIS(Polygon)
2771 return poGeom->
begin();
2777 return poGeom->
end();
2783 return poGeom->
begin();
2789 return poGeom->
end();
2809 bool quickValidityCheck()
const;
2813 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2814 virtual OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
2817 double *&padfZ)
override;
2827 virtual const char *getGeometryName()
const override;
2833 size_t &nBytesConsumedOut)
override;
2852 visitor->
visit(
this);
2857 visitor->
visit(
this);
2864 OGR_ALLOW_UPCAST_TO(Polygon)
2865 OGR_ALLOW_CAST_TO_THIS(Triangle)
2881 OGRErr importFromWktInternal(
const char **ppszInput,
int nRecLevel);
2890 const std::string &exclude = std::string())
const;
2895 OGRErr importFromWkbInternal(
const unsigned char *pabyData,
size_t nSize,
2897 size_t &nBytesConsumedOut);
2922 return papoGeoms + nGeomCount;
2936 return papoGeoms + nGeomCount;
2940 virtual const char *getGeometryName()
const override;
2943 virtual void empty()
override;
2945 virtual void flattenTo2D()
override;
2947 virtual void segmentize(
double dfMaxLength)
override;
2949 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2951 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
2953 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2954 const char *
const *papszOptions =
nullptr)
const override;
2959 virtual size_t WkbSize()
const override;
2961 size_t &nBytesConsumedOut)
override;
2962 OGRErr exportToWkb(
unsigned char *,
2969 OGRErr importFromWkt(
const char **)
override;
2980 OGRErr *err =
nullptr)
const override;
2982 virtual double get_Length()
const;
2983 virtual double get_Area()
const;
2986 virtual int getDimension()
const override;
2987 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
2988 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
2991 int getNumGeometries()
const;
2999 virtual void setCoordinateDimension(
int nDimension)
override;
3000 virtual void set3D(
OGRBoolean bIs3D)
override;
3001 virtual void setMeasured(
OGRBoolean bIsMeasured)
override;
3004 OGRErr addGeometry(std::unique_ptr<OGRGeometry> geom);
3005 virtual OGRErr removeGeometry(
int iIndex,
int bDelete = TRUE);
3010 void closeRings()
override;
3012 virtual void swapXY()
override;
3016 visitor->
visit(
this);
3021 visitor->
visit(
this);
3027 OGR_FORBID_DOWNCAST_TO_POINT
3028 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
3029 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
3030 OGR_ALLOW_CAST_TO_THIS(GeometryCollection)
3038 return poGeom->
begin();
3045 return poGeom->
end();
3051 return poGeom->
begin();
3057 return poGeom->
end();
3092 return reinterpret_cast<ChildType **
>(papoGeoms);
3098 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3106 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3112 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3117 virtual const char *getGeometryName()
const override;
3125 OGRErr importFromWkt(
const char **)
override;
3136 OGRErr *err =
nullptr)
const override;
3142 virtual int getDimension()
const override;
3159 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3175 visitor->
visit(
this);
3180 visitor->
visit(
this);
3185 OGR_ALLOW_CAST_TO_THIS(MultiSurface)
3186 OGR_ALLOW_UPCAST_TO(GeometryCollection)
3187 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
3188 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING
3189 OGR_FORBID_DOWNCAST_TO_MULTICURVE
3197 return poGeom->
begin();
3204 return poGeom->
end();
3210 return poGeom->
begin();
3216 return poGeom->
end();
3238 OGRErr _addGeometryWithExpectedSubGeometryType(
3240 OGRErr _addGeometryDirectlyWithExpectedSubGeometryType(
3259 return reinterpret_cast<ChildType **
>(papoGeoms);
3265 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3273 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3279 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3297 virtual const char *getGeometryName()
const override;
3306 size_t &nBytesConsumedOut)
override;
3313 OGRErr *err =
nullptr)
const override;
3317 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3333 visitor->
visit(
this);
3338 visitor->
visit(
this);
3343 OGR_ALLOW_CAST_TO_THIS(MultiPolygon)
3344 OGR_ALLOW_UPCAST_TO(MultiSurface)
3352 return poGeom->
begin();
3359 return poGeom->
end();
3365 return poGeom->
begin();
3371 return poGeom->
end();
3392 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
3393 virtual OGRSurfaceCasterToCurvePolygon
3394 GetCasterToCurvePolygon()
const override;
3396 virtual const char *getSubGeometryName()
const;
3401 virtual OGRPolyhedralSurfaceCastToMultiPolygon
3402 GetCasterToMultiPolygon()
const;
3444 virtual size_t WkbSize()
const override;
3445 virtual const char *getGeometryName()
const override;
3448 size_t &nBytesConsumedOut)
override;
3449 OGRErr exportToWkb(
unsigned char *,
3456 OGRErr importFromWkt(
const char **)
override;
3467 OGRErr *err =
nullptr)
const override;
3470 virtual int getDimension()
const override;
3472 virtual void empty()
override;
3475 virtual void getEnvelope(
OGREnvelope *psEnvelope)
const override;
3476 virtual void getEnvelope(
OGREnvelope3D *psEnvelope)
const override;
3478 virtual void flattenTo2D()
override;
3481 virtual double get_Area()
const override;
3482 virtual double get_GeodesicArea(
3488 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3491 OGRErr addGeometry(std::unique_ptr<OGRGeometry> poNewGeom);
3493 int getNumGeometries()
const;
3495 const OGRPolygon *getGeometryRef(
int i)
const;
3498 virtual void setCoordinateDimension(
int nDimension)
override;
3499 virtual void set3D(
OGRBoolean bIs3D)
override;
3500 virtual void setMeasured(
OGRBoolean bIsMeasured)
override;
3501 virtual void swapXY()
override;
3502 OGRErr removeGeometry(
int iIndex,
int bDelete = TRUE);
3506 visitor->
visit(
this);
3511 visitor->
visit(
this);
3517 OGR_ALLOW_CAST_TO_THIS(PolyhedralSurface)
3518 OGR_ALLOW_UPCAST_TO(Surface)
3526 return poGeom->
begin();
3533 return poGeom->
end();
3539 return poGeom->
begin();
3545 return poGeom->
end();
3565 virtual const char *getSubGeometryName()
const override;
3568 virtual OGRPolyhedralSurfaceCastToMultiPolygon
3569 GetCasterToMultiPolygon()
const override;
3586 return reinterpret_cast<ChildType **
>(oMP.begin());
3592 return reinterpret_cast<ChildType **
>(oMP.end());
3600 return reinterpret_cast<const ChildType *
const *
>(oMP.begin());
3606 return reinterpret_cast<const ChildType *
const *
>(oMP.end());
3610 virtual const char *getGeometryName()
const override;
3647 visitor->
visit(
this);
3652 visitor->
visit(
this);
3658 OGR_ALLOW_CAST_TO_THIS(TriangulatedSurface)
3659 OGR_ALLOW_UPCAST_TO(PolyhedralSurface)
3667 return poGeom->
begin();
3674 return poGeom->
end();
3680 return poGeom->
begin();
3686 return poGeom->
end();
3702 OGRErr importFromWkt_Bracketed(
const char **,
int bHasM,
int bHasZ);
3722 return reinterpret_cast<ChildType **
>(papoGeoms);
3728 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3736 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3742 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3760 virtual const char *getGeometryName()
const override;
3768 OGRErr importFromWkt(
const char **)
override;
3779 OGRErr *err =
nullptr)
const override;
3782 virtual int getDimension()
const override;
3798 visitor->
visit(
this);
3803 visitor->
visit(
this);
3808 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3810 OGR_ALLOW_CAST_TO_THIS(MultiPoint)
3811 OGR_ALLOW_UPCAST_TO(GeometryCollection)
3812 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING
3813 OGR_FORBID_DOWNCAST_TO_MULTICURVE
3814 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
3815 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
3822 return poGeom->
begin();
3828 return poGeom->
end();
3834 return poGeom->
begin();
3840 return poGeom->
end();
3879 return reinterpret_cast<ChildType **
>(papoGeoms);
3885 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3893 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3899 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3917 virtual const char *getGeometryName()
const override;
3925 OGRErr importFromWkt(
const char **)
override;
3936 OGRErr *err =
nullptr)
const override;
3939 virtual int getDimension()
const override;
3943 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3959 visitor->
visit(
this);
3964 visitor->
visit(
this);
3969 OGR_ALLOW_CAST_TO_THIS(MultiCurve)
3970 OGR_ALLOW_UPCAST_TO(GeometryCollection)
3971 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
3972 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
3973 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
3980 return poGeom->
begin();
3986 return poGeom->
end();
3992 return poGeom->
begin();
3998 return poGeom->
end();
4031 return reinterpret_cast<ChildType **
>(papoGeoms);
4037 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
4045 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
4051 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
4069 virtual const char *getGeometryName()
const override;
4078 size_t &nBytesConsumedOut)
override;
4085 OGRErr *err =
nullptr)
const override;
4089 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
4105 visitor->
visit(
this);
4110 visitor->
visit(
this);
4115 OGR_ALLOW_CAST_TO_THIS(MultiLineString)
4116 OGR_ALLOW_UPCAST_TO(MultiCurve)
4117 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
4118 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
4119 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
4127 return poGeom->
begin();
4134 return poGeom->
end();
4140 return poGeom->
begin();
4146 return poGeom->
end();
4161 static OGRErr createFromFgfInternal(
const unsigned char *pabyData,
4164 int *pnBytesConsumed,
int nRecLevel);
4169 size_t =
static_cast<size_t>(-1),
4171 static OGRErr createFromWkb(
const void *pabyData,
4174 size_t &nBytesConsumedOut);
4186 CPL_WARN_DEPRECATED(
"Use createFromWkt(const char**, ...) instead")
4188 return createFromWkt(
const_cast<const char **
>(ppszInput), poSRS,
4196 static OGRGeometry *createFromGeoJson(
const char *,
int = -1);
4204 bool bOnlyInOrder =
true);
4211 const char *
const *papszOptions =
nullptr);
4217 int *pbResultValidGeometry,
4218 const char **papszOptions =
nullptr);
4219 static bool haveGEOS();
4226 std::unique_ptr<Private> d;
4235 char **papszOptions,
4239 approximateArcAngles(
double dfX,
double dfY,
double dfZ,
4240 double dfPrimaryRadius,
double dfSecondaryAxis,
4241 double dfRotation,
double dfStartAngle,
4242 double dfEndAngle,
double dfMaxAngleStepSizeDegrees,
4243 const bool bUseMaxGap =
false);
4245 static int GetCurveParameters(
double x0,
double y0,
double x1,
double y1,
4246 double x2,
double y2,
double &R,
double &cx,
4247 double &cy,
double &alpha0,
double &alpha1,
4250 curveToLineString(
double x0,
double y0,
double z0,
double x1,
double y1,
4251 double z1,
double x2,
double y2,
double z2,
int bHasZ,
4252 double dfMaxAngleStepSizeDegrees,
4253 const char *
const *papszOptions =
nullptr);
4256 const char *
const *papszOptions =
nullptr);
4261 bool bCamelCase =
false,
4262 bool bAddZM =
false,
4263 bool bSpaceBeforeZM =
false);
4266typedef struct _OGRPreparedGeometry OGRPreparedGeometry;
4268struct CPL_DLL OGRPreparedGeometryUniquePtrDeleter
4270 void operator()(OGRPreparedGeometry *)
const;
4278typedef std::unique_ptr<OGRPreparedGeometry,
4279 OGRPreparedGeometryUniquePtrDeleter>
The CPLJSONArray class holds JSON object from CPLJSONDocument.
Definition: cpl_json.h:57
OGRGeometry visitor interface.
Definition: ogr_geometry.h:242
virtual void visit(const OGRCurvePolygon *)=0
Visit OGRCurvePolygon.
virtual void visit(const OGRPolyhedralSurface *)=0
Visit OGRPolyhedralSurface.
virtual void visit(const OGRCompoundCurve *)=0
Visit OGRCompoundCurve.
virtual void visit(const OGRMultiLineString *)=0
Visit OGRMultiLineString.
virtual void visit(const OGRTriangulatedSurface *)=0
Visit OGRTriangulatedSurface.
virtual void visit(const OGRPolygon *)=0
Visit OGRPolygon.
virtual void visit(const OGRMultiPolygon *)=0
Visit OGRMultiPolygon.
virtual void visit(const OGRTriangle *)=0
Visit OGRTriangle.
virtual void visit(const OGRLineString *)=0
Visit OGRLineString.
virtual void visit(const OGRMultiPoint *)=0
Visit OGRMultiPoint.
virtual void visit(const OGRMultiCurve *)=0
Visit OGRMultiCurve.
virtual void visit(const OGRGeometryCollection *)=0
Visit OGRGeometryCollection.
virtual void visit(const OGRPoint *)=0
Visit OGRPoint.
virtual ~IOGRConstGeometryVisitor()=default
Destructor/.
virtual void visit(const OGRMultiSurface *)=0
Visit OGRMultiSurface.
virtual void visit(const OGRLinearRing *)=0
Visit OGRLinearRing.
virtual void visit(const OGRCircularString *)=0
Visit OGRCircularString.
OGRGeometry visitor interface.
Definition: ogr_geometry.h:166
virtual void visit(OGRMultiSurface *)=0
Visit OGRMultiSurface.
virtual void visit(OGRLinearRing *)=0
Visit OGRLinearRing.
virtual void visit(OGRTriangle *)=0
Visit OGRTriangle.
virtual void visit(OGRCircularString *)=0
Visit OGRCircularString.
virtual void visit(OGRPolygon *)=0
Visit OGRPolygon.
virtual void visit(OGRLineString *)=0
Visit OGRLineString.
virtual void visit(OGRCompoundCurve *)=0
Visit OGRCompoundCurve.
virtual void visit(OGRTriangulatedSurface *)=0
Visit OGRTriangulatedSurface.
virtual void visit(OGRPoint *)=0
Visit OGRPoint.
virtual void visit(OGRCurvePolygon *)=0
Visit OGRCurvePolygon.
virtual void visit(OGRGeometryCollection *)=0
Visit OGRGeometryCollection.
virtual void visit(OGRPolyhedralSurface *)=0
Visit OGRPolyhedralSurface.
virtual void visit(OGRMultiPolygon *)=0
Visit OGRMultiPolygon.
virtual ~IOGRGeometryVisitor()=default
Destructor/.
virtual void visit(OGRMultiLineString *)=0
Visit OGRMultiLineString.
virtual void visit(OGRMultiPoint *)=0
Visit OGRMultiPoint.
virtual void visit(OGRMultiCurve *)=0
Visit OGRMultiCurve.
Concrete representation of a circular string, that is to say a curve made of one or several arc circl...
Definition: ogr_geometry.h:1946
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2029
OGRCircularString()
Create an empty circular string.
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2024
OGRCircularString(const OGRCircularString &other)
Copy constructor.
OGRSimpleCurve * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2018
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2034
Utility class to store a collection of curves.
Definition: ogr_geometry.h:2168
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2326
const ChildType *const * end() const
Return end of curve iterator.
Definition: ogr_geometry.h:2228
const ChildType *const * begin() const
Return begin of curve iterator.
Definition: ogr_geometry.h:2222
OGRCompoundCurve(const OGRCompoundCurve &other)
Copy constructor.
OGRCurve ChildType
Type of child elements.
Definition: ogr_geometry.h:2203
ChildType ** end()
Return end of curve iterator.
Definition: ogr_geometry.h:2214
ChildType ** begin()
Return begin of curve iterator.
Definition: ogr_geometry.h:2208
OGRCompoundCurve()
Create an empty compound curve.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2321
Concrete class representing curve polygons.
Definition: ogr_geometry.h:2424
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2570
OGRCurve ChildType
Type of child elements.
Definition: ogr_geometry.h:2459
OGRCurvePolygon()
Create an empty curve polygon.
const ChildType *const * end() const
Return end of curve iterator.
Definition: ogr_geometry.h:2484
const ChildType *const * begin() const
Return begin of curve iterator.
Definition: ogr_geometry.h:2478
ChildType ** begin()
Return begin of curve iterator.
Definition: ogr_geometry.h:2464
ChildType ** end()
Return end of curve iterator.
Definition: ogr_geometry.h:2470
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2575
OGRCurvePolygon(const OGRCurvePolygon &)
Copy constructor.
Abstract curve base class for OGRLineString, OGRCircularString and OGRCompoundCurve.
Definition: ogr_geometry.h:1323
virtual OGRLineString * CurveToLine(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const =0
Return a linestring from a curve geometry.
virtual double get_Length() const =0
Returns the length of the curve.
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:1414
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:1366
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:1406
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 OGRCurve * clone() const override=0
Make a copy of this object.
OGRGeometry visitor default implementation.
Definition: ogr_geometry.h:289
void visit(const OGRPoint *) override
Visit OGRPoint.
Definition: ogr_geometry.h:293
OGRGeometry visitor default implementation.
Definition: ogr_geometry.h:213
void visit(OGRPoint *) override
Visit OGRPoint.
Definition: ogr_geometry.h:217
Simple container for a bounding region in 3D.
Definition: ogr_core.h:216
Simple container for a bounding region (rectangle)
Definition: ogr_core.h:61
A collection of 1 or more geometry objects.
Definition: ogr_geometry.h:2880
ChildType ** end()
Return end of sub-geometry iterator.
Definition: ogr_geometry.h:2920
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:3014
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:3019
const ChildType *const * begin() const
Return begin of sub-geometry iterator.
Definition: ogr_geometry.h:2928
const ChildType *const * end() const
Return end of sub-geometry iterator.
Definition: ogr_geometry.h:2934
ChildType ** begin()
Return begin of sub-geometry iterator.
Definition: ogr_geometry.h:2914
OGRGeometry * getGeometryRef(int)
Fetch geometry from container.
Definition: ogrgeometrycollection.cpp:259
OGRGeometryCollection()
Create an empty geometry collection.
OGRGeometry ChildType
Type of child elements.
Definition: ogr_geometry.h:2909
Create geometry objects from well known text/binary.
Definition: ogr_geometry.h:4160
static OGRErr createFromWkt(char **ppszInput, const OGRSpatialReference *poSRS, OGRGeometry **ppoGeom)
Deprecated.
Definition: ogr_geometry.h:4183
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:377
const OGRSurface * toSurface() const
Down-cast to OGRSurface*.
Definition: ogr_geometry.h:808
const OGRCurvePolygon * toCurvePolygon() const
Down-cast to OGRCurvePolygon*.
Definition: ogr_geometry.h:866
const OGRMultiCurve * toMultiCurve() const
Down-cast to OGRMultiCurve*.
Definition: ogr_geometry.h:966
const OGRPolyhedralSurface * toPolyhedralSurface() const
Down-cast to OGRPolyhedralSurface*.
Definition: ogr_geometry.h:1006
const OGRMultiPoint * toMultiPoint() const
Down-cast to OGRMultiPoint*.
Definition: ogr_geometry.h:906
virtual void empty()=0
Clear geometry information.
const OGRMultiPolygon * toMultiPolygon() const
Down-cast to OGRMultiPolygon*.
Definition: ogr_geometry.h:946
virtual OGRBoolean Equals(const OGRGeometry *) const =0
Returns TRUE if two geometries are equivalent.
OGRPolyhedralSurface * toPolyhedralSurface()
Down-cast to OGRPolyhedralSurface*.
Definition: ogr_geometry.h:996
const OGRMultiSurface * toMultiSurface() const
Down-cast to OGRMultiSurface*.
Definition: ogr_geometry.h:986
OGRPoint * toPoint()
Down-cast to OGRPoint*.
Definition: ogr_geometry.h:661
bool operator!=(const OGRGeometry &other) const
Returns if two geometries are different.
Definition: ogr_geometry.h:437
OGRTriangle * toTriangle()
Down-cast to OGRTriangle*.
Definition: ogr_geometry.h:837
OGRLineString * toLineString()
Down-cast to OGRLineString*.
Definition: ogr_geometry.h:720
const OGRLinearRing * toLinearRing() const
Down-cast to OGRLinearRing*.
Definition: ogr_geometry.h:748
const OGRPoint * toPoint() const
Down-cast to OGRPoint*.
Definition: ogr_geometry.h:670
OGRMultiLineString * toMultiLineString()
Down-cast to OGRMultiLineString*.
Definition: ogr_geometry.h:916
OGRMultiSurface * toMultiSurface()
Down-cast to OGRMultiSurface*.
Definition: ogr_geometry.h:976
static OGRGeometry * FromHandle(OGRGeometryH hGeom)
Convert a OGRGeometryH to a OGRGeometry*.
Definition: ogr_geometry.h:652
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:886
const OGRMultiLineString * toMultiLineString() const
Down-cast to OGRMultiLineString*.
Definition: ogr_geometry.h:926
const OGRCircularString * toCircularString() const
Down-cast to OGRCircularString*.
Definition: ogr_geometry.h:768
OGRPolygon * toPolygon()
Down-cast to OGRPolygon*.
Definition: ogr_geometry.h:818
bool operator==(const OGRGeometry &other) const
Returns if two geometries are equal.
Definition: ogr_geometry.h:431
OGRLinearRing * toLinearRing()
Down-cast to OGRLinearRing*.
Definition: ogr_geometry.h:739
OGRBoolean IsMeasured() const
Definition: ogr_geometry.h:459
virtual void accept(IOGRGeometryVisitor *visitor)=0
Accept a visitor.
OGRMultiCurve * toMultiCurve()
Down-cast to OGRMultiCurve*.
Definition: ogr_geometry.h:956
const OGRCompoundCurve * toCompoundCurve() const
Down-cast to OGRCompoundCurve*.
Definition: ogr_geometry.h:788
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:876
virtual const char * getGeometryName() const =0
Fetch WKT name for geometry type.
OGRMultiPolygon * toMultiPolygon()
Down-cast to OGRMultiPolygon*.
Definition: ogr_geometry.h:936
const OGRPolygon * toPolygon() const
Down-cast to OGRPolygon*.
Definition: ogr_geometry.h:828
OGRCompoundCurve * toCompoundCurve()
Down-cast to OGRCompoundCurve*.
Definition: ogr_geometry.h:778
OGRErr importFromWkt(char **ppszInput)
Deprecated.
Definition: ogr_geometry.h:486
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:730
OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const
Convert a geometry into well known text format.
Definition: ogrgeometry.cpp:1949
OGRCircularString * toCircularString()
Down-cast to OGRCircularString*.
Definition: ogr_geometry.h:758
const OGRCurve * toCurve() const
Down-cast to OGRCurve*.
Definition: ogr_geometry.h:690
OGRCurvePolygon * toCurvePolygon()
Down-cast to OGRCurvePolygon*.
Definition: ogr_geometry.h:856
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:710
static OGRGeometryH ToHandle(OGRGeometry *poGeom)
Convert a OGRGeometry* to a OGRGeometryH.
Definition: ogr_geometry.h:644
OGRBoolean Is3D() const
Definition: ogr_geometry.h:453
OGRMultiPoint * toMultiPoint()
Down-cast to OGRMultiPoint*.
Definition: ogr_geometry.h:896
const OGRTriangulatedSurface * toTriangulatedSurface() const
Down-cast to OGRTriangulatedSurface*.
Definition: ogr_geometry.h:1024
const OGRTriangle * toTriangle() const
Down-cast to OGRTriangle*.
Definition: ogr_geometry.h:846
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:798
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:700
OGRTriangulatedSurface * toTriangulatedSurface()
Down-cast to OGRTriangulatedSurface*.
Definition: ogr_geometry.h:1015
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:680
Definition: ogr_geometry.h:1470
Concrete representation of a multi-vertex line.
Definition: ogr_geometry.h:1763
OGRSimpleCurve * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:1803
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1819
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1814
OGRLineString(const OGRLineString &other)
Copy constructor.
virtual double get_GeodesicArea(const OGRSpatialReference *poSRSOverride=nullptr) const override
Get the area of the (closed) curve, considered as a surface on the underlying ellipsoid of the SRS at...
virtual int isClockwise() const override
Returns TRUE if the ring has clockwise winding (or less than 2 points)
OGRLineString()
Create an empty line string.
virtual double get_Area() const override
Get the area of the (closed) curve.
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:1809
Concrete representation of a closed ring.
Definition: ogr_geometry.h:1853
OGRLineString * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:1904
const OGRLineString * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:1910
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1920
OGRLinearRing(const OGRLinearRing &other)
Copy constructor.
OGRLinearRing()
Constructor.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1915
A collection of OGRCurve.
Definition: ogr_geometry.h:3856
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:3891
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:3897
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:3962
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:3883
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:3952
const OGRCurve * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3911
OGRCurve * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3905
OGRMultiCurve()
Create an empty multi curve collection.
OGRMultiCurve(const OGRMultiCurve &other)
Copy constructor.
OGRCurve ChildType
Type of child elements.
Definition: ogr_geometry.h:3872
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:3877
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:3946
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:3957
A collection of OGRLineString.
Definition: ogr_geometry.h:4012
OGRLineString ChildType
Type of child elements.
Definition: ogr_geometry.h:4024
OGRLineString * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:4057
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:4092
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:4035
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:4049
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:4108
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:4043
OGRMultiLineString()
Create an empty multi line string collection.
const OGRLineString * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:4063
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:4103
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:4029
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:4098
OGRMultiLineString(const OGRMultiLineString &other)
Copy constructor.
A collection of OGRPoint.
Definition: ogr_geometry.h:3700
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:3785
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:3796
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:3740
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:3720
OGRMultiPoint()
Create an empty multi point collection.
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:3801
OGRMultiPoint(const OGRMultiPoint &other)
Copy constructor.
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:3734
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:3791
OGRPoint ChildType
Type of child elements.
Definition: ogr_geometry.h:3715
const OGRPoint * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3754
OGRPoint * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3748
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:3726
A collection of non-overlapping OGRPolygon.
Definition: ogr_geometry.h:3230
OGRPolygon ChildType
Type of child elements.
Definition: ogr_geometry.h:3252
OGRMultiPolygon(const OGRMultiPolygon &other)
Copy constructor.
OGRPolygon * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3285
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:3336
const OGRPolygon * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3291
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:3277
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:3263
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:3331
OGRMultiPolygon()
Create an empty multi polygon collection.
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:3257
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:3320
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:3271
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:3326
A collection of non-overlapping OGRSurface.
Definition: ogr_geometry.h:3073
OGRMultiSurface()
Create an empty multi surface collection.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:3173
const OGRSurface * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3152
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:3090
OGRSurface ChildType
Type of child elements.
Definition: ogr_geometry.h:3085
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:3168
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:3104
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:3110
OGRMultiSurface(const OGRMultiSurface &other)
Copy constructor.
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:3096
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:3178
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:3162
OGRSurface * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3146
Interface for a point iterator.
Definition: ogr_geometry.h:1305
virtual OGRBoolean getNextPoint(OGRPoint *p)=0
Returns the next point followed by the iterator.
Point class.
Definition: ogr_geometry.h:1142
double getM() const
Return m.
Definition: ogr_geometry.h:1215
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1276
void setX(double xIn)
Set x.
Definition: ogr_geometry.h:1226
OGRPoint(const OGRPoint &other)
Copy constructor.
void setZ(double zIn)
Set z.
Definition: ogr_geometry.h:1250
void setM(double mIn)
Set m.
Definition: ogr_geometry.h:1259
double getX() const
Return x.
Definition: ogr_geometry.h:1197
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1281
void setY(double yIn)
Set y.
Definition: ogr_geometry.h:1238
virtual OGRBoolean IsEmpty() const override
Returns TRUE (non-zero) if the object has no points.
Definition: ogr_geometry.h:1190
double getZ() const
Return z.
Definition: ogr_geometry.h:1209
double getY() const
Return y.
Definition: ogr_geometry.h:1203
Concrete class representing polygons.
Definition: ogr_geometry.h:2629
OGRLinearRing ChildType
Type of child elements.
Definition: ogr_geometry.h:2658
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2663
const OGRCurvePolygon * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2746
OGRPolygon()
Create an empty polygon.
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2669
OGRPolygon(const OGRPolygon &other)
Copy constructor.
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2677
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2756
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2683
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2751
OGRCurvePolygon * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2740
PolyhedralSurface class.
Definition: ogr_geometry.h:3387
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:3424
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:3438
OGRPolygon * getGeometryRef(int i)
Fetch geometry from container.
Definition: ogrpolyhedralsurface.cpp:871
OGRPolyhedralSurface(const OGRPolyhedralSurface &poGeom)
Copy constructor.
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:3432
~OGRPolyhedralSurface() override
Destructor.
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:3418
virtual OGRErr addGeometry(const OGRGeometry *)
Add a new geometry to a collection.
Definition: ogrpolyhedralsurface.cpp:753
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:3504
OGRPolygon ChildType
Type of child elements.
Definition: ogr_geometry.h:3413
OGRPolyhedralSurface()
Create an empty PolyhedralSurface.
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:3509
Simple container for a position.
Definition: ogr_geometry.h:106
OGRRawPoint(double xIn, double yIn)
Constructor.
Definition: ogr_geometry.h:114
double x
x
Definition: ogr_geometry.h:119
double y
y
Definition: ogr_geometry.h:121
OGRRawPoint()
Constructor.
Definition: ogr_geometry.h:109
Abstract curve base class for OGRLineString and OGRCircularString.
Definition: ogr_geometry.h:1514
double getY(int i) const
Get Y at vertex.
Definition: ogr_geometry.h:1663
double getX(int i) const
Get X at vertex.
Definition: ogr_geometry.h:1658
OGRPoint ChildType
Type of child elements.
Definition: ogr_geometry.h:1585
virtual OGRSimpleCurve * clone() const override=0
Make a copy of this object.
virtual int getNumPoints() const override
Fetch vertex count.
Definition: ogr_geometry.h:1651
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:169
Abstract base class for 2 dimensional objects like polygons or curve polygons.
Definition: ogr_geometry.h:2376
virtual double get_Area() const =0
Get the area of the surface object.
virtual double get_GeodesicArea(const OGRSpatialReference *poSRSOverride=nullptr) const =0
Get the area of the surface object, considered as a surface on the underlying ellipsoid of the SRS at...
virtual OGRSurface * clone() const override=0
Make a copy of this object.
virtual OGRErr PointOnSurface(OGRPoint *poPoint) const
This method relates to the SFCOM ISurface::get_PointOnSurface() method.
Definition: ogr_geometry.h:2388
Triangle class.
Definition: ogr_geometry.h:2805
const OGRPolygon * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2845
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2850
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2855
OGRTriangle()
Constructor.
~OGRTriangle() override
Destructor.
OGRPolygon * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2839
OGRTriangle(const OGRTriangle &other)
Copy constructor.
TriangulatedSurface class.
Definition: ogr_geometry.h:3561
const OGRTriangle * getGeometryRef(int i) const
See OGRPolyhedralSurface::getGeometryRef()
Definition: ogr_geometry.h:3621
~OGRTriangulatedSurface()
Destructor.
OGRTriangle * getGeometryRef(int i)
See OGRPolyhedralSurface::getGeometryRef()
Definition: ogr_geometry.h:3615
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:3604
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:3598
OGRPolyhedralSurface * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:3634
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:3645
const OGRPolyhedralSurface * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:3640
OGRTriangle ChildType
Type of child elements.
Definition: ogr_geometry.h:3579
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:3650
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:3584
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:3590
OGRTriangulatedSurface()
Constructor.
Various convenience functions for CPL.
Interface for read and write JSON documents.
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition: cpl_port.h:1042
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1183
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition: cpl_port.h:976
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:185
void * OGRGeometryH
Opaque type for a geometry.
Definition: ogr_api.h:66
Core portability services for cross-platform OGR code.
int OGRBoolean
Type for a OGR boolean.
Definition: ogr_core.h:404
OGRwkbByteOrder
Enumeration to describe byte order.
Definition: ogr_core.h:620
@ wkbNDR
LSB/Intel/Vax: Least Significant Byte First
Definition: ogr_core.h:622
OGRwkbVariant
Output variants of WKB we support.
Definition: ogr_core.h:550
@ wkbVariantOldOgc
Old-style 99-402 extended dimension (Z) WKB types.
Definition: ogr_core.h:551
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:416
int OGRErr
Type for a OGR error.
Definition: ogr_core.h:387
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:2592
OGRWktFormat
WKT Output formatting options.
Definition: ogr_geometry.h:64
@ Default
Format as F when abs(value) < 1, otherwise as G.
std::unique_ptr< OGRPreparedGeometry, OGRPreparedGeometryUniquePtrDeleter > OGRPreparedGeometryUniquePtr
Unique pointer type for OGRPreparedGeometry.
Definition: ogr_geometry.h:4280
struct GEOSContextHandle_HS * GEOSContextHandle_t
GEOS context handle type.
Definition: ogr_geometry.h:127
OGRwkbGeometryType OGRFromOGCGeomType(const char *pszGeomType)
Map OGCgeometry format type to corresponding OGR constants.
Definition: ogrgeometry.cpp:2513
std::unique_ptr< OGRGeometry, OGRGeometryUniquePtrDeleter > OGRGeometryUniquePtr
Unique pointer type for OGRGeometry.
Definition: ogr_geometry.h:1042
struct GEOSGeom_t * GEOSGeom
GEOS geometry type.
Definition: ogr_geometry.h:125
void sfcgal_geometry_t
SFCGAL geometry type.
Definition: ogr_geometry.h:129
Coordinate systems services.
OGRLayer::FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition: ogrsf_frmts.h:426
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition: ogrsf_frmts.h:434
Geometry coordinate precision for a binary representation.
Definition: ogr_geometry.h:323
Geometry coordinate precision.
Definition: ogr_geomcoordinateprecision.h:50
Options for formatting WKT output.
Definition: ogr_geometry.h:72
int mPrecision
Precision of output for M coordinates. Interpretation depends on format.
Definition: ogr_geometry.h:81
int zPrecision
Precision of output for Z coordinates. Interpretation depends on format.
Definition: ogr_geometry.h:79
OGRWktOptions()
Constructor.
Definition: ogr_geometry.h:88
OGRWktOptions(const OGRWktOptions &)=default
Copy constructor.
int xyPrecision
Precision of output for X,Y coordinates. Interpretation depends on format.
Definition: ogr_geometry.h:77
WKB export options.
Definition: ogr_geometry.h:346