15#ifndef OGR_GEOMETRY_H_INCLUDED
16#define OGR_GEOMETRY_H_INCLUDED
356class CPL_DLL OGRGeometry
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,
372 OGRErr (*pfnAddCurveDirectly)(OGRGeometry *poSelf,
OGRCurve *poCurve));
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;
405 OGRGeometry(
const OGRGeometry &other);
406 OGRGeometry(OGRGeometry &&other);
407 virtual ~OGRGeometry();
409 OGRGeometry &
operator=(
const OGRGeometry &other);
410 OGRGeometry &
operator=(OGRGeometry &&other);
415 return CPL_TO_BOOL(
Equals(&other));
421 return !CPL_TO_BOOL(
Equals(&other));
437 return (flags & OGR_G_3D) != 0;
443 return (flags & OGR_G_MEASURED) != 0;
457 size_t &nBytesConsumedOut) = 0;
470 CPL_WARN_DEPRECATED(
"Use importFromWkt(const char**) instead")
477 OGRErr exportToWkt(
char **ppszDstText,
485 OGRErr *err =
nullptr)
const = 0;
496 virtual char *
exportToGML(
const char *
const *papszOptions =
nullptr)
const;
515 double dfMaxAngleStepSizeDegrees = 0,
557 double Distance(const OGRGeometry *) const;
568 OGRGeometry *
Buffer(
double dfDist,
606 double Distance3D(const OGRGeometry *poOtherGeom) const;
608 OGRGeometry *
SetPrecision(
double dfGridSize,
int nFlags) const;
616 CPL_WARN_DEPRECATED(
"Non standard method. "
617 "Use Intersects() instead");
619 CPL_WARN_DEPRECATED(
"Non standard method. "
620 "Use Equals() instead");
621 OGRGeometry *SymmetricDifference(const OGRGeometry *) const
622 CPL_WARN_DEPRECATED(
"Non standard method. "
623 "Use SymDifference() instead");
624 OGRGeometry *getBoundary() const
625 CPL_WARN_DEPRECATED(
"Non standard method. "
626 "Use Boundary() instead");
631 static
int bGenerate_DB2_V72_BYTE_ORDER;
639 static OGRGeometry *CastToIdentity(OGRGeometry *poGeom)
659 return reinterpret_cast<OGRGeometry *
>(hGeom);
998struct CPL_DLL OGRGeometryUniquePtrDeleter
1000 void operator()(OGRGeometry *)
const;
1007typedef std::unique_ptr<OGRGeometry, OGRGeometryUniquePtrDeleter>
1011#define OGR_FORBID_DOWNCAST_TO(name) \
1012 inline OGR##name *to##name() = delete; \
1013 inline const OGR##name *to##name() const = delete;
1015#define OGR_FORBID_DOWNCAST_TO_POINT OGR_FORBID_DOWNCAST_TO(Point)
1016#define OGR_FORBID_DOWNCAST_TO_CURVE OGR_FORBID_DOWNCAST_TO(Curve)
1017#define OGR_FORBID_DOWNCAST_TO_SIMPLE_CURVE OGR_FORBID_DOWNCAST_TO(SimpleCurve)
1018#define OGR_FORBID_DOWNCAST_TO_LINESTRING OGR_FORBID_DOWNCAST_TO(LineString)
1019#define OGR_FORBID_DOWNCAST_TO_LINEARRING OGR_FORBID_DOWNCAST_TO(LinearRing)
1020#define OGR_FORBID_DOWNCAST_TO_CIRCULARSTRING \
1021 OGR_FORBID_DOWNCAST_TO(CircularString)
1022#define OGR_FORBID_DOWNCAST_TO_COMPOUNDCURVE \
1023 OGR_FORBID_DOWNCAST_TO(CompoundCurve)
1024#define OGR_FORBID_DOWNCAST_TO_SURFACE OGR_FORBID_DOWNCAST_TO(Surface)
1025#define OGR_FORBID_DOWNCAST_TO_CURVEPOLYGON OGR_FORBID_DOWNCAST_TO(CurvePolygon)
1026#define OGR_FORBID_DOWNCAST_TO_POLYGON OGR_FORBID_DOWNCAST_TO(Polygon)
1027#define OGR_FORBID_DOWNCAST_TO_TRIANGLE OGR_FORBID_DOWNCAST_TO(Triangle)
1028#define OGR_FORBID_DOWNCAST_TO_MULTIPOINT OGR_FORBID_DOWNCAST_TO(MultiPoint)
1029#define OGR_FORBID_DOWNCAST_TO_MULTICURVE OGR_FORBID_DOWNCAST_TO(MultiCurve)
1030#define OGR_FORBID_DOWNCAST_TO_MULTILINESTRING \
1031 OGR_FORBID_DOWNCAST_TO(MultiLineString)
1032#define OGR_FORBID_DOWNCAST_TO_MULTISURFACE OGR_FORBID_DOWNCAST_TO(MultiSurface)
1033#define OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON OGR_FORBID_DOWNCAST_TO(MultiPolygon)
1034#define OGR_FORBID_DOWNCAST_TO_GEOMETRYCOLLECTION \
1035 OGR_FORBID_DOWNCAST_TO(GeometryCollection)
1036#define OGR_FORBID_DOWNCAST_TO_POLYHEDRALSURFACE \
1037 OGR_FORBID_DOWNCAST_TO(PolyhedralSurface)
1038#define OGR_FORBID_DOWNCAST_TO_TIN OGR_FORBID_DOWNCAST_TO(TriangulatedSurface)
1040#define OGR_ALLOW_UPCAST_TO(name) \
1041 inline OGR##name *to##name() \
1045 inline const OGR##name *to##name() const \
1050#ifndef SUPPRESS_OGR_ALLOW_CAST_TO_THIS_WARNING
1051#define CAST_TO_THIS_WARNING CPL_WARN_DEPRECATED("Casting to this is useless")
1053#define CAST_TO_THIS_WARNING
1056#define OGR_ALLOW_CAST_TO_THIS(name) \
1057 inline OGR##name *to##name() CAST_TO_THIS_WARNING \
1061 inline const OGR##name *to##name() const CAST_TO_THIS_WARNING \
1066#define OGR_FORBID_DOWNCAST_TO_ALL_CURVES \
1067 OGR_FORBID_DOWNCAST_TO_CURVE \
1068 OGR_FORBID_DOWNCAST_TO_SIMPLE_CURVE \
1069 OGR_FORBID_DOWNCAST_TO_LINESTRING \
1070 OGR_FORBID_DOWNCAST_TO_LINEARRING \
1071 OGR_FORBID_DOWNCAST_TO_CIRCULARSTRING \
1072 OGR_FORBID_DOWNCAST_TO_COMPOUNDCURVE
1074#define OGR_FORBID_DOWNCAST_TO_ALL_SURFACES \
1075 OGR_FORBID_DOWNCAST_TO_SURFACE \
1076 OGR_FORBID_DOWNCAST_TO_CURVEPOLYGON \
1077 OGR_FORBID_DOWNCAST_TO_POLYGON \
1078 OGR_FORBID_DOWNCAST_TO_TRIANGLE \
1079 OGR_FORBID_DOWNCAST_TO_POLYHEDRALSURFACE \
1080 OGR_FORBID_DOWNCAST_TO_TIN
1082#define OGR_FORBID_DOWNCAST_TO_ALL_SINGLES \
1083 OGR_FORBID_DOWNCAST_TO_POINT \
1084 OGR_FORBID_DOWNCAST_TO_ALL_CURVES \
1085 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1087#define OGR_FORBID_DOWNCAST_TO_ALL_MULTI \
1088 OGR_FORBID_DOWNCAST_TO_GEOMETRYCOLLECTION \
1089 OGR_FORBID_DOWNCAST_TO_MULTIPOINT \
1090 OGR_FORBID_DOWNCAST_TO_MULTICURVE \
1091 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING \
1092 OGR_FORBID_DOWNCAST_TO_MULTISURFACE \
1093 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
1117 OGRPoint(
double x,
double y,
double z);
1118 OGRPoint(
double x,
double y,
double z,
double m);
1129 size_t WkbSize()
const override;
1131 size_t &nBytesConsumedOut)
override;
1150 OGRErr *err =
nullptr)
const override;
1155 void empty()
override;
1161 return !(flags & OGR_G_NOT_EMPTY_POINT);
1190 bool setCoordinateDimension(
int nDimension)
override;
1198 if (std::isnan(x) || std::isnan(y))
1199 flags &= ~OGR_G_NOT_EMPTY_POINT;
1201 flags |= OGR_G_NOT_EMPTY_POINT;
1210 if (std::isnan(x) || std::isnan(y))
1211 flags &= ~OGR_G_NOT_EMPTY_POINT;
1213 flags |= OGR_G_NOT_EMPTY_POINT;
1231 flags |= OGR_G_MEASURED;
1240 const char *getGeometryName()
const override;
1243 void flattenTo2D()
override;
1247 visitor->
visit(
this);
1252 visitor->
visit(
this);
1255 void swapXY()
override;
1257 OGR_ALLOW_CAST_TO_THIS(Point)
1258 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
1259 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1260 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
1298 virtual OGRCurveCasterToLineString GetCasterToLineString()
const = 0;
1299 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const = 0;
1309 class CPL_DLL ConstIterator
1312 std::unique_ptr<Private> m_poPrivate;
1315 ConstIterator(
const OGRCurve *poSelf,
bool bStart);
1316 ConstIterator(ConstIterator &&oOther)
noexcept;
1317 ConstIterator &
operator=(ConstIterator &&oOther);
1320 ConstIterator &operator++();
1321 bool operator!=(
const ConstIterator &it)
const;
1325 friend inline ConstIterator
end(
const OGRCurve *);
1343 ConstIterator
begin()
const;
1345 ConstIterator
end()
const;
1358 const char *
const *papszOptions =
nullptr)
const = 0;
1393 OGR_FORBID_DOWNCAST_TO_POINT
1394 OGR_ALLOW_CAST_TO_THIS(Curve)
1395 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1396 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
1401inline OGRCurve::ConstIterator
begin(
const OGRCurve *poCurve)
1403 return poCurve->begin();
1407inline OGRCurve::ConstIterator
end(
const OGRCurve *poCurve)
1409 return poCurve->end();
1442 friend class OGRSimpleCurve;
1444 OGRSimpleCurve *m_poCurve =
nullptr;
1447 OGRIteratedPoint() =
default;
1455 void setX(
double xIn);
1459 void setY(
double yIn);
1463 void setZ(
double zIn);
1467 void setM(
double mIn);
1491 int nPointCount = 0;
1492 int m_nPointCapacity = 0;
1494 double *padfZ =
nullptr;
1495 double *padfM =
nullptr;
1502 OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
int bHasM,
1517 class CPL_DLL Iterator
1520 std::unique_ptr<Private> m_poPrivate;
1525 Iterator(Iterator &&oOther)
noexcept;
1529 Iterator &operator++();
1536 class CPL_DLL ConstIterator
1539 std::unique_ptr<Private> m_poPrivate;
1544 ConstIterator &&oOther)
noexcept;
1548 ConstIterator &operator++();
1549 bool operator!=(
const ConstIterator &it)
const;
1552 friend inline ConstIterator
begin(
const OGRSimpleCurve *);
1553 friend inline ConstIterator
end(
const OGRSimpleCurve *);
1556 ~OGRSimpleCurve()
override;
1558 OGRSimpleCurve &operator=(
const OGRSimpleCurve &other);
1560 OGRSimpleCurve &operator=(OGRSimpleCurve &&other);
1582 ConstIterator
begin()
const;
1584 ConstIterator
end()
const;
1587 size_t WkbSize()
const override;
1589 size_t &nBytesConsumedOut)
override;
1609 OGRErr *err =
nullptr)
const override;
1612 void empty()
override;
1632 void getPoint(
int,
OGRPoint *)
const;
1636 return paoPoints[i].
x;
1641 return paoPoints[i].
y;
1644 double getZ(
int i)
const;
1645 double getM(
int i)
const;
1651 bool setCoordinateDimension(
int nDimension)
override;
1653 bool setMeasured(
OGRBoolean bIsMeasured)
override;
1654 bool setNumPoints(
int nNewPointCount,
int bZeroizeNewContent = TRUE);
1656 bool setPoint(
int,
double,
double);
1657 bool setZ(
int,
double);
1658 bool setM(
int,
double);
1659 bool setPoint(
int,
double,
double,
double);
1660 bool setPointM(
int,
double,
double,
double);
1661 bool setPoint(
int,
double,
double,
double,
double);
1662 bool setPoints(
int,
const OGRRawPoint *,
const double * =
nullptr);
1663 bool setPointsM(
int,
const OGRRawPoint *,
const double *);
1664 bool setPoints(
int,
const OGRRawPoint *,
const double *,
const double *);
1665 bool setPoints(
int,
const double *padfX,
const double *padfY,
1666 const double *padfZIn =
nullptr);
1667 bool setPointsM(
int,
const double *padfX,
const double *padfY,
1668 const double *padfMIn =
nullptr);
1669 bool setPoints(
int,
const double *padfX,
const double *padfY,
1670 const double *padfZIn,
const double *padfMIn);
1672 bool addPoint(
double,
double);
1673 bool addPoint(
double,
double,
double);
1674 bool addPointM(
double,
double,
double);
1675 bool addPoint(
double,
double,
double,
double);
1677 bool removePoint(
int);
1679 void getPoints(
OGRRawPoint *,
double * =
nullptr)
const;
1680 void getPoints(
void *pabyX,
int nXStride,
void *pabyY,
int nYStride,
1681 void *pabyZ =
nullptr,
int nZStride = 0,
1682 void *pabyM =
nullptr,
int nMStride = 0)
const;
1684 void addSubLineString(
const OGRLineString *,
int nStartVertex = 0,
1685 int nEndVertex = -1);
1686 void reversePoints()
override;
1691 void flattenTo2D()
override;
1692 bool segmentize(
double dfMaxLength)
override;
1694 void swapXY()
override;
1696 OGR_ALLOW_UPCAST_TO(Curve)
1697 OGR_ALLOW_CAST_TO_THIS(SimpleCurve)
1704 return poCurve->begin();
1710 return poCurve->end();
1716 return poCurve->begin();
1722 return poCurve->end();
1748 OGRCurveCasterToLineString GetCasterToLineString()
const override;
1749 OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1768 const char *
const *papszOptions =
nullptr)
const override;
1770 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
1796 visitor->
visit(
this);
1801 visitor->
visit(
this);
1804 OGR_ALLOW_UPCAST_TO(SimpleCurve)
1805 OGR_ALLOW_CAST_TO_THIS(LineString)
1839 size_t WkbSize()
const override;
1841 size_t &nBytesConsumedOut)
override;
1842 OGRErr exportToWkb(
unsigned char *,
1851 virtual size_t _WkbSize(
int _flags)
const;
1853 const unsigned char *,
size_t,
1854 size_t &nBytesConsumedOut);
1855 virtual OGRErr _exportToWkb(
int _flags,
unsigned char *,
1858 OGRCurveCasterToLineString GetCasterToLineString()
const override;
1859 OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1881 void reverseWindingOrder()
1882 CPL_WARN_DEPRECATED(
"Use reversePoints() instead");
1887 int bTestEnvelope = TRUE) const;
1889 int bTestEnvelope = TRUE) const;
1906 visitor->
visit(
this);
1911 visitor->
visit(
this);
1914 OGR_ALLOW_UPCAST_TO(LineString)
1915 OGR_ALLOW_CAST_TO_THIS(LinearRing)
1936 void ExtendEnvelopeWithCircular(
OGREnvelope *psEnvelope)
const;
1937 OGRBoolean IsValidFast(std::string *posReason =
nullptr)
const;
1938 int IsFullCircle(
double &cx,
double &cy,
double &square_R)
const;
1942 OGRCurveCasterToLineString GetCasterToLineString()
const override;
1943 OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1963 size_t &nBytesConsumedOut)
override;
1982 OGRErr *err =
nullptr)
const override;
1994 const char *
const *papszOptions =
nullptr)
const override;
2005 bool segmentize(
double dfMaxLength)
override;
2010 const char *
const *papszOptions =
nullptr)
const override;
2026 visitor->
visit(
this);
2031 visitor->
visit(
this);
2034 OGR_ALLOW_UPCAST_TO(SimpleCurve)
2035 OGR_ALLOW_CAST_TO_THIS(CircularString)
2052class CPL_DLL OGRCurveCollection
2055 friend class OGRCompoundCurve;
2056 friend class OGRCurvePolygon;
2057 friend class OGRPolygon;
2058 friend class OGRTriangle;
2060 int nCurveCount = 0;
2061 OGRCurve **papoCurves =
nullptr;
2064 OGRCurveCollection() =
default;
2065 OGRCurveCollection(
const OGRCurveCollection &other);
2066 OGRCurveCollection(OGRCurveCollection &&other);
2067 ~OGRCurveCollection();
2069 OGRCurveCollection &operator=(
const OGRCurveCollection &other);
2070 OGRCurveCollection &operator=(OGRCurveCollection &&other);
2073 typedef OGRCurve ChildType;
2085 return papoCurves + nCurveCount;
2090 const OGRCurve *
const *
begin()
const
2096 const OGRCurve *
const *
end()
const
2098 return papoCurves + nCurveCount;
2101 void empty(OGRGeometry *poGeom);
2103 void getEnvelope(OGREnvelope *psEnvelope)
const;
2104 void getEnvelope(OGREnvelope3D *psEnvelope)
const;
2106 OGRErr addCurveDirectly(OGRGeometry *poGeom, OGRCurve *poCurve,
2108 size_t WkbSize()
const;
2109 OGRErr importPreambleFromWkb(OGRGeometry *poGeom,
2110 const unsigned char *pabyData,
size_t &nSize,
2111 size_t &nDataOffset,
2113 size_t nMinSubGeomSize,
2116 importBodyFromWkb(OGRGeometry *poGeom,
const unsigned char *pabyData,
2117 size_t nSize,
bool bAcceptCompoundCurve,
2118 OGRErr (*pfnAddCurveDirectlyFromWkb)(OGRGeometry *poGeom,
2121 std::string exportToWkt(
const OGRGeometry *geom,
const OGRWktOptions &opts,
2123 OGRErr exportToWkb(
const OGRGeometry *poGeom,
unsigned char *,
2125 OGRBoolean Equals(
const OGRCurveCollection *poOCC)
const;
2126 bool setCoordinateDimension(OGRGeometry *poGeom,
int nNewDimension);
2127 bool set3D(OGRGeometry *poGeom,
OGRBoolean bIs3D);
2128 bool setMeasured(OGRGeometry *poGeom,
OGRBoolean bIsMeasured);
2129 void assignSpatialReference(OGRGeometry *poGeom,
2130 const OGRSpatialReference *poSR);
2131 int getNumCurves()
const;
2132 OGRCurve *getCurve(
int);
2133 const OGRCurve *getCurve(
int)
const;
2134 OGRCurve *stealCurve(
int);
2136 OGRErr removeCurve(
int iIndex,
bool bDelete =
true);
2138 bool hasEmptyParts()
const;
2139 void removeEmptyParts();
2141 void reversePoints();
2143 OGRErr transform(OGRGeometry *poGeom, OGRCoordinateTransformation *poCT);
2144 void flattenTo2D(OGRGeometry *poGeom);
2145 bool segmentize(
double dfMaxLength);
2147 OGRBoolean hasCurveGeometry(
int bLookForNonLinear)
const;
2168 OGRCurveCollection oCC{};
2170 OGRErr addCurveDirectlyInternal(
OGRCurve *poCurve,
double dfToleranceEps,
2176 OGRLineString *CurveToLineInternal(
double dfMaxAngleStepSizeDegrees,
2177 const char *
const *papszOptions,
2178 int bIsLinearRing)
const;
2189 OGRCurveCasterToLineString GetCasterToLineString()
const override;
2190 OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
2235 size_t WkbSize()
const override;
2237 size_t &nBytesConsumedOut)
override;
2238 OGRErr exportToWkb(
unsigned char *,
2245 OGRErr importFromWkt(
const char **)
override;
2256 OGRErr *err =
nullptr)
const override;
2260 void empty()
override;
2261 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
2266 double get_Length()
const override;
2267 void StartPoint(
OGRPoint *)
const override;
2268 void EndPoint(
OGRPoint *)
const override;
2269 void Value(
double,
OGRPoint *)
const override;
2271 CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
2272 const char *
const *papszOptions =
nullptr)
const override;
2274 int getNumPoints()
const override;
2275 double get_AreaOfCurveSegments()
const override;
2276 double get_Area()
const override;
2277 virtual double get_GeodesicArea(
2279 virtual double get_GeodesicLength(
2286 int getNumCurves()
const;
2288 const OGRCurve *getCurve(
int)
const;
2291 bool setCoordinateDimension(
int nDimension)
override;
2293 bool setMeasured(
OGRBoolean bIsMeasured)
override;
2318 bool segmentize(
double dfMaxLength)
override;
2323 const char *
const *papszOptions =
nullptr)
const override;
2327 visitor->
visit(
this);
2332 visitor->
visit(
this);
2335 void swapXY()
override;
2337 bool hasEmptyParts()
const override;
2338 void removeEmptyParts()
override;
2340 OGR_ALLOW_UPCAST_TO(Curve)
2341 OGR_ALLOW_CAST_TO_THIS(CompoundCurve)
2349 return poCurve->
begin();
2356 return poCurve->
end();
2362 return poCurve->
begin();
2368 return poCurve->
end();
2386 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const = 0;
2387 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
const = 0;
2407 OGR_FORBID_DOWNCAST_TO_POINT
2408 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
2409 OGR_ALLOW_CAST_TO_THIS(Surface)
2410 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
2437 virtual bool isRingCorrectType(
const OGRCurve *poRing)
const;
2439 virtual bool checkRing(
const OGRCurve *poNewRing)
const;
2440 OGRErr addRingDirectlyInternal(
OGRCurve *poCurve,
int bNeedRealloc);
2450 OGRCurveCollection oCC{};
2452 OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2453 virtual OGRSurfaceCasterToCurvePolygon
2454 GetCasterToCurvePolygon()
const override;
2502 const char *getGeometryName()
const override;
2505 void empty()
override;
2507 void flattenTo2D()
override;
2509 bool segmentize(
double dfMaxLength)
override;
2511 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2513 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2514 const char *
const *papszOptions =
nullptr)
const override;
2515 virtual double get_GeodesicArea(
2517 virtual double get_GeodesicLength(
2521 double get_Area()
const override;
2523 double get_Length()
const override;
2526 size_t WkbSize()
const override;
2528 size_t &nBytesConsumedOut)
override;
2529 OGRErr exportToWkb(
unsigned char *,
2536 OGRErr importFromWkt(
const char **)
override;
2547 OGRErr *err =
nullptr)
const override;
2550 int getDimension()
const override;
2551 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
2556 CurvePolyToPoly(
double dfMaxAngleStepSizeDegrees = 0,
2557 const char *
const *papszOptions =
nullptr)
const;
2565 bool setCoordinateDimension(
int nDimension)
override;
2567 bool setMeasured(
OGRBoolean bIsMeasured)
override;
2574 OGRErr addRing(std::unique_ptr<OGRCurve>);
2577 const OGRCurve *getExteriorRingCurve()
const;
2578 int getNumInteriorRings()
const;
2579 OGRCurve *getInteriorRingCurve(
int);
2580 const OGRCurve *getInteriorRingCurve(
int)
const;
2582 OGRCurve *stealExteriorRingCurve();
2584 OGRErr removeRing(
int iIndex,
bool bDelete =
true);
2588 visitor->
visit(
this);
2593 visitor->
visit(
this);
2596 void swapXY()
override;
2598 bool hasEmptyParts()
const override;
2599 void removeEmptyParts()
override;
2601 OGR_ALLOW_UPCAST_TO(Surface)
2602 OGR_ALLOW_CAST_TO_THIS(CurvePolygon)
2610 return poGeom->
begin();
2617 return poGeom->
end();
2623 return poGeom->
begin();
2629 return poGeom->
end();
2657 bool isRingCorrectType(
const OGRCurve *poRing)
const override;
2659 bool checkRing(
const OGRCurve *poNewRing)
const override;
2660 virtual OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
2662 int &nMaxPoints,
double *&padfZ);
2666 OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2667 virtual OGRSurfaceCasterToCurvePolygon
2668 GetCasterToCurvePolygon()
const override;
2675 OGRPolygon(
double x1,
double y1,
double x2,
double y2);
2694 return reinterpret_cast<ChildType **
>(oCC.begin());
2700 return reinterpret_cast<ChildType **
>(oCC.end());
2707 return reinterpret_cast<const ChildType *
const *
>(oCC.begin());
2713 return reinterpret_cast<const ChildType *
const *
>(oCC.end());
2717 const char *getGeometryName()
const override;
2721 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2723 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
2725 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2726 const char *
const *papszOptions =
nullptr)
const override;
2729 size_t WkbSize()
const override;
2731 size_t &nBytesConsumedOut)
override;
2732 OGRErr exportToWkb(
unsigned char *,
2739 OGRErr importFromWkt(
const char **)
override;
2750 OGRErr *err =
nullptr)
const override;
2754 CurvePolyToPoly(
double dfMaxAngleStepSizeDegrees = 0,
2755 const char *
const *papszOptions =
nullptr)
const override;
2781 visitor->
visit(
this);
2786 visitor->
visit(
this);
2789 void closeRings()
override;
2791 OGR_ALLOW_UPCAST_TO(CurvePolygon)
2792 OGR_ALLOW_CAST_TO_THIS(Polygon)
2799 return poGeom->
begin();
2805 return poGeom->
end();
2811 return poGeom->
begin();
2817 return poGeom->
end();
2836 bool quickValidityCheck()
const;
2840 OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2841 virtual OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
2844 double *&padfZ)
override;
2865 size_t &nBytesConsumedOut)
override;
2884 visitor->
visit(
this);
2889 visitor->
visit(
this);
2896 OGR_ALLOW_UPCAST_TO(Polygon)
2897 OGR_ALLOW_CAST_TO_THIS(Triangle)
2913 OGRErr importFromWktInternal(
const char **ppszInput,
int nRecLevel);
2918 OGRGeometry **papoGeoms =
nullptr;
2922 const std::string &exclude = std::string())
const;
2927 OGRErr importFromWkbInternal(
const unsigned char *pabyData,
size_t nSize,
2929 size_t &nBytesConsumedOut);
2957 return papoGeoms + nGeomCount;
2970 return papoGeoms + nGeomCount;
2974 const char *getGeometryName()
const override;
2977 void empty()
override;
2979 void flattenTo2D()
override;
2981 bool segmentize(
double dfMaxLength)
override;
2983 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2985 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
2987 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2988 const char *
const *papszOptions =
nullptr)
const override;
2991 virtual double get_GeodesicLength(
2995 size_t WkbSize()
const override;
2997 size_t &nBytesConsumedOut)
override;
2998 OGRErr exportToWkb(
unsigned char *,
3005 OGRErr importFromWkt(
const char **)
override;
3016 OGRErr *err =
nullptr)
const override;
3018 virtual double get_Length()
const;
3019 virtual double get_Area()
const;
3022 int getDimension()
const override;
3023 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
3027 int getNumGeometries()
const;
3035 bool setCoordinateDimension(
int nDimension)
override;
3037 bool setMeasured(
OGRBoolean bIsMeasured)
override;
3040 OGRErr addGeometry(std::unique_ptr<OGRGeometry> geom);
3041 OGRErr addGeometryComponents(std::unique_ptr<OGRGeometryCollection> geom);
3042 virtual OGRErr removeGeometry(
int iIndex,
int bDelete = TRUE);
3043 std::unique_ptr<OGRGeometry> stealGeometry(
int iIndex);
3045 bool hasEmptyParts()
const override;
3046 void removeEmptyParts()
override;
3051 void closeRings()
override;
3053 void swapXY()
override;
3057 visitor->
visit(
this);
3062 visitor->
visit(
this);
3068 OGR_FORBID_DOWNCAST_TO_POINT
3069 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
3070 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
3071 OGR_ALLOW_CAST_TO_THIS(GeometryCollection)
3079 return poGeom->
begin();
3086 return poGeom->
end();
3092 return poGeom->
begin();
3098 return poGeom->
end();
3136 return reinterpret_cast<ChildType **
>(papoGeoms);
3142 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3149 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3155 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3160 const char *getGeometryName()
const override;
3168 OGRErr importFromWkt(
const char **)
override;
3179 OGRErr *err =
nullptr)
const override;
3185 int getDimension()
const override;
3202 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3218 visitor->
visit(
this);
3223 visitor->
visit(
this);
3228 OGR_ALLOW_CAST_TO_THIS(MultiSurface)
3229 OGR_ALLOW_UPCAST_TO(GeometryCollection)
3230 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
3231 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING
3232 OGR_FORBID_DOWNCAST_TO_MULTICURVE
3240 return poGeom->
begin();
3247 return poGeom->
end();
3253 return poGeom->
begin();
3259 return poGeom->
end();
3276 friend class OGRPolyhedralSurface;
3277 friend class OGRTriangulatedSurface;
3281 OGRErr _addGeometryWithExpectedSubGeometryType(
3283 OGRErr _addGeometryDirectlyWithExpectedSubGeometryType(
3306 return reinterpret_cast<ChildType **
>(papoGeoms);
3312 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3319 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3325 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3343 const char *getGeometryName()
const override;
3352 size_t &nBytesConsumedOut)
override;
3359 OGRErr *err =
nullptr)
const override;
3363 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3379 visitor->
visit(
this);
3384 visitor->
visit(
this);
3389 OGR_ALLOW_CAST_TO_THIS(MultiPolygon)
3390 OGR_ALLOW_UPCAST_TO(MultiSurface)
3398 return poGeom->
begin();
3405 return poGeom->
end();
3411 return poGeom->
begin();
3417 return poGeom->
end();
3437 OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
3438 virtual OGRSurfaceCasterToCurvePolygon
3439 GetCasterToCurvePolygon()
const override;
3441 virtual const char *getSubGeometryName()
const;
3446 virtual OGRPolyhedralSurfaceCastToMultiPolygon
3447 GetCasterToMultiPolygon()
const;
3493 size_t WkbSize()
const override;
3494 const char *getGeometryName()
const override;
3497 size_t &nBytesConsumedOut)
override;
3498 OGRErr exportToWkb(
unsigned char *,
3505 OGRErr importFromWkt(
const char **)
override;
3516 OGRErr *err =
nullptr)
const override;
3519 int getDimension()
const override;
3521 void empty()
override;
3524 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
3527 void flattenTo2D()
override;
3530 double get_Area()
const override;
3531 virtual double get_GeodesicArea(
3533 double get_Length()
const override;
3534 virtual double get_GeodesicLength(
3541 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3544 OGRErr addGeometry(std::unique_ptr<OGRGeometry> poNewGeom);
3546 int getNumGeometries()
const;
3548 const OGRPolygon *getGeometryRef(
int i)
const;
3551 bool setCoordinateDimension(
int nDimension)
override;
3553 bool setMeasured(
OGRBoolean bIsMeasured)
override;
3554 void swapXY()
override;
3555 OGRErr removeGeometry(
int iIndex,
int bDelete = TRUE);
3557 bool hasEmptyParts()
const override;
3558 void removeEmptyParts()
override;
3562 visitor->
visit(
this);
3567 visitor->
visit(
this);
3573 OGR_ALLOW_CAST_TO_THIS(PolyhedralSurface)
3574 OGR_ALLOW_UPCAST_TO(Surface)
3582 return poGeom->
begin();
3589 return poGeom->
end();
3595 return poGeom->
begin();
3601 return poGeom->
end();
3620 const char *getSubGeometryName()
const override;
3623 virtual OGRPolyhedralSurfaceCastToMultiPolygon
3624 GetCasterToMultiPolygon()
const override;
3666 return reinterpret_cast<const ChildType *
const *
>(oMP.
end());
3669 const char *getGeometryName()
const override;
3706 visitor->
visit(
this);
3711 visitor->
visit(
this);
3717 OGR_ALLOW_CAST_TO_THIS(TriangulatedSurface)
3718 OGR_ALLOW_UPCAST_TO(PolyhedralSurface)
3726 return poGeom->
begin();
3733 return poGeom->
end();
3739 return poGeom->
begin();
3745 return poGeom->
end();
3761 OGRErr importFromWkt_Bracketed(
const char **,
int bHasM,
int bHasZ);
3785 return reinterpret_cast<ChildType **
>(papoGeoms);
3791 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3798 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3804 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3822 const char *getGeometryName()
const override;
3830 OGRErr importFromWkt(
const char **)
override;
3841 OGRErr *err =
nullptr)
const override;
3844 int getDimension()
const override;
3860 visitor->
visit(
this);
3865 visitor->
visit(
this);
3870 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3872 OGR_ALLOW_CAST_TO_THIS(MultiPoint)
3873 OGR_ALLOW_UPCAST_TO(GeometryCollection)
3874 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING
3875 OGR_FORBID_DOWNCAST_TO_MULTICURVE
3876 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
3877 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
3884 return poGeom->
begin();
3890 return poGeom->
end();
3896 return poGeom->
begin();
3902 return poGeom->
end();
3944 return reinterpret_cast<ChildType **
>(papoGeoms);
3950 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3957 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3963 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3981 const char *getGeometryName()
const override;
3989 OGRErr importFromWkt(
const char **)
override;
4000 OGRErr *err =
nullptr)
const override;
4003 int getDimension()
const override;
4007 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
4023 visitor->
visit(
this);
4028 visitor->
visit(
this);
4033 OGR_ALLOW_CAST_TO_THIS(MultiCurve)
4034 OGR_ALLOW_UPCAST_TO(GeometryCollection)
4035 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
4036 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
4037 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
4044 return poGeom->
begin();
4050 return poGeom->
end();
4056 return poGeom->
begin();
4062 return poGeom->
end();
4099 return reinterpret_cast<ChildType **
>(papoGeoms);
4105 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
4112 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
4118 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
4136 const char *getGeometryName()
const override;
4145 size_t &nBytesConsumedOut)
override;
4152 OGRErr *err =
nullptr)
const override;
4156 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
4172 visitor->
visit(
this);
4177 visitor->
visit(
this);
4182 OGR_ALLOW_CAST_TO_THIS(MultiLineString)
4183 OGR_ALLOW_UPCAST_TO(MultiCurve)
4184 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
4185 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
4186 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
4194 return poGeom->
begin();
4201 return poGeom->
end();
4207 return poGeom->
begin();
4213 return poGeom->
end();
4228 static OGRErr createFromFgfInternal(
const unsigned char *pabyData,
4231 int *pnBytesConsumed,
int nRecLevel);
4236 size_t =
static_cast<size_t>(-1),
4241 size_t &nBytesConsumedOut);
4246 static std::pair<std::unique_ptr<OGRGeometry>,
OGRErr>
4255 CPL_WARN_DEPRECATED(
"Use createFromWkt(const char**, ...) instead")
4257 return createFromWkt(
const_cast<const char **
>(ppszInput), poSRS,
4265 static OGRGeometry *createFromGeoJson(
const char *,
int = -1);
4273 bool bOnlyInOrder =
true);
4280 const char *
const *papszOptions =
nullptr)
4282 CPL_WARN_DEPRECATED(
"Use variant that accepts and returns a "
4283 "std::unique_ptr<OGRGeometry")
4287 static std::unique_ptr<OGRGeometry>
4289 const char *
const *papszOptions =
nullptr);
4291 static std::unique_ptr<OGRGeometry>
4292 makeCompatibleWith(std::unique_ptr<OGRGeometry>,
4297 static std::unique_ptr<OGRGeometry>
4298 organizePolygons(std::vector<std::unique_ptr<OGRGeometry>> &apoPolygons,
4299 bool *pbResultValidGeometry =
nullptr,
4304 int *pbResultValidGeometry,
4307 CPL_WARN_DEPRECATED(
"Use variant that accepts a "
4308 "std::vector<std::unique_ptr<OGRGeometry>>&")
4312 static bool haveGEOS();
4315 class CPL_DLL TransformWithOptionsCache
4317 friend class OGRGeometryFactory;
4319 std::unique_ptr<Private> d;
4322 TransformWithOptionsCache();
4323 ~TransformWithOptionsCache();
4327 static bool isTransformWithOptionsRegularTransform(
4341 double dfPrimaryRadius,
double dfSecondaryAxis,
4342 double dfRotation,
double dfStartAngle,
4343 double dfEndAngle,
double dfMaxAngleStepSizeDegrees,
4344 const bool bUseMaxGap =
false);
4347 double x2,
double y2,
double &R,
double &cx,
4348 double &cy,
double &alpha0,
double &alpha1,
4352 double z1,
double x2,
double y2,
double z2,
int bHasZ,
4353 double dfMaxAngleStepSizeDegrees,
4354 const char *
const *papszOptions =
nullptr);
4357 const char *
const *papszOptions =
nullptr);
4362 bool bCamelCase =
false,
4363 bool bAddZM =
false,
4364 bool bSpaceBeforeZM =
false);
4367typedef struct _OGRPreparedGeometry OGRPreparedGeometry;
4369struct CPL_DLL OGRPreparedGeometryUniquePtrDeleter
4371 void operator()(OGRPreparedGeometry *)
const;
4378typedef std::unique_ptr<OGRPreparedGeometry,
4379 OGRPreparedGeometryUniquePtrDeleter>
The CPLJSONArray class holds JSON object from CPLJSONDocument.
Definition cpl_json.h:60
OGRGeometry visitor interface.
Definition ogr_geometry.h:222
virtual void visit(const OGRCurvePolygon *)=0
Visit OGRCurvePolygon.
virtual void visit(const OGRPolyhedralSurface *)=0
Visit OGRPolyhedralSurface.
virtual void visit(const OGRCompoundCurve *)=0
Visit OGRCompoundCurve.
virtual void visit(const OGRMultiLineString *)=0
Visit OGRMultiLineString.
virtual void visit(const OGRTriangulatedSurface *)=0
Visit OGRTriangulatedSurface.
virtual void visit(const OGRPolygon *)=0
Visit OGRPolygon.
virtual void visit(const OGRMultiPolygon *)=0
Visit OGRMultiPolygon.
virtual ~IOGRConstGeometryVisitor()
Destructor/.
virtual void visit(const OGRTriangle *)=0
Visit OGRTriangle.
virtual void visit(const OGRLineString *)=0
Visit OGRLineString.
virtual void visit(const OGRMultiPoint *)=0
Visit OGRMultiPoint.
virtual void visit(const OGRMultiCurve *)=0
Visit OGRMultiCurve.
virtual void visit(const OGRGeometryCollection *)=0
Visit OGRGeometryCollection.
virtual void visit(const OGRPoint *)=0
Visit OGRPoint.
virtual void visit(const OGRMultiSurface *)=0
Visit OGRMultiSurface.
virtual void visit(const OGRLinearRing *)=0
Visit OGRLinearRing.
virtual void visit(const OGRCircularString *)=0
Visit OGRCircularString.
OGRGeometry visitor interface.
Definition ogr_geometry.h:148
virtual void visit(OGRMultiSurface *)=0
Visit OGRMultiSurface.
virtual void visit(OGRLinearRing *)=0
Visit OGRLinearRing.
virtual void visit(OGRTriangle *)=0
Visit OGRTriangle.
virtual void visit(OGRCircularString *)=0
Visit OGRCircularString.
virtual void visit(OGRPolygon *)=0
Visit OGRPolygon.
virtual void visit(OGRLineString *)=0
Visit OGRLineString.
virtual void visit(OGRCompoundCurve *)=0
Visit OGRCompoundCurve.
virtual void visit(OGRTriangulatedSurface *)=0
Visit OGRTriangulatedSurface.
virtual void visit(OGRPoint *)=0
Visit OGRPoint.
virtual void visit(OGRCurvePolygon *)=0
Visit OGRCurvePolygon.
virtual void visit(OGRGeometryCollection *)=0
Visit OGRGeometryCollection.
virtual void visit(OGRPolyhedralSurface *)=0
Visit OGRPolyhedralSurface.
virtual void visit(OGRMultiPolygon *)=0
Visit OGRMultiPolygon.
virtual ~IOGRGeometryVisitor()
Destructor/.
virtual void visit(OGRMultiLineString *)=0
Visit OGRMultiLineString.
virtual void visit(OGRMultiPoint *)=0
Visit OGRMultiPoint.
virtual void visit(OGRMultiCurve *)=0
Visit OGRMultiCurve.
Concrete representation of a circular string, that is to say a curve made of one or several arc circl...
Definition ogr_geometry.h:1934
OGRCircularString()=default
Create an empty circular string.
OGRCircularString & operator=(const OGRCircularString &other)
Assignment operator.
Definition ogrcircularstring.cpp:52
OGRErr exportToWkb(unsigned char *, const OGRwkbExportOptions *=nullptr) const override
Convert a geometry into well known binary format.
Definition ogrcircularstring.cpp:130
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...
Definition ogrcircularstring.cpp:935
OGRBoolean IsValid(std::string *posReason=nullptr) const override
Test if the geometry is valid.
Definition ogrcircularstring.cpp:716
bool segmentize(double dfMaxLength) override
Modify the geometry such it has no segment longer then the given distance.
Definition ogrcircularstring.cpp:320
virtual OGRErr importFromWkb(const unsigned char *, size_t, OGRwkbVariant, size_t &nBytesConsumedOut) override
Assign geometry from well known binary data.
Definition ogrcircularstring.cpp:105
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2029
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...
Definition ogrcircularstring.cpp:912
OGRCircularString * clone() const override
Make a copy of this object.
Definition ogrcircularstring.cpp:92
void Value(double, OGRPoint *) const override
Fetch point at given distance along curve.
Definition ogrcircularstring.cpp:568
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:2019
virtual std::string exportToWkt(const OGRWktOptions &opts=OGRWktOptions(), OGRErr *err=nullptr) const override
Export a circular string to WKT.
Definition ogrcircularstring.cpp:174
OGRwkbGeometryType getGeometryType() const override
Fetch geometry type.
Definition ogrcircularstring.cpp:65
void getEnvelope(OGREnvelope *psEnvelope) const override
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure.
Definition ogrcircularstring.cpp:298
double get_Length() const override
Returns the length of the curve.
Definition ogrcircularstring.cpp:195
OGRCircularString(const OGRCircularString &other)
Copy constructor.
double get_Area() const override
Get the area of the (closed) curve.
Definition ogrcircularstring.cpp:875
const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition ogrcircularstring.cpp:82
OGRSimpleCurve * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:2013
OGRErr importFromWkt(const char **) override
deprecated
Definition ogrcircularstring.cpp:155
OGRCircularString & operator=(OGRCircularString &&other)=default
Move assignment operator.
virtual OGRGeometry * getLinearGeometry(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const override
Return, possibly approximate, non-curve version of this geometry.
Definition ogrcircularstring.cpp:737
virtual OGRLineString * CurveToLine(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const override
Return a linestring from a curve geometry.
Definition ogrcircularstring.cpp:665
OGRCircularString(OGRCircularString &&other)=default
Move constructor.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2024
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const override
Returns if this geometry is or has curve geometry.
Definition ogrcircularstring.cpp:727
Utility class to store a collection of curves.
Definition ogr_geometry.h:2166
const ChildType *const * end() const
Return end of curve iterator.
Definition ogr_geometry.h:2229
virtual OGRGeometry * getLinearGeometry(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const override
Return, possibly approximate, non-curve version of this geometry.
Definition ogrcompoundcurve.cpp:670
OGRCompoundCurve()=default
Create an empty compound curve.
const ChildType *const * begin() const
Return begin of curve iterator.
Definition ogr_geometry.h:2223
OGRCompoundCurve & operator=(const OGRCompoundCurve &other)
Assignment operator.
Definition ogrcompoundcurve.cpp:43
OGRCompoundCurve(const OGRCompoundCurve &other)
Copy constructor.
bool segmentize(double dfMaxLength) override
Modify the geometry such it has no segment longer then the given distance.
Definition ogrcompoundcurve.cpp:637
OGRPointIterator * getPointIterator() const override
Returns a point iterator over the curve.
Definition ogrcompoundcurve.cpp:745
OGRCurve ChildType
Type of child elements.
Definition ogr_geometry.h:2206
OGRCompoundCurve(OGRCompoundCurve &&other)=default
Move constructor.
OGRCurve * stealCurve(int)
"Steal" reference to curve.
Definition ogrcompoundcurve.cpp:453
void flattenTo2D() override
Convert geometry to strictly 2D.
Definition ogrcompoundcurve.cpp:628
ChildType ** end()
Return end of curve iterator.
Definition ogr_geometry.h:2216
OGRCompoundCurve & operator=(OGRCompoundCurve &&other)=default
Move assignment operator.
static constexpr double DEFAULT_TOLERANCE_EPSILON
Default relative tolerance to assume that the end of the previous curve is equal to the start of the ...
Definition ogr_geometry.h:2301
void reversePoints() override
Reverse point order.
Definition ogrcompoundcurve.cpp:985
ChildType ** begin()
Return begin of curve iterator.
Definition ogr_geometry.h:2210
OGRErr addCurveDirectly(OGRCurve *, double dfToleranceEps=DEFAULT_TOLERANCE_EPSILON)
Add a curve directly to the container.
Definition ogrcompoundcurve.cpp:513
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const override
Returns if this geometry is or has curve geometry.
Definition ogrcompoundcurve.cpp:655
OGRErr transform(OGRCoordinateTransformation *poCT) override
Apply arbitrary coordinate transformation to geometry.
Definition ogrcompoundcurve.cpp:619
OGRwkbGeometryType getGeometryType() const override
Fetch geometry type.
Definition ogrcompoundcurve.cpp:77
const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition ogrcompoundcurve.cpp:94
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2330
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2325
OGRErr addCurve(const OGRCurve *, double dfToleranceEps=DEFAULT_TOLERANCE_EPSILON)
Add a curve to the container.
Definition ogrcompoundcurve.cpp:480
Concrete class representing curve polygons.
Definition ogr_geometry.h:2430
OGRCurvePolygon()=default
Create an empty curve polygon.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2586
OGRCurvePolygon & operator=(OGRCurvePolygon &&other)=default
Move assignment operator.
static OGRPolygon * CastToPolygon(OGRCurvePolygon *poCP)
Convert to polygon.
Definition ogrcurvepolygon.cpp:892
OGRCurve ChildType
Type of child elements.
Definition ogr_geometry.h:2473
OGRCurvePolygon(OGRCurvePolygon &&)=default
Move constructor.
const ChildType *const * end() const
Return end of curve iterator.
Definition ogr_geometry.h:2496
const ChildType *const * begin() const
Return begin of curve iterator.
Definition ogr_geometry.h:2490
OGRCurvePolygon & operator=(const OGRCurvePolygon &other)
Assignment operator.
Definition ogrcurvepolygon.cpp:44
ChildType ** begin()
Return begin of curve iterator.
Definition ogr_geometry.h:2477
ChildType ** end()
Return end of curve iterator.
Definition ogr_geometry.h:2483
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2591
OGRCurvePolygon(const OGRCurvePolygon &)
Copy constructor.
Abstract curve base class for OGRLineString, OGRCircularString and OGRCompoundCurve.
Definition ogr_geometry.h:1291
virtual OGRPointIterator * getPointIterator() const =0
Returns a point iterator over the curve.
int getDimension() const override
Get the dimension of this object.
Definition ogrcurve.cpp:37
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...
virtual int IntersectsPoint(const OGRPoint *p) const
Returns if a point intersects a (closed) curve.
Definition ogrcurve.cpp:439
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:1384
virtual double get_Length() const =0
Returns the length of the curve.
OGRPoint ChildType
Type of child elements.
Definition ogr_geometry.h:1334
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:1376
virtual double get_AreaOfCurveSegments() const =0
Get the area of the purely curve portions of a (closed) curve.
virtual int ContainsPoint(const OGRPoint *p) const
Returns if a point is contained in a (closed) curve.
Definition ogrcurve.cpp:420
virtual int get_IsClosed() const
Return TRUE if curve is closed.
Definition ogrcurve.cpp:60
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.
static OGRLineString * CastToLineString(OGRCurve *poCurve)
Cast to linestring.
Definition ogrcurve.cpp:379
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 int isClockwise() const
Returns TRUE if the ring has clockwise winding (or less than 2 points).
Definition ogrcurve.cpp:723
virtual OGRBoolean IsConvex() const
Returns if a (closed) curve forms a convex shape.
Definition ogrcurve.cpp:305
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.
static OGRLinearRing * CastToLinearRing(OGRCurve *poCurve)
Cast to linear ring.
Definition ogrcurve.cpp:400
OGRGeometry visitor default implementation.
Definition ogr_geometry.h:268
void visit(const OGRPoint *) override
Visit OGRPoint.
Definition ogr_geometry.h:272
OGRGeometry visitor default implementation.
Definition ogr_geometry.h:194
void visit(OGRPoint *) override
Visit OGRPoint.
Definition ogr_geometry.h:198
Simple container for a bounding region in 3D.
Definition ogr_core.h:217
Simple container for a bounding region (rectangle).
Definition ogr_core.h:44
Geometry coordinate precision for a binary representation.
Definition ogr_geometry.h:302
int nXYBitPrecision
Number of bits needed to achieved XY precision.
Definition ogr_geometry.h:304
void SetFrom(const OGRGeomCoordinatePrecision &)
Set binary precision options from resolution.
Definition ogrgeometry.cpp:9180
int nMBitPrecision
Number of bits needed to achieved M precision.
Definition ogr_geometry.h:310
int nZBitPrecision
Number of bits needed to achieved Z precision.
Definition ogr_geometry.h:307
A collection of 1 or more geometry objects.
Definition ogr_geometry.h:2912
ChildType ** end()
Return end of sub-geometry iterator.
Definition ogr_geometry.h:2955
OGRGeometryCollection()=default
Create an empty geometry collection.
virtual OGRBoolean isCompatibleSubType(OGRwkbGeometryType) const
Returns whether a geometry of the specified geometry type can be a member of this collection.
Definition ogrgeometrycollection.cpp:1555
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3055
const ChildType *const * begin() const
Return begin of sub-geometry iterator.
Definition ogr_geometry.h:2962
const ChildType *const * end() const
Return end of sub-geometry iterator.
Definition ogr_geometry.h:2968
ChildType ** begin()
Return begin of sub-geometry iterator.
Definition ogr_geometry.h:2949
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3060
OGRGeometryCollection & operator=(const OGRGeometryCollection &other)
Assignment operator.
Definition ogrgeometrycollection.cpp:95
OGRGeometry * getGeometryRef(int)
Fetch geometry from container.
Definition ogrgeometrycollection.cpp:293
OGRGeometry ChildType
Type of child elements.
Definition ogr_geometry.h:2945
Create geometry objects from well known text/binary.
Definition ogr_geometry.h:4227
static OGRErr createFromWkt(const char *, const OGRSpatialReference *, OGRGeometry **)
Create a geometry object of the appropriate type from its well known text representation.
Definition ogrgeometryfactory.cpp:476
static OGRCurve * curveFromLineString(const OGRLineString *poLS, const char *const *papszOptions=nullptr)
Try to convert a linestring approximating curves into a curve.
Definition ogrgeometryfactory.cpp:6795
static OGRLineString * curveToLineString(double x0, double y0, double z0, double x1, double y1, double z1, double x2, double y2, double z2, int bHasZ, double dfMaxAngleStepSizeDegrees, const char *const *papszOptions=nullptr)
Converts an arc circle into an approximate line string.
Definition ogrgeometryfactory.cpp:6021
static OGRErr createFromWkb(const void *, const OGRSpatialReference *, OGRGeometry **, size_t=static_cast< size_t >(-1), OGRwkbVariant=wkbVariantOldOgc)
Create a geometry object of the appropriate type from its well known binary representation.
Definition ogrgeometryfactory.cpp:91
static OGRGeometry * approximateArcAngles(double dfX, double dfY, double dfZ, double dfPrimaryRadius, double dfSecondaryAxis, double dfRotation, double dfStartAngle, double dfEndAngle, double dfMaxAngleStepSizeDegrees, const bool bUseMaxGap=false)
Stroke arc to linestring.
Definition ogrgeometryfactory.cpp:4751
static int GetCurveParameters(double x0, double y0, double x1, double y1, double x2, double y2, double &R, double &cx, double &cy, double &alpha0, double &alpha1, double &alpha2)
Returns the parameter of an arc circle.
Definition ogrgeometryfactory.cpp:5759
static OGRGeometry * transformWithOptions(const OGRGeometry *poSrcGeom, OGRCoordinateTransformation *poCT, CSLConstList papszOptions, const TransformWithOptionsCache &cache=TransformWithOptionsCache())
Transform a geometry.
Definition ogrgeometryfactory.cpp:4431
static OGRErr createFromWkt(char **ppszInput, const OGRSpatialReference *poSRS, OGRGeometry **ppoGeom)
Deprecated.
Definition ogr_geometry.h:4252
static double GetDefaultArcStepSize()
Return the default value of the angular step used when stroking curves as lines.
Definition ogrgeometryfactory.cpp:4683
Abstract base class for all geometry classes.
Definition ogr_geometry.h:357
const OGRSurface * toSurface() const
Down-cast to OGRSurface*.
Definition ogr_geometry.h:797
static void freeGEOSContext(GEOSContextHandle_t hGEOSCtxt)
Destroy a GEOS context.
Definition ogrgeometry.cpp:3358
const OGRCurvePolygon * toCurvePolygon() const
Down-cast to OGRCurvePolygon*.
Definition ogr_geometry.h:849
virtual void getEnvelope(OGREnvelope *psEnvelope) const =0
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure.
bool IsRectangle() const
Returns whether the geometry is a polygon with 4 corners forming a rectangle.
Definition ogrgeometry.cpp:9300
void roundCoordinates(const OGRGeomCoordinatePrecision &sPrecision)
Round coordinates of the geometry to the specified precision.
Definition ogrgeometry.cpp:6932
const OGRMultiCurve * toMultiCurve() const
Down-cast to OGRMultiCurve*.
Definition ogr_geometry.h:939
virtual OGRGeometry * getCurveGeometry(const char *const *papszOptions=nullptr) const
Return curve version of this geometry.
Definition ogrgeometry.cpp:3788
OGRGeometry * ConstrainedDelaunayTriangulation() const
Return a constrained Delaunay triangulation of the vertices of the given polygon(s).
Definition ogrgeometry.cpp:7192
const OGRPolyhedralSurface * toPolyhedralSurface() const
Down-cast to OGRPolyhedralSurface*.
Definition ogr_geometry.h:975
virtual OGRBoolean Intersects(const OGRGeometry *) const
Do these features intersect?
Definition ogrgeometry.cpp:575
const OGRMultiPoint * toMultiPoint() const
Down-cast to OGRMultiPoint*.
Definition ogr_geometry.h:885
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const
Returns if this geometry is or has curve geometry.
Definition ogrgeometry.cpp:3722
const OGRMultiPolygon * toMultiPolygon() const
Down-cast to OGRMultiPolygon*.
Definition ogr_geometry.h:921
OGRGeometry * ConcaveHullOfPolygons(double dfLengthRatio, bool bIsTight, bool bAllowHoles) const
Compute the concave hull of a set of polygons, respecting the polygons as constraints.
Definition ogrgeometry.cpp:4696
OGRPolyhedralSurface * toPolyhedralSurface()
Down-cast to OGRPolyhedralSurface*.
Definition ogr_geometry.h:966
const OGRMultiSurface * toMultiSurface() const
Down-cast to OGRMultiSurface*.
Definition ogr_geometry.h:957
OGRPoint * toPoint()
Down-cast to OGRPoint*.
Definition ogr_geometry.h:665
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.
virtual bool setCoordinateDimension(int nDimension)
Set the coordinate dimension.
Definition ogrgeometry.cpp:1102
bool operator!=(const OGRGeometry &other) const
Returns if two geometries are different.
Definition ogr_geometry.h:419
OGRTriangle * toTriangle()
Down-cast to OGRTriangle*.
Definition ogr_geometry.h:823
OGRLineString * toLineString()
Down-cast to OGRLineString*.
Definition ogr_geometry.h:718
int CoordinateDimension() const
Get the dimension of the coordinates in this object.
Definition ogrgeometry.cpp:980
const OGRLinearRing * toLinearRing() const
Down-cast to OGRLinearRing*.
Definition ogr_geometry.h:743
OGRGeometry * SetPrecision(double dfGridSize, int nFlags) const
Set the geometry's precision, rounding all its coordinates to the precision grid, and making sure the...
Definition ogrgeometry.cpp:7022
OGRGeometry * SimplifyPreserveTopology(double dTolerance) const
Simplify the geometry while preserving topology.
Definition ogrgeometry.cpp:6854
const OGRPoint * toPoint() const
Down-cast to OGRPoint*.
Definition ogr_geometry.h:673
virtual void swapXY()
Swap x and y coordinates.
Definition ogrgeometry.cpp:7483
virtual void empty()=0
Clear geometry information.
OGRGeometry * Simplify(double dTolerance) const
Simplify the geometry.
Definition ogrgeometry.cpp:6776
OGRBoolean Overlaps(const OGRGeometry *) const
Test for overlap.
Definition ogrgeometry.cpp:6407
virtual OGRBoolean IsEmpty() const =0
Returns TRUE (non-zero) if the object has no points.
OGRGeometry * DelaunayTriangulation(double dfTolerance, int bOnlyEdges) const
Return a Delaunay triangulation of the vertices of the geometry.
Definition ogrgeometry.cpp:7110
virtual int getCoordinateDimension() const
Get the dimension of the coordinates in this object.
Definition ogrgeometry.cpp:962
OGRGeometry * ConcaveHull(double dfRatio, bool bAllowHoles) const
Compute the concave hull of a geometry.
Definition ogrgeometry.cpp:4566
OGRMultiLineString * toMultiLineString()
Down-cast to OGRMultiLineString*.
Definition ogr_geometry.h:894
OGRMultiSurface * toMultiSurface()
Down-cast to OGRMultiSurface*.
Definition ogr_geometry.h:948
static OGRGeometry * FromHandle(OGRGeometryH hGeom)
Convert a OGRGeometryH to a OGRGeometry*.
Definition ogr_geometry.h:657
virtual 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:867
const OGRMultiLineString * toMultiLineString() const
Down-cast to OGRMultiLineString*.
Definition ogr_geometry.h:903
OGRGeometry * Difference(const OGRGeometry *) const
Compute difference.
Definition ogrgeometry.cpp:5752
virtual OGRGeometry * MakeValid(CSLConstList papszOptions=nullptr) const
Attempts to make an invalid geometry valid without losing vertices.
Definition ogrgeometry.cpp:4180
double Distance(const OGRGeometry *) const
Compute distance between two geometries.
Definition ogrgeometry.cpp:3815
virtual bool set3D(OGRBoolean bIs3D)
Add or remove the Z coordinate dimension.
Definition ogrgeometry.cpp:1125
OGRGeometry * UnaryUnion() const
Returns the union of all components of a single geometry.
Definition ogrgeometry.cpp:5648
virtual OGRBoolean Equals(const OGRGeometry *) const =0
Returns TRUE if two geometries are equivalent.
virtual bool setMeasured(OGRBoolean bIsMeasured)
Add or remove the M coordinate dimension.
Definition ogrgeometry.cpp:1149
virtual int getDimension() const =0
Get the dimension of this object.
OGRGeometry * ConvexHull() const
Compute convex hull.
Definition ogrgeometry.cpp:4446
const OGRCircularString * toCircularString() const
Down-cast to OGRCircularString*.
Definition ogr_geometry.h:761
OGRGeometry * Buffer(double dfDist, int nQuadSegs=30) const
Compute buffer of geometry.
Definition ogrgeometry.cpp:4946
const OGRSpatialReference * getSpatialReference(void) const
Returns spatial reference system for object.
Definition ogr_geometry.h:535
OGRGeometry * BuildArea() const
Polygonize a linework assuming inner polygons are holes.
Definition ogrgeometry.cpp:7408
OGRPolygon * toPolygon()
Down-cast to OGRPolygon*.
Definition ogr_geometry.h:806
bool operator==(const OGRGeometry &other) const
Returns if two geometries are equal.
Definition ogr_geometry.h:413
OGRErr Centroid(OGRPoint *poPoint) const
Compute the geometry centroid.
Definition ogrgeometry.cpp:6524
OGRLinearRing * toLinearRing()
Down-cast to OGRLinearRing*.
Definition ogr_geometry.h:735
OGRGeometry * UnionCascaded() const
Compute union using cascading.
Definition ogrgeometry.cpp:5550
OGRBoolean IsMeasured() const
Definition ogr_geometry.h:441
virtual OGRBoolean Within(const OGRGeometry *) const
Test for containment.
Definition ogrgeometry.cpp:6260
OGRGeometry & operator=(const OGRGeometry &other)
Assignment operator.
Definition ogrgeometry.cpp:148
OGRGeometry * Union(const OGRGeometry *) const
Compute union.
Definition ogrgeometry.cpp:5434
OGRGeometry * Polygonize() const
Polygonizes a set of sparse edges.
Definition ogrgeometry.cpp:7282
virtual void accept(IOGRGeometryVisitor *visitor)=0
Accept a visitor.
double Distance3D(const OGRGeometry *poOtherGeom) const
Returns the 3D distance between two geometries.
Definition ogrgeometry.cpp:3945
virtual OGRGeometry * Normalize() const
Attempts to bring geometry into normalized/canonical form.
Definition ogrgeometry.cpp:4366
OGRMultiCurve * toMultiCurve()
Down-cast to OGRMultiCurve*.
Definition ogr_geometry.h:930
const OGRCompoundCurve * toCompoundCurve() const
Down-cast to OGRCompoundCurve*.
Definition ogr_geometry.h:779
virtual bool hasEmptyParts() const
Returns whether a geometry has empty parts/rings.
Definition ogrgeometry.cpp:9352
OGRBoolean Disjoint(const OGRGeometry *) const
Test for disjointness.
Definition ogrgeometry.cpp:6006
OGRGeometry * SymDifference(const OGRGeometry *) const
Compute symmetric difference.
Definition ogrgeometry.cpp:5871
virtual OGRwkbGeometryType getGeometryType() const =0
Fetch geometry type.
OGRGeometryCollection * toGeometryCollection()
Down-cast to OGRGeometryCollection*.
Definition ogr_geometry.h:858
virtual char * exportToKML() const
Convert a geometry into KML format.
Definition ogrgeometry.cpp:3259
OGRGeometry * Boundary() const
Compute boundary.
Definition ogrgeometry.cpp:4822
virtual char * exportToGML(const char *const *papszOptions=nullptr) const
Convert a geometry into GML format.
Definition ogrgeometry.cpp:3236
OGRErr transformTo(const OGRSpatialReference *poSR)
Transform geometry to new spatial reference system.
Definition ogrgeometry.cpp:698
OGRBoolean Touches(const OGRGeometry *) const
Test for touching.
Definition ogrgeometry.cpp:6079
OGRMultiPolygon * toMultiPolygon()
Down-cast to OGRMultiPolygon*.
Definition ogr_geometry.h:912
const OGRPolygon * toPolygon() const
Down-cast to OGRPolygon*.
Definition ogr_geometry.h:815
OGRCompoundCurve * toCompoundCurve()
Down-cast to OGRCompoundCurve*.
Definition ogr_geometry.h:770
OGRErr exportToWkb(OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc) const
Convert a geometry into well known binary format.
Definition ogrgeometry.cpp:1596
OGRwkbGeometryType getIsoGeometryType() const
Get the geometry type that conforms with ISO SQL/MM Part3.
Definition ogrgeometry.cpp:853
OGRErr importFromWkt(char **ppszInput)
Deprecated.
Definition ogr_geometry.h:468
const OGRLineString * toLineString() const
Down-cast to OGRLineString*.
Definition ogr_geometry.h:727
GEOSGeom exportToGEOS(GEOSContextHandle_t hGEOSCtxt, bool bRemoveEmptyParts=false, bool bAddPointsIfNeeded=false) const
Returns a GEOSGeom object corresponding to the geometry.
Definition ogrgeometry.cpp:3561
virtual OGRBoolean IsValid(std::string *posReason=nullptr) const
Test if the geometry is valid.
Definition ogrgeometry.cpp:2284
OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const
Convert a geometry into well known text format.
Definition ogrgeometry.cpp:1968
virtual bool segmentize(double dfMaxLength)
Modify the geometry such it has no segment longer then the given distance.
Definition ogrgeometry.cpp:886
void roundCoordinatesIEEE754(const OGRGeomCoordinateBinaryPrecision &options)
Round coordinates of a geometry, exploiting characteristics of the IEEE-754 double-precision binary r...
Definition ogrgeometry.cpp:8889
virtual size_t WkbSize() const =0
Returns size of related binary representation.
OGRCircularString * toCircularString()
Down-cast to OGRCircularString*.
Definition ogr_geometry.h:752
virtual void removeEmptyParts()
Remove empty parts/rings from this geometry.
Definition ogrgeometry.cpp:9366
const OGRCurve * toCurve() const
Down-cast to OGRCurve*.
Definition ogr_geometry.h:691
virtual OGRGeometry * getLinearGeometry(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const
Return, possibly approximate, non-curve version of this geometry.
Definition ogrgeometry.cpp:3754
OGRCurvePolygon * toCurvePolygon()
Down-cast to OGRCurvePolygon*.
Definition ogr_geometry.h:840
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:709
static GEOSContextHandle_t createGEOSContext()
Create a new GEOS context.
Definition ogrgeometry.cpp:3341
OGRBoolean Crosses(const OGRGeometry *) const
Test for crossing.
Definition ogrgeometry.cpp:6153
OGRErr importFromWkb(const GByte *, size_t=static_cast< size_t >(-1), OGRwkbVariant=wkbVariantOldOgc)
Assign geometry from well known binary data.
Definition ogrgeometry.cpp:1501
OGRGeometry * Intersection(const OGRGeometry *) const
Compute intersection.
Definition ogrgeometry.cpp:5315
static OGRGeometryH ToHandle(OGRGeometry *poGeom)
Convert a OGRGeometry* to a OGRGeometryH.
Definition ogr_geometry.h:650
virtual OGRBoolean Contains(const OGRGeometry *) const
Test for containment.
Definition ogrgeometry.cpp:6333
void dumpReadable(FILE *, const char *=nullptr, CSLConstList papszOptions=nullptr) const
Dump geometry in well known text format to indicated output file.
Definition ogrgeometry.cpp:201
OGRBoolean Is3D() const
Definition ogr_geometry.h:435
OGRMultiPoint * toMultiPoint()
Down-cast to OGRMultiPoint*.
Definition ogr_geometry.h:876
virtual const char * getGeometryName() const =0
Fetch WKT name for geometry type.
virtual void closeRings()
Force rings to be closed.
Definition ogrgeometry.cpp:6468
const OGRTriangulatedSurface * toTriangulatedSurface() const
Down-cast to OGRTriangulatedSurface*.
Definition ogr_geometry.h:991
const OGRTriangle * toTriangle() const
Down-cast to OGRTriangle*.
Definition ogr_geometry.h:831
virtual char * exportToJson(CSLConstList papszOptions=nullptr) const
Convert a geometry into GeoJSON format.
Definition ogrgeometry.cpp:3290
OGRSurface * toSurface()
Down-cast to OGRSurface*.
Definition ogr_geometry.h:788
virtual void assignSpatialReference(const OGRSpatialReference *poSR)
Assign spatial reference to this object.
Definition ogrgeometry.cpp:505
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:700
OGRTriangulatedSurface * toTriangulatedSurface()
Down-cast to OGRTriangulatedSurface*.
Definition ogr_geometry.h:983
virtual std::string exportToWkt(const OGRWktOptions &opts=OGRWktOptions(), OGRErr *err=nullptr) const =0
Export a WKT geometry.
OGRCurve * toCurve()
Down-cast to OGRCurve*.
Definition ogr_geometry.h:682
OGRGeometry * BufferEx(double dfDist, CSLConstList papszOptions) const
Compute buffer of geometry.
Definition ogrgeometry.cpp:5057
virtual OGRBoolean IsSimple() const
Test if the geometry is simple.
Definition ogrgeometry.cpp:2513
Definition ogr_geometry.h:1440
void setZ(double zIn)
Set z.
Definition ogrcurve.cpp:492
void setY(double yIn)
Set y.
Definition ogrcurve.cpp:486
void setM(double mIn)
Set m.
Definition ogrcurve.cpp:498
~OGRIteratedPoint() override
Destructor.
void setX(double xIn)
Set x.
Definition ogrcurve.cpp:480
Concrete representation of a multi-vertex line.
Definition ogr_geometry.h:1739
virtual double get_GeodesicLength(const OGRSpatialReference *poSRSOverride=nullptr) const override
Get the length of the curve, considered as a geodesic line on the underlying ellipsoid of the SRS att...
OGRSimpleCurve * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:1783
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:1799
const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition ogrlinestring.cpp:2957
OGRLineString & operator=(const OGRLineString &other)
Assignment operator.
Definition ogrlinestring.cpp:2908
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...
virtual OGRLineString * CurveToLine(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const override
Return a linestring from a curve geometry.
Definition ogrlinestring.cpp:2967
int isClockwise() const override
Returns TRUE if the ring has clockwise winding (or less than 2 points).
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:1794
OGRwkbGeometryType getGeometryType() const override
Fetch geometry type.
Definition ogrlinestring.cpp:2940
virtual OGRGeometry * getCurveGeometry(const char *const *papszOptions=nullptr) const override
Return curve version of this geometry.
Definition ogrlinestring.cpp:3019
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:1789
OGRLineString()=default
Create an empty line string.
static OGRLinearRing * CastToLinearRing(OGRLineString *poLS)
Cast to linear ring.
Definition ogrlinestring.cpp:3065
OGRLineString * clone() const override
Make a copy of this object.
Definition ogrlinestring.cpp:3083
Concrete representation of a closed ring.
Definition ogr_geometry.h:1833
OGRLineString * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:1893
static OGRLineString * CastToLineString(OGRLinearRing *poLR)
Cast to line string.
Definition ogrlinearring.cpp:648
OGRLinearRing()=default
Constructor.
OGRLinearRing * clone() const override
Make a copy of this object.
Definition ogrlinearring.cpp:396
OGRLinearRing & operator=(OGRLinearRing &&other)=default
Move assignment operator.
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:1909
const OGRLineString * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:1899
const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition ogrlinearring.cpp:88
OGRLinearRing(const OGRLinearRing &other)
Copy constructor.
OGRLinearRing & operator=(const OGRLinearRing &other)
Assignment operator.
Definition ogrlinearring.cpp:75
OGRErr transform(OGRCoordinateTransformation *poCT) override
Apply arbitrary coordinate transformation to geometry.
Definition ogrlinearring.cpp:612
void closeRings() override
Force rings to be closed.
Definition ogrlinearring.cpp:427
OGRLinearRing(OGRLinearRing &&other)=default
Move constructor.
OGRBoolean isPointOnRingBoundary(const OGRPoint *pt, int bTestEnvelope=TRUE) const
Returns whether the point is on the ring boundary.
Definition ogrlinearring.cpp:533
OGRBoolean isPointInRing(const OGRPoint *pt, int bTestEnvelope=TRUE) const
Returns whether the point is inside the ring.
Definition ogrlinearring.cpp:452
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:1904
A collection of OGRCurve.
Definition ogr_geometry.h:3917
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3955
OGRMultiCurve()=default
Create an empty multi curve collection.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3961
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3948
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:4026
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:4016
OGRMultiCurve & operator=(OGRMultiCurve &&other)=default
Move assignment operator.
const OGRCurve * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef().
Definition ogr_geometry.h:3975
OGRCurve * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef().
Definition ogr_geometry.h:3969
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:4021
OGRMultiCurve(const OGRMultiCurve &other)
Copy constructor.
OGRMultiCurve & operator=(const OGRMultiCurve &other)
Assignment operator.
Definition ogrmulticurve.cpp:41
OGRCurve ChildType
Type of child elements.
Definition ogr_geometry.h:3938
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3942
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:4010
OGRMultiCurve(OGRMultiCurve &&other)=default
Move constructor.
OGRBoolean isCompatibleSubType(OGRwkbGeometryType) const override
Returns whether a geometry of the specified geometry type can be a member of this collection.
Definition ogrmulticurve.cpp:111
A collection of OGRLineString.
Definition ogr_geometry.h:4076
OGRMultiLineString & operator=(const OGRMultiLineString &other)
Assignment operator.
Definition ogrmultilinestring.cpp:42
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:4175
OGRLineString ChildType
Type of child elements.
Definition ogr_geometry.h:4093
OGRLineString * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef().
Definition ogr_geometry.h:4124
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:4159
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:4103
OGRMultiLineString()=default
Create an empty multi line string collection.
OGRBoolean isCompatibleSubType(OGRwkbGeometryType) const override
Returns whether a geometry of the specified geometry type can be a member of this collection.
Definition ogrmultilinestring.cpp:102
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:4116
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:4110
OGRMultiLineString(OGRMultiLineString &&other)=default
Move constructor.
const OGRLineString * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef().
Definition ogr_geometry.h:4130
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:4097
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:4165
OGRMultiLineString & operator=(OGRMultiLineString &&other)=default
Move assignment operator.
OGRMultiLineString(const OGRMultiLineString &other)
Copy constructor.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:4170
A collection of OGRPoint.
Definition ogr_geometry.h:3759
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3847
OGRMultiPoint & operator=(OGRMultiPoint &&other)=default
Move assignment operator.
OGRMultiPoint()=default
Create an empty multi point collection.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3802
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3783
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3863
OGRMultiPoint(const OGRMultiPoint &other)
Copy constructor.
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3796
OGRMultiPoint(OGRMultiPoint &&other)=default
Move constructor.
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3853
OGRPoint ChildType
Type of child elements.
Definition ogr_geometry.h:3779
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3858
const OGRPoint * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef().
Definition ogr_geometry.h:3816
OGRMultiPoint & operator=(const OGRMultiPoint &other)
Assignment operator.
Definition ogrmultipoint.cpp:46
OGRPoint * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef().
Definition ogr_geometry.h:3810
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3789
OGRBoolean isCompatibleSubType(OGRwkbGeometryType) const override
Returns whether a geometry of the specified geometry type can be a member of this collection.
Definition ogrmultipoint.cpp:107
A collection of non-overlapping OGRPolygon.
Definition ogr_geometry.h:3273
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3377
OGRPolygon ChildType
Type of child elements.
Definition ogr_geometry.h:3300
OGRMultiPolygon(const OGRMultiPolygon &other)
Copy constructor.
OGRMultiPolygon & operator=(OGRMultiPolygon &&other)=default
Move assignment operator.
OGRPolygon * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef().
Definition ogr_geometry.h:3331
OGRMultiPolygon()=default
Create an empty multi polygon collection.
const OGRPolygon * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef().
Definition ogr_geometry.h:3337
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3323
OGRMultiPolygon & operator=(const OGRMultiPolygon &other)
Assignment operator.
Definition ogrmultipolygon.cpp:39
OGRBoolean isCompatibleSubType(OGRwkbGeometryType) const override
Returns whether a geometry of the specified geometry type can be a member of this collection.
Definition ogrmultipolygon.cpp:99
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3310
OGRMultiPolygon(OGRMultiPolygon &&other)=default
Move constructor.
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3304
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3366
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3317
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3382
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3372
A collection of non-overlapping OGRSurface.
Definition ogr_geometry.h:3113
const OGRSurface * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef().
Definition ogr_geometry.h:3195
OGRMultiSurface & operator=(OGRMultiSurface &&other)=default
Move assignment operator.
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3134
OGRSurface ChildType
Type of child elements.
Definition ogr_geometry.h:3130
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3211
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3147
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3153
OGRBoolean isCompatibleSubType(OGRwkbGeometryType) const override
Returns whether a geometry of the specified geometry type can be a member of this collection.
Definition ogrmultisurface.cpp:112
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3221
OGRMultiSurface(const OGRMultiSurface &other)
Copy constructor.
OGRMultiSurface & operator=(const OGRMultiSurface &other)
Assignment operator.
Definition ogrmultisurface.cpp:42
OGRMultiSurface()=default
Create an empty multi surface collection.
OGRMultiSurface(OGRMultiSurface &&other)=default
Move constructor.
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3140
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3216
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3205
OGRSurface * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef().
Definition ogr_geometry.h:3189
Interface for a point iterator.
Definition ogr_geometry.h:1273
virtual OGRBoolean getNextPoint(OGRPoint *p)=0
Returns the next point followed by the iterator.
static void destroy(OGRPointIterator *)
Destroys a point iterator.
Definition ogrcurve.cpp:469
Point class.
Definition ogr_geometry.h:1108
double getM() const
Return m.
Definition ogr_geometry.h:1184
void setX(double xIn)
Set x.
Definition ogr_geometry.h:1195
OGRPoint & operator=(const OGRPoint &other)
Assignment operator.
Definition ogrpoint.cpp:141
OGRErr importFromWkt(const char **) override
deprecated
Definition ogrpoint.cpp:475
static OGRPoint * createXYM(double x, double y, double m)
Create a XYM point.
Definition ogrpoint.cpp:116
OGRPoint(const OGRPoint &other)
Copy constructor.
OGRPoint & operator=(OGRPoint &&other)=default
Move assignment operator.
void setZ(double zIn)
Set z.
Definition ogr_geometry.h:1219
void setM(double mIn)
Set m.
Definition ogr_geometry.h:1228
int getDimension() const override
Get the dimension of this object.
Definition ogrpoint.cpp:187
double getX() const
Return x.
Definition ogr_geometry.h:1166
void empty() override
Clear geometry information.
Definition ogrpoint.cpp:173
OGRErr exportToWkb(unsigned char *, const OGRwkbExportOptions *=nullptr) const override
Convert a geometry into well known binary format.
Definition ogrpoint.cpp:355
OGRPoint * clone() const override
Make a copy of this object.
Definition ogrpoint.cpp:164
OGRPoint()
Create an empty point.
Definition ogrpoint.cpp:48
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:1245
OGRBoolean IsEmpty() const override
Returns TRUE (non-zero) if the object has no points.
Definition ogr_geometry.h:1159
size_t WkbSize() const override
Returns size of related binary representation.
Definition ogrpoint.cpp:256
void setY(double yIn)
Set y.
Definition ogr_geometry.h:1207
double getZ() const
Return z.
Definition ogr_geometry.h:1178
void getEnvelope(OGREnvelope *psEnvelope) const override
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure.
Definition ogrpoint.cpp:587
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:1250
double getY() const
Return y.
Definition ogr_geometry.h:1172
OGRPoint(OGRPoint &&other)=default
Move constructor.
virtual std::string exportToWkt(const OGRWktOptions &opts=OGRWktOptions(), OGRErr *err=nullptr) const override
Export a point to WKT.
Definition ogrpoint.cpp:561
OGRErr importFromWkb(const unsigned char *, size_t, OGRwkbVariant, size_t &nBytesConsumedOut) override
Assign geometry from well known binary data.
Definition ogrpoint.cpp:274
Concrete class representing polygons.
Definition ogr_geometry.h:2648
OGRPolygon & operator=(OGRPolygon &&other)=default
Move assignment operator.
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2784
OGRLinearRing ChildType
Type of child elements.
Definition ogr_geometry.h:2688
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:2692
OGRPolygon(OGRPolygon &&other)=default
Move constructor.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2779
const OGRCurvePolygon * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:2774
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:2698
OGRPolygon(const OGRPolygon &other)
Copy constructor.
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:2705
OGRPolygon & operator=(const OGRPolygon &other)
Assignment operator.
Definition ogrpolygon.cpp:85
OGRPolygon()=default
Create an empty polygon.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:2711
OGRCurvePolygon * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:2768
PolyhedralSurface class.
Definition ogr_geometry.h:3432
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3474
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3487
OGRPolyhedralSurface(const OGRPolyhedralSurface &other)
Copy constructor.
OGRPolygon * getGeometryRef(int i)
Fetch geometry from container.
Definition ogrpolyhedralsurface.cpp:862
OGRPolyhedralSurface & operator=(const OGRPolyhedralSurface &other)
Assignment operator.
Definition ogrpolyhedralsurface.cpp:44
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3481
OGRPolyhedralSurface(OGRPolyhedralSurface &&other)=default
Move constructor.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3560
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3468
OGRPolyhedralSurface()=default
Create an empty PolyhedralSurface.
virtual OGRErr addGeometry(const OGRGeometry *)
Add a new geometry to a collection.
Definition ogrpolyhedralsurface.cpp:744
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3565
OGRPolygon ChildType
Type of child elements.
Definition ogr_geometry.h:3464
OGRPolyhedralSurface & operator=(OGRPolyhedralSurface &&other)=default
Move assignment operator.
Simple container for a position.
Definition ogr_geometry.h:89
OGRRawPoint(double xIn, double yIn)
Constructor.
Definition ogr_geometry.h:97
double x
x
Definition ogr_geometry.h:102
double y
y
Definition ogr_geometry.h:104
OGRRawPoint()
Constructor.
Definition ogr_geometry.h:92
Abstract curve base class for OGRLineString and OGRCircularString.
Definition ogr_geometry.h:1486
double getY(int i) const
Get Y at vertex.
Definition ogr_geometry.h:1639
double getX(int i) const
Get X at vertex.
Definition ogr_geometry.h:1634
size_t WkbSize() const override
Returns size of related binary representation.
Definition ogrlinestring.cpp:216
virtual double get_LinearArea() const
Compute area of ring / closed linestring.
Definition ogrlinestring.cpp:2989
virtual double Project(const OGRPoint *) const
Project point on linestring.
Definition ogrlinestring.cpp:2184
virtual OGRLineString * getSubLine(double, double, int) const
Get the portion of linestring.
Definition ogrlinestring.cpp:2237
OGRSimpleCurve()=default
Constructor.
OGRErr importFromWkt(const char **) override
deprecated
Definition ogrlinestring.cpp:1897
void Value(double, OGRPoint *) const override
Fetch point at given distance along curve.
Definition ogrlinestring.cpp:2119
virtual OGRErr exportToWkb(unsigned char *, const OGRwkbExportOptions *=nullptr) const override
Convert a geometry into well known binary format.
Definition ogrlinestring.cpp:1768
OGRSimpleCurve * clone() const override=0
Make a copy of this object.
OGRPoint ChildType
Type of child elements.
Definition ogr_geometry.h:1563
void EndPoint(OGRPoint *) const override
Return the curve end point.
Definition ogrlinestring.cpp:2107
void getEnvelope(OGREnvelope *psEnvelope) const override
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure.
Definition ogrlinestring.cpp:2424
virtual OGRErr importFromWkb(const unsigned char *, size_t, OGRwkbVariant, size_t &nBytesConsumedOut) override
Assign geometry from well known binary data.
Definition ogrlinestring.cpp:1656
double get_Length() const override
Returns the length of the curve.
Definition ogrlinestring.cpp:2077
void StartPoint(OGRPoint *) const override
Return the curve start point.
Definition ogrlinestring.cpp:2097
virtual std::string exportToWkt(const OGRWktOptions &opts=OGRWktOptions(), OGRErr *err=nullptr) const override
Export a simple curve to WKT.
Definition ogrlinestring.cpp:2020
void empty() override
Clear geometry information.
Definition ogrlinestring.cpp:168
int getNumPoints() const override
Fetch vertex count.
Definition ogr_geometry.h:1627
OGRBoolean IsEmpty() const override
Returns TRUE (non-zero) if the object has no points.
Definition ogrlinestring.cpp:2639
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition ogr_spatialref.h:152
Abstract base class for 2 dimensional objects like polygons or curve polygons.
Definition ogr_geometry.h:2383
virtual double get_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.
virtual OGRErr PointOnSurface(OGRPoint *poPoint) const
This method relates to the SFCOM ISurface::get_PointOnSurface() method.
Definition ogrsurface.cpp:81
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:2832
OGRTriangle()=default
Constructor.
OGRwkbGeometryType getGeometryType() const override
Fetch geometry type.
Definition ogrtriangle.cpp:128
const OGRPolygon * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:2877
virtual OGRErr importFromWkb(const unsigned char *, size_t, OGRwkbVariant, size_t &nBytesConsumedOut) override
Assign geometry from well known binary data.
Definition ogrtriangle.cpp:155
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2887
OGRErr addRingDirectly(OGRCurve *poNewRing) override
Add a ring to a polygon.
Definition ogrtriangle.cpp:208
OGRTriangle(OGRTriangle &&other)=default
Move constructor.
OGRPolygon * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:2871
OGRTriangle & operator=(OGRTriangle &&other)=default
Move assignment operator.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2882
OGRTriangle(const OGRTriangle &other)
Copy constructor.
OGRTriangle * clone() const override
Make a copy of this object.
Definition ogrtriangle.cpp:109
OGRTriangle & operator=(const OGRTriangle &other)
Assignment operator.
Definition ogrtriangle.cpp:96
const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition ogrtriangle.cpp:119
TriangulatedSurface class.
Definition ogr_geometry.h:3616
const OGRTriangle * getGeometryRef(int i) const
See OGRPolyhedralSurface::getGeometryRef().
Definition ogr_geometry.h:3680
OGRTriangle * getGeometryRef(int i)
See OGRPolyhedralSurface::getGeometryRef().
Definition ogr_geometry.h:3674
OGRTriangulatedSurface & operator=(const OGRTriangulatedSurface &other)
Assignment operator.
Definition ogrtriangulatedsurface.cpp:44
OGRTriangulatedSurface(OGRTriangulatedSurface &&other)=default
Move constructor.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3664
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3658
OGRPolyhedralSurface * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3693
const OGRPolyhedralSurface * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3699
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3709
OGRTriangulatedSurface & operator=(OGRTriangulatedSurface &&other)=default
Move assignment operator.
OGRTriangle ChildType
Type of child elements.
Definition ogr_geometry.h:3641
OGRTriangulatedSurface()=default
Constructor.
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3645
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3651
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3704
Options for formatting WKT output.
Definition ogr_geometry.h:46
int mPrecision
Precision of output for M coordinates. Interpretation depends on format.
Definition ogr_geometry.h:55
OGRwkbVariant variant
Type of WKT output to produce.
Definition ogr_geometry.h:49
int zPrecision
Precision of output for Z coordinates. Interpretation depends on format.
Definition ogr_geometry.h:53
OGRWktOptions()
Constructor.
Definition ogr_geometry.h:62
static bool getDefaultRound()
Return default rounding mode.
Definition ogrgeometry.cpp:87
OGRWktOptions(const OGRWktOptions &)=default
Copy constructor.
int xyPrecision
Precision of output for X,Y coordinates. Interpretation depends on format.
Definition ogr_geometry.h:51
static int getDefaultPrecision()
Return default precision.
Definition ogrgeometry.cpp:82
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
OGRWktFormat format
Formatting type.
Definition ogr_geometry.h:59
Various convenience functions for CPL.
To down_cast(From *f)
Use cpl::down_cast<Derived*>(pointer_to_base) as equivalent of static_cast<Derived*>(pointer_to_base)...
Definition cpl_conv.h:507
Interface for read and write JSON documents.
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition cpl_port.h:1101
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1252
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition cpl_port.h:1035
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:165
Forward definitions of GDAL/OGR/OSR C handle types.
void * OGRGeometryH
Opaque type for a geometry.
Definition gdal_fwd.h:96
struct OGRwkbExportOptions OGRwkbExportOptions
Opaque type for WKB export options.
Definition gdal_fwd.h:106
Core portability services for cross-platform OGR code.
int OGRBoolean
Type for a OGR boolean.
Definition ogr_core.h:404
OGRwkbByteOrder
Enumeration to describe byte order.
Definition ogr_core.h:625
@ wkbNDR
LSB/Intel/Vax: Least Significant Byte First.
Definition ogr_core.h:627
OGRwkbVariant
Output variants of WKB we support.
Definition ogr_core.h:558
@ wkbVariantOldOgc
Old-style 99-402 extended dimension (Z) WKB types.
Definition ogr_core.h:559
OGRwkbGeometryType
List of well known binary geometry types.
Definition ogr_core.h:423
int OGRErr
Type for a OGR error.
Definition ogr_core.h:388
Geometry coordinate precision class.
const char * OGRToOGCGeomType(OGRwkbGeometryType eGeomType, bool bCamelCase=false, bool bAddZM=false, bool bSpaceBeforeZM=false)
Map OGR geometry format constants to corresponding OGC geometry type.
Definition ogrgeometry.cpp:2725
OGRWktFormat
WKT Output formatting options.
Definition ogr_geometry.h:38
@ Default
Format as F when abs(value) < 1, otherwise as G.
Definition ogr_geometry.h:41
@ F
F-type formatting.
Definition ogr_geometry.h:39
@ G
G-type formatting.
Definition ogr_geometry.h:40
std::unique_ptr< OGRPreparedGeometry, OGRPreparedGeometryUniquePtrDeleter > OGRPreparedGeometryUniquePtr
Unique pointer type for OGRPreparedGeometry.
Definition ogr_geometry.h:4380
struct GEOSContextHandle_HS * GEOSContextHandle_t
GEOS context handle type.
Definition ogr_geometry.h:110
OGRwkbGeometryType OGRFromOGCGeomType(const char *pszGeomType)
Map OGC geometry format type to corresponding OGR constants.
Definition ogrgeometry.cpp:2646
std::unique_ptr< OGRGeometry, OGRGeometryUniquePtrDeleter > OGRGeometryUniquePtr
Unique pointer type for OGRGeometry.
Definition ogr_geometry.h:1008
struct GEOSGeom_t * GEOSGeom
GEOS geometry type.
Definition ogr_geometry.h:108
void sfcgal_geometry_t
SFCGAL geometry type.
Definition ogr_geometry.h:112
Coordinate systems services.
OGRLayer::FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition ogrsf_frmts.h:478
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition ogrsf_frmts.h:486
Geometry coordinate precision.
Definition ogr_geomcoordinateprecision.h:40
WKB export options.
Definition ogr_geometry.h:326
OGRwkbByteOrder eByteOrder
Byte order.
Definition ogr_geometry.h:327
OGRwkbVariant eWkbVariant
WKB variant.
Definition ogr_geometry.h:328
OGRGeomCoordinateBinaryPrecision sPrecision
Binary precision.
Definition ogr_geometry.h:329