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,
560 virtual
double Distance(const OGRGeometry *) const;
562 virtual OGRGeometry *
564 virtual OGRGeometry *
566 virtual OGRGeometry *
569 virtual OGRGeometry *
571 virtual OGRGeometry *
575 virtual OGRGeometry *
577 virtual OGRGeometry *
580 virtual OGRGeometry *
584 virtual OGRGeometry *
587 virtual OGRGeometry *
593 virtual
double Distance3D(const OGRGeometry *poOtherGeom) const;
595 OGRGeometry *
SetPrecision(
double dfGridSize,
int nFlags) const;
603 CPL_WARN_DEPRECATED(
"Non standard method. "
604 "Use Intersects() instead");
606 CPL_WARN_DEPRECATED(
"Non standard method. "
607 "Use Equals() instead");
608 OGRGeometry *SymmetricDifference(const OGRGeometry *) const
609 CPL_WARN_DEPRECATED(
"Non standard method. "
610 "Use SymDifference() instead");
611 OGRGeometry *getBoundary() const
612 CPL_WARN_DEPRECATED(
"Non standard method. "
613 "Use Boundary() instead");
618 static
int bGenerate_DB2_V72_BYTE_ORDER;
626 static OGRGeometry *CastToIdentity(OGRGeometry *poGeom)
646 return reinterpret_cast<OGRGeometry *
>(hGeom);
985struct CPL_DLL OGRGeometryUniquePtrDeleter
987 void operator()(OGRGeometry *)
const;
994typedef std::unique_ptr<OGRGeometry, OGRGeometryUniquePtrDeleter>
998#define OGR_FORBID_DOWNCAST_TO(name) \
999 inline OGR##name *to##name() = delete; \
1000 inline const OGR##name *to##name() const = delete;
1002#define OGR_FORBID_DOWNCAST_TO_POINT OGR_FORBID_DOWNCAST_TO(Point)
1003#define OGR_FORBID_DOWNCAST_TO_CURVE OGR_FORBID_DOWNCAST_TO(Curve)
1004#define OGR_FORBID_DOWNCAST_TO_SIMPLE_CURVE OGR_FORBID_DOWNCAST_TO(SimpleCurve)
1005#define OGR_FORBID_DOWNCAST_TO_LINESTRING OGR_FORBID_DOWNCAST_TO(LineString)
1006#define OGR_FORBID_DOWNCAST_TO_LINEARRING OGR_FORBID_DOWNCAST_TO(LinearRing)
1007#define OGR_FORBID_DOWNCAST_TO_CIRCULARSTRING \
1008 OGR_FORBID_DOWNCAST_TO(CircularString)
1009#define OGR_FORBID_DOWNCAST_TO_COMPOUNDCURVE \
1010 OGR_FORBID_DOWNCAST_TO(CompoundCurve)
1011#define OGR_FORBID_DOWNCAST_TO_SURFACE OGR_FORBID_DOWNCAST_TO(Surface)
1012#define OGR_FORBID_DOWNCAST_TO_CURVEPOLYGON OGR_FORBID_DOWNCAST_TO(CurvePolygon)
1013#define OGR_FORBID_DOWNCAST_TO_POLYGON OGR_FORBID_DOWNCAST_TO(Polygon)
1014#define OGR_FORBID_DOWNCAST_TO_TRIANGLE OGR_FORBID_DOWNCAST_TO(Triangle)
1015#define OGR_FORBID_DOWNCAST_TO_MULTIPOINT OGR_FORBID_DOWNCAST_TO(MultiPoint)
1016#define OGR_FORBID_DOWNCAST_TO_MULTICURVE OGR_FORBID_DOWNCAST_TO(MultiCurve)
1017#define OGR_FORBID_DOWNCAST_TO_MULTILINESTRING \
1018 OGR_FORBID_DOWNCAST_TO(MultiLineString)
1019#define OGR_FORBID_DOWNCAST_TO_MULTISURFACE OGR_FORBID_DOWNCAST_TO(MultiSurface)
1020#define OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON OGR_FORBID_DOWNCAST_TO(MultiPolygon)
1021#define OGR_FORBID_DOWNCAST_TO_GEOMETRYCOLLECTION \
1022 OGR_FORBID_DOWNCAST_TO(GeometryCollection)
1023#define OGR_FORBID_DOWNCAST_TO_POLYHEDRALSURFACE \
1024 OGR_FORBID_DOWNCAST_TO(PolyhedralSurface)
1025#define OGR_FORBID_DOWNCAST_TO_TIN OGR_FORBID_DOWNCAST_TO(TriangulatedSurface)
1027#define OGR_ALLOW_UPCAST_TO(name) \
1028 inline OGR##name *to##name() \
1032 inline const OGR##name *to##name() const \
1037#ifndef SUPPRESS_OGR_ALLOW_CAST_TO_THIS_WARNING
1038#define CAST_TO_THIS_WARNING CPL_WARN_DEPRECATED("Casting to this is useless")
1040#define CAST_TO_THIS_WARNING
1043#define OGR_ALLOW_CAST_TO_THIS(name) \
1044 inline OGR##name *to##name() CAST_TO_THIS_WARNING \
1048 inline const OGR##name *to##name() const CAST_TO_THIS_WARNING \
1053#define OGR_FORBID_DOWNCAST_TO_ALL_CURVES \
1054 OGR_FORBID_DOWNCAST_TO_CURVE \
1055 OGR_FORBID_DOWNCAST_TO_SIMPLE_CURVE \
1056 OGR_FORBID_DOWNCAST_TO_LINESTRING \
1057 OGR_FORBID_DOWNCAST_TO_LINEARRING \
1058 OGR_FORBID_DOWNCAST_TO_CIRCULARSTRING \
1059 OGR_FORBID_DOWNCAST_TO_COMPOUNDCURVE
1061#define OGR_FORBID_DOWNCAST_TO_ALL_SURFACES \
1062 OGR_FORBID_DOWNCAST_TO_SURFACE \
1063 OGR_FORBID_DOWNCAST_TO_CURVEPOLYGON \
1064 OGR_FORBID_DOWNCAST_TO_POLYGON \
1065 OGR_FORBID_DOWNCAST_TO_TRIANGLE \
1066 OGR_FORBID_DOWNCAST_TO_POLYHEDRALSURFACE \
1067 OGR_FORBID_DOWNCAST_TO_TIN
1069#define OGR_FORBID_DOWNCAST_TO_ALL_SINGLES \
1070 OGR_FORBID_DOWNCAST_TO_POINT \
1071 OGR_FORBID_DOWNCAST_TO_ALL_CURVES \
1072 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1074#define OGR_FORBID_DOWNCAST_TO_ALL_MULTI \
1075 OGR_FORBID_DOWNCAST_TO_GEOMETRYCOLLECTION \
1076 OGR_FORBID_DOWNCAST_TO_MULTIPOINT \
1077 OGR_FORBID_DOWNCAST_TO_MULTICURVE \
1078 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING \
1079 OGR_FORBID_DOWNCAST_TO_MULTISURFACE \
1080 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
1104 OGRPoint(
double x,
double y,
double z);
1105 OGRPoint(
double x,
double y,
double z,
double m);
1116 size_t WkbSize()
const override;
1118 size_t &nBytesConsumedOut)
override;
1137 OGRErr *err =
nullptr)
const override;
1142 void empty()
override;
1148 return !(flags & OGR_G_NOT_EMPTY_POINT);
1177 bool setCoordinateDimension(
int nDimension)
override;
1185 if (std::isnan(x) || std::isnan(y))
1186 flags &= ~OGR_G_NOT_EMPTY_POINT;
1188 flags |= OGR_G_NOT_EMPTY_POINT;
1197 if (std::isnan(x) || std::isnan(y))
1198 flags &= ~OGR_G_NOT_EMPTY_POINT;
1200 flags |= OGR_G_NOT_EMPTY_POINT;
1218 flags |= OGR_G_MEASURED;
1227 const char *getGeometryName()
const override;
1230 void flattenTo2D()
override;
1234 visitor->
visit(
this);
1239 visitor->
visit(
this);
1242 void swapXY()
override;
1244 OGR_ALLOW_CAST_TO_THIS(Point)
1245 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
1246 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1247 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
1285 virtual OGRCurveCasterToLineString GetCasterToLineString()
const = 0;
1286 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const = 0;
1296 class CPL_DLL ConstIterator
1299 std::unique_ptr<Private> m_poPrivate;
1302 ConstIterator(
const OGRCurve *poSelf,
bool bStart);
1303 ConstIterator(ConstIterator &&oOther)
noexcept;
1304 ConstIterator &
operator=(ConstIterator &&oOther);
1307 ConstIterator &operator++();
1308 bool operator!=(
const ConstIterator &it)
const;
1312 friend inline ConstIterator
end(
const OGRCurve *);
1330 ConstIterator
begin()
const;
1332 ConstIterator
end()
const;
1345 const char *
const *papszOptions =
nullptr)
const = 0;
1380 OGR_FORBID_DOWNCAST_TO_POINT
1381 OGR_ALLOW_CAST_TO_THIS(Curve)
1382 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1383 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
1388inline OGRCurve::ConstIterator
begin(
const OGRCurve *poCurve)
1390 return poCurve->begin();
1394inline OGRCurve::ConstIterator
end(
const OGRCurve *poCurve)
1396 return poCurve->end();
1429 friend class OGRSimpleCurve;
1431 OGRSimpleCurve *m_poCurve =
nullptr;
1434 OGRIteratedPoint() =
default;
1442 void setX(
double xIn);
1446 void setY(
double yIn);
1450 void setZ(
double zIn);
1454 void setM(
double mIn);
1478 int nPointCount = 0;
1479 int m_nPointCapacity = 0;
1481 double *padfZ =
nullptr;
1482 double *padfM =
nullptr;
1489 OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
int bHasM,
1504 class CPL_DLL Iterator
1507 std::unique_ptr<Private> m_poPrivate;
1512 Iterator(Iterator &&oOther)
noexcept;
1516 Iterator &operator++();
1523 class CPL_DLL ConstIterator
1526 std::unique_ptr<Private> m_poPrivate;
1531 ConstIterator &&oOther)
noexcept;
1535 ConstIterator &operator++();
1536 bool operator!=(
const ConstIterator &it)
const;
1539 friend inline ConstIterator
begin(
const OGRSimpleCurve *);
1540 friend inline ConstIterator
end(
const OGRSimpleCurve *);
1543 ~OGRSimpleCurve()
override;
1545 OGRSimpleCurve &operator=(
const OGRSimpleCurve &other);
1547 OGRSimpleCurve &operator=(OGRSimpleCurve &&other);
1569 ConstIterator
begin()
const;
1571 ConstIterator
end()
const;
1574 size_t WkbSize()
const override;
1576 size_t &nBytesConsumedOut)
override;
1596 OGRErr *err =
nullptr)
const override;
1599 void empty()
override;
1619 void getPoint(
int,
OGRPoint *)
const;
1623 return paoPoints[i].
x;
1628 return paoPoints[i].
y;
1631 double getZ(
int i)
const;
1632 double getM(
int i)
const;
1638 bool setCoordinateDimension(
int nDimension)
override;
1640 bool setMeasured(
OGRBoolean bIsMeasured)
override;
1641 bool setNumPoints(
int nNewPointCount,
int bZeroizeNewContent = TRUE);
1643 bool setPoint(
int,
double,
double);
1644 bool setZ(
int,
double);
1645 bool setM(
int,
double);
1646 bool setPoint(
int,
double,
double,
double);
1647 bool setPointM(
int,
double,
double,
double);
1648 bool setPoint(
int,
double,
double,
double,
double);
1649 bool setPoints(
int,
const OGRRawPoint *,
const double * =
nullptr);
1650 bool setPointsM(
int,
const OGRRawPoint *,
const double *);
1651 bool setPoints(
int,
const OGRRawPoint *,
const double *,
const double *);
1652 bool setPoints(
int,
const double *padfX,
const double *padfY,
1653 const double *padfZIn =
nullptr);
1654 bool setPointsM(
int,
const double *padfX,
const double *padfY,
1655 const double *padfMIn =
nullptr);
1656 bool setPoints(
int,
const double *padfX,
const double *padfY,
1657 const double *padfZIn,
const double *padfMIn);
1659 bool addPoint(
double,
double);
1660 bool addPoint(
double,
double,
double);
1661 bool addPointM(
double,
double,
double);
1662 bool addPoint(
double,
double,
double,
double);
1664 bool removePoint(
int);
1666 void getPoints(
OGRRawPoint *,
double * =
nullptr)
const;
1667 void getPoints(
void *pabyX,
int nXStride,
void *pabyY,
int nYStride,
1668 void *pabyZ =
nullptr,
int nZStride = 0,
1669 void *pabyM =
nullptr,
int nMStride = 0)
const;
1671 void addSubLineString(
const OGRLineString *,
int nStartVertex = 0,
1672 int nEndVertex = -1);
1673 void reversePoints()
override;
1678 void flattenTo2D()
override;
1679 bool segmentize(
double dfMaxLength)
override;
1681 void swapXY()
override;
1683 OGR_ALLOW_UPCAST_TO(Curve)
1684 OGR_ALLOW_CAST_TO_THIS(SimpleCurve)
1691 return poCurve->begin();
1697 return poCurve->end();
1703 return poCurve->begin();
1709 return poCurve->end();
1735 OGRCurveCasterToLineString GetCasterToLineString()
const override;
1736 OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1755 const char *
const *papszOptions =
nullptr)
const override;
1757 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
1783 visitor->
visit(
this);
1788 visitor->
visit(
this);
1791 OGR_ALLOW_UPCAST_TO(SimpleCurve)
1792 OGR_ALLOW_CAST_TO_THIS(LineString)
1826 size_t WkbSize()
const override;
1828 size_t &nBytesConsumedOut)
override;
1829 OGRErr exportToWkb(
unsigned char *,
1838 virtual size_t _WkbSize(
int _flags)
const;
1840 const unsigned char *,
size_t,
1841 size_t &nBytesConsumedOut);
1842 virtual OGRErr _exportToWkb(
int _flags,
unsigned char *,
1845 OGRCurveCasterToLineString GetCasterToLineString()
const override;
1846 OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1868 void reverseWindingOrder()
1869 CPL_WARN_DEPRECATED(
"Use reversePoints() instead");
1874 int bTestEnvelope = TRUE) const;
1876 int bTestEnvelope = TRUE) const;
1893 visitor->
visit(
this);
1898 visitor->
visit(
this);
1901 OGR_ALLOW_UPCAST_TO(LineString)
1902 OGR_ALLOW_CAST_TO_THIS(LinearRing)
1923 void ExtendEnvelopeWithCircular(
OGREnvelope *psEnvelope)
const;
1925 int IsFullCircle(
double &cx,
double &cy,
double &square_R)
const;
1929 OGRCurveCasterToLineString GetCasterToLineString()
const override;
1930 OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
1950 size_t &nBytesConsumedOut)
override;
1969 OGRErr *err =
nullptr)
const override;
1981 const char *
const *papszOptions =
nullptr)
const override;
1992 bool segmentize(
double dfMaxLength)
override;
1997 const char *
const *papszOptions =
nullptr)
const override;
2013 visitor->
visit(
this);
2018 visitor->
visit(
this);
2021 OGR_ALLOW_UPCAST_TO(SimpleCurve)
2022 OGR_ALLOW_CAST_TO_THIS(CircularString)
2039class CPL_DLL OGRCurveCollection
2042 friend class OGRCompoundCurve;
2043 friend class OGRCurvePolygon;
2044 friend class OGRPolygon;
2045 friend class OGRTriangle;
2047 int nCurveCount = 0;
2048 OGRCurve **papoCurves =
nullptr;
2051 OGRCurveCollection() =
default;
2052 OGRCurveCollection(
const OGRCurveCollection &other);
2053 OGRCurveCollection(OGRCurveCollection &&other);
2054 ~OGRCurveCollection();
2056 OGRCurveCollection &operator=(
const OGRCurveCollection &other);
2057 OGRCurveCollection &operator=(OGRCurveCollection &&other);
2060 typedef OGRCurve ChildType;
2072 return papoCurves + nCurveCount;
2077 const OGRCurve *
const *
begin()
const
2083 const OGRCurve *
const *
end()
const
2085 return papoCurves + nCurveCount;
2088 void empty(OGRGeometry *poGeom);
2090 void getEnvelope(OGREnvelope *psEnvelope)
const;
2091 void getEnvelope(OGREnvelope3D *psEnvelope)
const;
2093 OGRErr addCurveDirectly(OGRGeometry *poGeom, OGRCurve *poCurve,
2095 size_t WkbSize()
const;
2096 OGRErr importPreambleFromWkb(OGRGeometry *poGeom,
2097 const unsigned char *pabyData,
size_t &nSize,
2098 size_t &nDataOffset,
2100 size_t nMinSubGeomSize,
2103 importBodyFromWkb(OGRGeometry *poGeom,
const unsigned char *pabyData,
2104 size_t nSize,
bool bAcceptCompoundCurve,
2105 OGRErr (*pfnAddCurveDirectlyFromWkb)(OGRGeometry *poGeom,
2108 std::string exportToWkt(
const OGRGeometry *geom,
const OGRWktOptions &opts,
2110 OGRErr exportToWkb(
const OGRGeometry *poGeom,
unsigned char *,
2112 OGRBoolean Equals(
const OGRCurveCollection *poOCC)
const;
2113 bool setCoordinateDimension(OGRGeometry *poGeom,
int nNewDimension);
2114 bool set3D(OGRGeometry *poGeom,
OGRBoolean bIs3D);
2115 bool setMeasured(OGRGeometry *poGeom,
OGRBoolean bIsMeasured);
2116 void assignSpatialReference(OGRGeometry *poGeom,
2117 const OGRSpatialReference *poSR);
2118 int getNumCurves()
const;
2119 OGRCurve *getCurve(
int);
2120 const OGRCurve *getCurve(
int)
const;
2121 OGRCurve *stealCurve(
int);
2123 OGRErr removeCurve(
int iIndex,
bool bDelete =
true);
2125 bool hasEmptyParts()
const;
2126 void removeEmptyParts();
2128 void reversePoints();
2130 OGRErr transform(OGRGeometry *poGeom, OGRCoordinateTransformation *poCT);
2131 void flattenTo2D(OGRGeometry *poGeom);
2132 bool segmentize(
double dfMaxLength);
2134 OGRBoolean hasCurveGeometry(
int bLookForNonLinear)
const;
2155 OGRCurveCollection oCC{};
2157 OGRErr addCurveDirectlyInternal(
OGRCurve *poCurve,
double dfToleranceEps,
2163 OGRLineString *CurveToLineInternal(
double dfMaxAngleStepSizeDegrees,
2164 const char *
const *papszOptions,
2165 int bIsLinearRing)
const;
2176 OGRCurveCasterToLineString GetCasterToLineString()
const override;
2177 OGRCurveCasterToLinearRing GetCasterToLinearRing()
const override;
2222 size_t WkbSize()
const override;
2224 size_t &nBytesConsumedOut)
override;
2225 OGRErr exportToWkb(
unsigned char *,
2232 OGRErr importFromWkt(
const char **)
override;
2243 OGRErr *err =
nullptr)
const override;
2247 void empty()
override;
2248 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
2253 double get_Length()
const override;
2254 void StartPoint(
OGRPoint *)
const override;
2255 void EndPoint(
OGRPoint *)
const override;
2256 void Value(
double,
OGRPoint *)
const override;
2258 CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
2259 const char *
const *papszOptions =
nullptr)
const override;
2261 int getNumPoints()
const override;
2262 double get_AreaOfCurveSegments()
const override;
2263 double get_Area()
const override;
2264 virtual double get_GeodesicArea(
2266 virtual double get_GeodesicLength(
2273 int getNumCurves()
const;
2275 const OGRCurve *getCurve(
int)
const;
2278 bool setCoordinateDimension(
int nDimension)
override;
2280 bool setMeasured(
OGRBoolean bIsMeasured)
override;
2305 bool segmentize(
double dfMaxLength)
override;
2310 const char *
const *papszOptions =
nullptr)
const override;
2314 visitor->
visit(
this);
2319 visitor->
visit(
this);
2322 void swapXY()
override;
2324 bool hasEmptyParts()
const override;
2325 void removeEmptyParts()
override;
2327 OGR_ALLOW_UPCAST_TO(Curve)
2328 OGR_ALLOW_CAST_TO_THIS(CompoundCurve)
2336 return poCurve->
begin();
2343 return poCurve->
end();
2349 return poCurve->
begin();
2355 return poCurve->
end();
2373 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const = 0;
2374 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
const = 0;
2394 OGR_FORBID_DOWNCAST_TO_POINT
2395 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
2396 OGR_ALLOW_CAST_TO_THIS(Surface)
2397 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
2424 virtual bool isRingCorrectType(
const OGRCurve *poRing)
const;
2426 virtual bool checkRing(
const OGRCurve *poNewRing)
const;
2427 OGRErr addRingDirectlyInternal(
OGRCurve *poCurve,
int bNeedRealloc);
2437 OGRCurveCollection oCC{};
2439 OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2440 virtual OGRSurfaceCasterToCurvePolygon
2441 GetCasterToCurvePolygon()
const override;
2489 const char *getGeometryName()
const override;
2492 void empty()
override;
2494 void flattenTo2D()
override;
2496 bool segmentize(
double dfMaxLength)
override;
2498 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2500 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2501 const char *
const *papszOptions =
nullptr)
const override;
2502 virtual double get_GeodesicArea(
2504 virtual double get_GeodesicLength(
2508 double get_Area()
const override;
2510 double get_Length()
const override;
2513 size_t WkbSize()
const override;
2515 size_t &nBytesConsumedOut)
override;
2516 OGRErr exportToWkb(
unsigned char *,
2523 OGRErr importFromWkt(
const char **)
override;
2534 OGRErr *err =
nullptr)
const override;
2537 int getDimension()
const override;
2538 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
2543 CurvePolyToPoly(
double dfMaxAngleStepSizeDegrees = 0,
2544 const char *
const *papszOptions =
nullptr)
const;
2552 bool setCoordinateDimension(
int nDimension)
override;
2554 bool setMeasured(
OGRBoolean bIsMeasured)
override;
2561 OGRErr addRing(std::unique_ptr<OGRCurve>);
2564 const OGRCurve *getExteriorRingCurve()
const;
2565 int getNumInteriorRings()
const;
2566 OGRCurve *getInteriorRingCurve(
int);
2567 const OGRCurve *getInteriorRingCurve(
int)
const;
2569 OGRCurve *stealExteriorRingCurve();
2571 OGRErr removeRing(
int iIndex,
bool bDelete =
true);
2575 visitor->
visit(
this);
2580 visitor->
visit(
this);
2583 void swapXY()
override;
2585 bool hasEmptyParts()
const override;
2586 void removeEmptyParts()
override;
2588 OGR_ALLOW_UPCAST_TO(Surface)
2589 OGR_ALLOW_CAST_TO_THIS(CurvePolygon)
2597 return poGeom->
begin();
2604 return poGeom->
end();
2610 return poGeom->
begin();
2616 return poGeom->
end();
2644 bool isRingCorrectType(
const OGRCurve *poRing)
const override;
2646 bool checkRing(
const OGRCurve *poNewRing)
const override;
2647 virtual OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
2649 int &nMaxPoints,
double *&padfZ);
2653 OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2654 virtual OGRSurfaceCasterToCurvePolygon
2655 GetCasterToCurvePolygon()
const override;
2662 OGRPolygon(
double x1,
double y1,
double x2,
double y2);
2681 return reinterpret_cast<ChildType **
>(oCC.begin());
2687 return reinterpret_cast<ChildType **
>(oCC.end());
2694 return reinterpret_cast<const ChildType *
const *
>(oCC.begin());
2700 return reinterpret_cast<const ChildType *
const *
>(oCC.end());
2704 const char *getGeometryName()
const override;
2708 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2710 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
2712 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2713 const char *
const *papszOptions =
nullptr)
const override;
2716 size_t WkbSize()
const override;
2718 size_t &nBytesConsumedOut)
override;
2719 OGRErr exportToWkb(
unsigned char *,
2726 OGRErr importFromWkt(
const char **)
override;
2737 OGRErr *err =
nullptr)
const override;
2741 CurvePolyToPoly(
double dfMaxAngleStepSizeDegrees = 0,
2742 const char *
const *papszOptions =
nullptr)
const override;
2768 visitor->
visit(
this);
2773 visitor->
visit(
this);
2776 void closeRings()
override;
2778 OGR_ALLOW_UPCAST_TO(CurvePolygon)
2779 OGR_ALLOW_CAST_TO_THIS(Polygon)
2786 return poGeom->
begin();
2792 return poGeom->
end();
2798 return poGeom->
begin();
2804 return poGeom->
end();
2823 bool quickValidityCheck()
const;
2827 OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2828 virtual OGRErr importFromWKTListOnly(
const char **ppszInput,
int bHasZ,
2831 double *&padfZ)
override;
2852 size_t &nBytesConsumedOut)
override;
2871 visitor->
visit(
this);
2876 visitor->
visit(
this);
2883 OGR_ALLOW_UPCAST_TO(Polygon)
2884 OGR_ALLOW_CAST_TO_THIS(Triangle)
2900 OGRErr importFromWktInternal(
const char **ppszInput,
int nRecLevel);
2905 OGRGeometry **papoGeoms =
nullptr;
2909 const std::string &exclude = std::string())
const;
2914 OGRErr importFromWkbInternal(
const unsigned char *pabyData,
size_t nSize,
2916 size_t &nBytesConsumedOut);
2944 return papoGeoms + nGeomCount;
2957 return papoGeoms + nGeomCount;
2961 const char *getGeometryName()
const override;
2964 void empty()
override;
2966 void flattenTo2D()
override;
2968 bool segmentize(
double dfMaxLength)
override;
2970 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
2972 getCurveGeometry(
const char *
const *papszOptions =
nullptr)
const override;
2974 getLinearGeometry(
double dfMaxAngleStepSizeDegrees = 0,
2975 const char *
const *papszOptions =
nullptr)
const override;
2978 virtual double get_GeodesicLength(
2982 size_t WkbSize()
const override;
2984 size_t &nBytesConsumedOut)
override;
2985 OGRErr exportToWkb(
unsigned char *,
2992 OGRErr importFromWkt(
const char **)
override;
3003 OGRErr *err =
nullptr)
const override;
3005 virtual double get_Length()
const;
3006 virtual double get_Area()
const;
3009 int getDimension()
const override;
3010 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
3014 int getNumGeometries()
const;
3022 bool setCoordinateDimension(
int nDimension)
override;
3024 bool setMeasured(
OGRBoolean bIsMeasured)
override;
3027 OGRErr addGeometry(std::unique_ptr<OGRGeometry> geom);
3028 virtual OGRErr removeGeometry(
int iIndex,
int bDelete = TRUE);
3029 std::unique_ptr<OGRGeometry> stealGeometry(
int iIndex);
3031 bool hasEmptyParts()
const override;
3032 void removeEmptyParts()
override;
3037 void closeRings()
override;
3039 void swapXY()
override;
3043 visitor->
visit(
this);
3048 visitor->
visit(
this);
3054 OGR_FORBID_DOWNCAST_TO_POINT
3055 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
3056 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
3057 OGR_ALLOW_CAST_TO_THIS(GeometryCollection)
3065 return poGeom->
begin();
3072 return poGeom->
end();
3078 return poGeom->
begin();
3084 return poGeom->
end();
3122 return reinterpret_cast<ChildType **
>(papoGeoms);
3128 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3135 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3141 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3146 const char *getGeometryName()
const override;
3154 OGRErr importFromWkt(
const char **)
override;
3165 OGRErr *err =
nullptr)
const override;
3171 int getDimension()
const override;
3188 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3204 visitor->
visit(
this);
3209 visitor->
visit(
this);
3214 OGR_ALLOW_CAST_TO_THIS(MultiSurface)
3215 OGR_ALLOW_UPCAST_TO(GeometryCollection)
3216 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
3217 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING
3218 OGR_FORBID_DOWNCAST_TO_MULTICURVE
3226 return poGeom->
begin();
3233 return poGeom->
end();
3239 return poGeom->
begin();
3245 return poGeom->
end();
3262 friend class OGRPolyhedralSurface;
3263 friend class OGRTriangulatedSurface;
3267 OGRErr _addGeometryWithExpectedSubGeometryType(
3269 OGRErr _addGeometryDirectlyWithExpectedSubGeometryType(
3292 return reinterpret_cast<ChildType **
>(papoGeoms);
3298 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3305 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3311 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3329 const char *getGeometryName()
const override;
3338 size_t &nBytesConsumedOut)
override;
3345 OGRErr *err =
nullptr)
const override;
3349 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3365 visitor->
visit(
this);
3370 visitor->
visit(
this);
3375 OGR_ALLOW_CAST_TO_THIS(MultiPolygon)
3376 OGR_ALLOW_UPCAST_TO(MultiSurface)
3384 return poGeom->
begin();
3391 return poGeom->
end();
3397 return poGeom->
begin();
3403 return poGeom->
end();
3423 OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
3424 virtual OGRSurfaceCasterToCurvePolygon
3425 GetCasterToCurvePolygon()
const override;
3427 virtual const char *getSubGeometryName()
const;
3432 virtual OGRPolyhedralSurfaceCastToMultiPolygon
3433 GetCasterToMultiPolygon()
const;
3479 size_t WkbSize()
const override;
3480 const char *getGeometryName()
const override;
3483 size_t &nBytesConsumedOut)
override;
3484 OGRErr exportToWkb(
unsigned char *,
3491 OGRErr importFromWkt(
const char **)
override;
3502 OGRErr *err =
nullptr)
const override;
3505 int getDimension()
const override;
3507 void empty()
override;
3510 void getEnvelope(
OGREnvelope *psEnvelope)
const override;
3513 void flattenTo2D()
override;
3516 double get_Area()
const override;
3517 virtual double get_GeodesicArea(
3519 double get_Length()
const override;
3520 virtual double get_GeodesicLength(
3527 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3530 OGRErr addGeometry(std::unique_ptr<OGRGeometry> poNewGeom);
3532 int getNumGeometries()
const;
3534 const OGRPolygon *getGeometryRef(
int i)
const;
3537 bool setCoordinateDimension(
int nDimension)
override;
3539 bool setMeasured(
OGRBoolean bIsMeasured)
override;
3540 void swapXY()
override;
3541 OGRErr removeGeometry(
int iIndex,
int bDelete = TRUE);
3543 bool hasEmptyParts()
const override;
3544 void removeEmptyParts()
override;
3548 visitor->
visit(
this);
3553 visitor->
visit(
this);
3559 OGR_ALLOW_CAST_TO_THIS(PolyhedralSurface)
3560 OGR_ALLOW_UPCAST_TO(Surface)
3568 return poGeom->
begin();
3575 return poGeom->
end();
3581 return poGeom->
begin();
3587 return poGeom->
end();
3606 const char *getSubGeometryName()
const override;
3609 virtual OGRPolyhedralSurfaceCastToMultiPolygon
3610 GetCasterToMultiPolygon()
const override;
3652 return reinterpret_cast<const ChildType *
const *
>(oMP.
end());
3655 const char *getGeometryName()
const override;
3692 visitor->
visit(
this);
3697 visitor->
visit(
this);
3703 OGR_ALLOW_CAST_TO_THIS(TriangulatedSurface)
3704 OGR_ALLOW_UPCAST_TO(PolyhedralSurface)
3712 return poGeom->
begin();
3719 return poGeom->
end();
3725 return poGeom->
begin();
3731 return poGeom->
end();
3747 OGRErr importFromWkt_Bracketed(
const char **,
int bHasM,
int bHasZ);
3771 return reinterpret_cast<ChildType **
>(papoGeoms);
3777 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3784 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3790 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3808 const char *getGeometryName()
const override;
3816 OGRErr importFromWkt(
const char **)
override;
3827 OGRErr *err =
nullptr)
const override;
3830 int getDimension()
const override;
3846 visitor->
visit(
this);
3851 visitor->
visit(
this);
3856 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
3858 OGR_ALLOW_CAST_TO_THIS(MultiPoint)
3859 OGR_ALLOW_UPCAST_TO(GeometryCollection)
3860 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING
3861 OGR_FORBID_DOWNCAST_TO_MULTICURVE
3862 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
3863 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
3870 return poGeom->
begin();
3876 return poGeom->
end();
3882 return poGeom->
begin();
3888 return poGeom->
end();
3930 return reinterpret_cast<ChildType **
>(papoGeoms);
3936 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
3943 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
3949 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
3967 const char *getGeometryName()
const override;
3975 OGRErr importFromWkt(
const char **)
override;
3986 OGRErr *err =
nullptr)
const override;
3989 int getDimension()
const override;
3993 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
4009 visitor->
visit(
this);
4014 visitor->
visit(
this);
4019 OGR_ALLOW_CAST_TO_THIS(MultiCurve)
4020 OGR_ALLOW_UPCAST_TO(GeometryCollection)
4021 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
4022 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
4023 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
4030 return poGeom->
begin();
4036 return poGeom->
end();
4042 return poGeom->
begin();
4048 return poGeom->
end();
4085 return reinterpret_cast<ChildType **
>(papoGeoms);
4091 return reinterpret_cast<ChildType **
>(papoGeoms + nGeomCount);
4098 return reinterpret_cast<const ChildType *
const *
>(papoGeoms);
4104 return reinterpret_cast<const ChildType *
const *
>(papoGeoms +
4122 const char *getGeometryName()
const override;
4131 size_t &nBytesConsumedOut)
override;
4138 OGRErr *err =
nullptr)
const override;
4142 hasCurveGeometry(
int bLookForNonLinear = FALSE)
const override;
4158 visitor->
visit(
this);
4163 visitor->
visit(
this);
4168 OGR_ALLOW_CAST_TO_THIS(MultiLineString)
4169 OGR_ALLOW_UPCAST_TO(MultiCurve)
4170 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
4171 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
4172 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
4180 return poGeom->
begin();
4187 return poGeom->
end();
4193 return poGeom->
begin();
4199 return poGeom->
end();
4214 static OGRErr createFromFgfInternal(
const unsigned char *pabyData,
4217 int *pnBytesConsumed,
int nRecLevel);
4222 size_t =
static_cast<size_t>(-1),
4227 size_t &nBytesConsumedOut);
4232 static std::pair<std::unique_ptr<OGRGeometry>,
OGRErr>
4241 CPL_WARN_DEPRECATED(
"Use createFromWkt(const char**, ...) instead")
4243 return createFromWkt(
const_cast<const char **
>(ppszInput), poSRS,
4251 static OGRGeometry *createFromGeoJson(
const char *,
int = -1);
4259 bool bOnlyInOrder =
true);
4266 const char *
const *papszOptions =
nullptr);
4268 static std::unique_ptr<OGRGeometry>
4269 makeCompatibleWith(std::unique_ptr<OGRGeometry>,
4276 int *pbResultValidGeometry,
4277 const char **papszOptions =
nullptr);
4278 static bool haveGEOS();
4281 class CPL_DLL TransformWithOptionsCache
4283 friend class OGRGeometryFactory;
4285 std::unique_ptr<Private> d;
4288 TransformWithOptionsCache();
4289 ~TransformWithOptionsCache();
4293 static bool isTransformWithOptionsRegularTransform(
4300 char **papszOptions,
4307 double dfPrimaryRadius,
double dfSecondaryAxis,
4308 double dfRotation,
double dfStartAngle,
4309 double dfEndAngle,
double dfMaxAngleStepSizeDegrees,
4310 const bool bUseMaxGap =
false);
4313 double x2,
double y2,
double &R,
double &cx,
4314 double &cy,
double &alpha0,
double &alpha1,
4318 double z1,
double x2,
double y2,
double z2,
int bHasZ,
4319 double dfMaxAngleStepSizeDegrees,
4320 const char *
const *papszOptions =
nullptr);
4323 const char *
const *papszOptions =
nullptr);
4328 bool bCamelCase =
false,
4329 bool bAddZM =
false,
4330 bool bSpaceBeforeZM =
false);
4333typedef struct _OGRPreparedGeometry OGRPreparedGeometry;
4335struct CPL_DLL OGRPreparedGeometryUniquePtrDeleter
4337 void operator()(OGRPreparedGeometry *)
const;
4344typedef std::unique_ptr<OGRPreparedGeometry,
4345 OGRPreparedGeometryUniquePtrDeleter>
The CPLJSONArray class holds JSON object from CPLJSONDocument.
Definition cpl_json.h:56
OGRGeometry visitor interface.
Definition ogr_geometry.h:222
virtual void visit(const OGRCurvePolygon *)=0
Visit OGRCurvePolygon.
virtual void visit(const OGRPolyhedralSurface *)=0
Visit OGRPolyhedralSurface.
virtual void visit(const OGRCompoundCurve *)=0
Visit OGRCompoundCurve.
virtual void visit(const OGRMultiLineString *)=0
Visit OGRMultiLineString.
virtual void visit(const OGRTriangulatedSurface *)=0
Visit OGRTriangulatedSurface.
virtual void visit(const OGRPolygon *)=0
Visit OGRPolygon.
virtual void visit(const OGRMultiPolygon *)=0
Visit OGRMultiPolygon.
virtual ~IOGRConstGeometryVisitor()
Destructor/.
virtual void visit(const OGRTriangle *)=0
Visit OGRTriangle.
virtual void visit(const OGRLineString *)=0
Visit OGRLineString.
virtual void visit(const OGRMultiPoint *)=0
Visit OGRMultiPoint.
virtual void visit(const OGRMultiCurve *)=0
Visit OGRMultiCurve.
virtual void visit(const OGRGeometryCollection *)=0
Visit OGRGeometryCollection.
virtual void visit(const OGRPoint *)=0
Visit OGRPoint.
virtual void visit(const OGRMultiSurface *)=0
Visit OGRMultiSurface.
virtual void visit(const OGRLinearRing *)=0
Visit OGRLinearRing.
virtual void visit(const OGRCircularString *)=0
Visit OGRCircularString.
OGRGeometry visitor interface.
Definition ogr_geometry.h:148
virtual void visit(OGRMultiSurface *)=0
Visit OGRMultiSurface.
virtual void visit(OGRLinearRing *)=0
Visit OGRLinearRing.
virtual void visit(OGRTriangle *)=0
Visit OGRTriangle.
virtual void visit(OGRCircularString *)=0
Visit OGRCircularString.
virtual void visit(OGRPolygon *)=0
Visit OGRPolygon.
virtual void visit(OGRLineString *)=0
Visit OGRLineString.
virtual void visit(OGRCompoundCurve *)=0
Visit OGRCompoundCurve.
virtual void visit(OGRTriangulatedSurface *)=0
Visit OGRTriangulatedSurface.
virtual void visit(OGRPoint *)=0
Visit OGRPoint.
virtual void visit(OGRCurvePolygon *)=0
Visit OGRCurvePolygon.
virtual void visit(OGRGeometryCollection *)=0
Visit OGRGeometryCollection.
virtual void visit(OGRPolyhedralSurface *)=0
Visit OGRPolyhedralSurface.
virtual void visit(OGRMultiPolygon *)=0
Visit OGRMultiPolygon.
virtual ~IOGRGeometryVisitor()
Destructor/.
virtual void visit(OGRMultiLineString *)=0
Visit OGRMultiLineString.
virtual void visit(OGRMultiPoint *)=0
Visit OGRMultiPoint.
virtual void visit(OGRMultiCurve *)=0
Visit OGRMultiCurve.
Concrete representation of a circular string, that is to say a curve made of one or several arc circl...
Definition ogr_geometry.h:1921
OGRCircularString()=default
Create an empty circular string.
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:925
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:2016
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:902
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
OGRBoolean IsValid() const override
Test if the geometry is valid.
Definition ogrcircularstring.cpp:706
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:2006
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:865
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:2000
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:727
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:2011
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const override
Returns if this geometry is or has curve geometry.
Definition ogrcircularstring.cpp:717
Utility class to store a collection of curves.
Definition ogr_geometry.h:2153
const ChildType *const * end() const
Return end of curve iterator.
Definition ogr_geometry.h:2216
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:2210
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:2193
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:2203
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:2288
void reversePoints() override
Reverse point order.
Definition ogrcompoundcurve.cpp:985
ChildType ** begin()
Return begin of curve iterator.
Definition ogr_geometry.h:2197
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:2317
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2312
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:2417
OGRCurvePolygon()=default
Create an empty curve polygon.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2573
OGRCurvePolygon & operator=(OGRCurvePolygon &&other)=default
Move assignment operator.
static OGRPolygon * CastToPolygon(OGRCurvePolygon *poCP)
Convert to polygon.
Definition ogrcurvepolygon.cpp:892
OGRCurve ChildType
Type of child elements.
Definition ogr_geometry.h:2460
OGRCurvePolygon(OGRCurvePolygon &&)=default
Move constructor.
const ChildType *const * end() const
Return end of curve iterator.
Definition ogr_geometry.h:2483
const ChildType *const * begin() const
Return begin of curve iterator.
Definition ogr_geometry.h:2477
OGRCurvePolygon & operator=(const OGRCurvePolygon &other)
Assignment operator.
Definition ogrcurvepolygon.cpp:44
ChildType ** begin()
Return begin of curve iterator.
Definition ogr_geometry.h:2464
ChildType ** end()
Return end of curve iterator.
Definition ogr_geometry.h:2470
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2578
OGRCurvePolygon(const OGRCurvePolygon &)
Copy constructor.
Abstract curve base class for OGRLineString, OGRCircularString and OGRCompoundCurve.
Definition ogr_geometry.h:1278
virtual OGRPointIterator * getPointIterator() const =0
Returns a point iterator over the curve.
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:1371
virtual double get_Length() const =0
Returns the length of the curve.
OGRPoint ChildType
Type of child elements.
Definition ogr_geometry.h:1321
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:1363
virtual double get_AreaOfCurveSegments() const =0
Get the area of the purely curve portions of a (closed) curve.
virtual 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:199
Simple container for a bounding region (rectangle).
Definition ogr_core.h:44
Geometry coordinate precision for a binary representation.
Definition ogr_geometry.h:302
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:8731
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:2899
ChildType ** end()
Return end of sub-geometry iterator.
Definition ogr_geometry.h:2942
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:1498
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3041
const ChildType *const * begin() const
Return begin of sub-geometry iterator.
Definition ogr_geometry.h:2949
const ChildType *const * end() const
Return end of sub-geometry iterator.
Definition ogr_geometry.h:2955
ChildType ** begin()
Return begin of sub-geometry iterator.
Definition ogr_geometry.h:2936
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3046
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:2932
Create geometry objects from well known text/binary.
Definition ogr_geometry.h:4213
static OGRGeometry * transformWithOptions(const OGRGeometry *poSrcGeom, OGRCoordinateTransformation *poCT, char **papszOptions, const TransformWithOptionsCache &cache=TransformWithOptionsCache())
Transform a geometry.
Definition ogrgeometryfactory.cpp:4127
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:475
static OGRCurve * curveFromLineString(const OGRLineString *poLS, const char *const *papszOptions=nullptr)
Try to convert a linestring approximating curves into a curve.
Definition ogrgeometryfactory.cpp:6448
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:5674
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:90
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:4446
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:5412
static OGRErr createFromWkt(char **ppszInput, const OGRSpatialReference *poSRS, OGRGeometry **ppoGeom)
Deprecated.
Definition ogr_geometry.h:4238
static double GetDefaultArcStepSize()
Return the default value of the angular step used when stroking curves as lines.
Definition ogrgeometryfactory.cpp:4378
Abstract base class for all geometry classes.
Definition ogr_geometry.h:357
const OGRSurface * toSurface() const
Down-cast to OGRSurface*.
Definition ogr_geometry.h:784
static void freeGEOSContext(GEOSContextHandle_t hGEOSCtxt)
Destroy a GEOS context.
Definition ogrgeometry.cpp:3238
const OGRCurvePolygon * toCurvePolygon() const
Down-cast to OGRCurvePolygon*.
Definition ogr_geometry.h:836
GEOSGeom exportToGEOS(GEOSContextHandle_t hGEOSCtxt, bool bRemoveEmptyParts=false) const
Returns a GEOSGeom object corresponding to the geometry.
Definition ogrgeometry.cpp:3287
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:8851
void roundCoordinates(const OGRGeomCoordinatePrecision &sPrecision)
Round coordinates of the geometry to the specified precision.
Definition ogrgeometry.cpp:6484
const OGRMultiCurve * toMultiCurve() const
Down-cast to OGRMultiCurve*.
Definition ogr_geometry.h:926
virtual OGRGeometry * getCurveGeometry(const char *const *papszOptions=nullptr) const
Return curve version of this geometry.
Definition ogrgeometry.cpp:3511
virtual OGRGeometry * ConstrainedDelaunayTriangulation() const
Return a constrained Delaunay triangulation of the vertices of the given polygon(s).
Definition ogrgeometry.cpp:6744
const OGRPolyhedralSurface * toPolyhedralSurface() const
Down-cast to OGRPolyhedralSurface*.
Definition ogr_geometry.h:962
virtual OGRBoolean Intersects(const OGRGeometry *) const
Do these features intersect?
Definition ogrgeometry.cpp:569
const OGRMultiPoint * toMultiPoint() const
Down-cast to OGRMultiPoint*.
Definition ogr_geometry.h:872
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const
Returns if this geometry is or has curve geometry.
Definition ogrgeometry.cpp:3445
const OGRMultiPolygon * toMultiPolygon() const
Down-cast to OGRMultiPolygon*.
Definition ogr_geometry.h:908
OGRPolyhedralSurface * toPolyhedralSurface()
Down-cast to OGRPolyhedralSurface*.
Definition ogr_geometry.h:953
const OGRMultiSurface * toMultiSurface() const
Down-cast to OGRMultiSurface*.
Definition ogr_geometry.h:944
OGRPoint * toPoint()
Down-cast to OGRPoint*.
Definition ogr_geometry.h:652
virtual OGRGeometry * clone() const =0
Make a copy of this object.
virtual OGRErr transform(OGRCoordinateTransformation *poCT)=0
Apply arbitrary coordinate transformation to geometry.
virtual OGRErr importFromWkt(const char **ppszInput)=0
Assign geometry from well known text data.
virtual bool setCoordinateDimension(int nDimension)
Set the coordinate dimension.
Definition ogrgeometry.cpp:1096
bool operator!=(const OGRGeometry &other) const
Returns if two geometries are different.
Definition ogr_geometry.h:419
OGRTriangle * toTriangle()
Down-cast to OGRTriangle*.
Definition ogr_geometry.h:810
OGRLineString * toLineString()
Down-cast to OGRLineString*.
Definition ogr_geometry.h:705
int CoordinateDimension() const
Get the dimension of the coordinates in this object.
Definition ogrgeometry.cpp:974
const OGRLinearRing * toLinearRing() const
Down-cast to OGRLinearRing*.
Definition ogr_geometry.h:730
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:6574
OGRGeometry * SimplifyPreserveTopology(double dTolerance) const
Simplify the geometry while preserving topology.
Definition ogrgeometry.cpp:6406
const OGRPoint * toPoint() const
Down-cast to OGRPoint*.
Definition ogr_geometry.h:660
virtual void swapXY()
Swap x and y coordinates.
Definition ogrgeometry.cpp:7035
virtual void empty()=0
Clear geometry information.
virtual OGRGeometry * Simplify(double dTolerance) const
Simplify the geometry.
Definition ogrgeometry.cpp:6328
virtual OGRBoolean Overlaps(const OGRGeometry *) const
Test for overlap.
Definition ogrgeometry.cpp:5959
virtual OGRBoolean IsEmpty() const =0
Returns TRUE (non-zero) if the object has no points.
virtual OGRGeometry * DelaunayTriangulation(double dfTolerance, int bOnlyEdges) const
Return a Delaunay triangulation of the vertices of the geometry.
Definition ogrgeometry.cpp:6662
virtual int getCoordinateDimension() const
Get the dimension of the coordinates in this object.
Definition ogrgeometry.cpp:956
virtual OGRGeometry * ConcaveHull(double dfRatio, bool bAllowHoles) const
Compute "concave hull" of a geometry.
Definition ogrgeometry.cpp:4279
OGRMultiLineString * toMultiLineString()
Down-cast to OGRMultiLineString*.
Definition ogr_geometry.h:881
OGRMultiSurface * toMultiSurface()
Down-cast to OGRMultiSurface*.
Definition ogr_geometry.h:935
static OGRGeometry * FromHandle(OGRGeometryH hGeom)
Convert a OGRGeometryH to a OGRGeometry*.
Definition ogr_geometry.h:644
virtual void flattenTo2D()=0
Convert geometry to strictly 2D.
virtual void accept(IOGRConstGeometryVisitor *visitor) const =0
Accept a visitor.
const OGRGeometryCollection * toGeometryCollection() const
Down-cast to OGRGeometryCollection*.
Definition ogr_geometry.h:854
virtual OGRBoolean IsValid() const
Test if the geometry is valid.
Definition ogrgeometry.cpp:2274
const OGRMultiLineString * toMultiLineString() const
Down-cast to OGRMultiLineString*.
Definition ogr_geometry.h:890
virtual OGRGeometry * Difference(const OGRGeometry *) const
Compute difference.
Definition ogrgeometry.cpp:5304
virtual OGRGeometry * MakeValid(CSLConstList papszOptions=nullptr) const
Attempts to make an invalid geometry valid without losing vertices.
Definition ogrgeometry.cpp:3896
virtual double Distance(const OGRGeometry *) const
Compute distance between two geometries.
Definition ogrgeometry.cpp:3538
virtual bool set3D(OGRBoolean bIs3D)
Add or remove the Z coordinate dimension.
Definition ogrgeometry.cpp:1119
OGRGeometry * UnaryUnion() const
Returns the union of all components of a single geometry.
Definition ogrgeometry.cpp:5200
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:1143
virtual int getDimension() const =0
Get the dimension of this object.
virtual OGRGeometry * ConvexHull() const
Compute convex hull.
Definition ogrgeometry.cpp:4160
const OGRCircularString * toCircularString() const
Down-cast to OGRCircularString*.
Definition ogr_geometry.h:748
virtual OGRGeometry * Buffer(double dfDist, int nQuadSegs=30) const
Compute buffer of geometry.
Definition ogrgeometry.cpp:4498
const OGRSpatialReference * getSpatialReference(void) const
Returns spatial reference system for object.
Definition ogr_geometry.h:535
virtual OGRGeometry * BuildArea() const
Polygonize a linework assuming inner polygons are holes.
Definition ogrgeometry.cpp:6960
OGRPolygon * toPolygon()
Down-cast to OGRPolygon*.
Definition ogr_geometry.h:793
bool operator==(const OGRGeometry &other) const
Returns if two geometries are equal.
Definition ogr_geometry.h:413
virtual OGRErr Centroid(OGRPoint *poPoint) const
Compute the geometry centroid.
Definition ogrgeometry.cpp:6076
OGRLinearRing * toLinearRing()
Down-cast to OGRLinearRing*.
Definition ogr_geometry.h:722
virtual OGRGeometry * UnionCascaded() const
Compute union using cascading.
Definition ogrgeometry.cpp:5102
OGRBoolean IsMeasured() const
Definition ogr_geometry.h:441
virtual OGRBoolean Within(const OGRGeometry *) const
Test for containment.
Definition ogrgeometry.cpp:5812
OGRGeometry & operator=(const OGRGeometry &other)
Assignment operator.
Definition ogrgeometry.cpp:142
virtual OGRGeometry * Union(const OGRGeometry *) const
Compute union.
Definition ogrgeometry.cpp:4986
virtual OGRGeometry * Polygonize() const
Polygonizes a set of sparse edges.
Definition ogrgeometry.cpp:6834
virtual void accept(IOGRGeometryVisitor *visitor)=0
Accept a visitor.
virtual double Distance3D(const OGRGeometry *poOtherGeom) const
Returns the 3D distance between two geometries.
Definition ogrgeometry.cpp:3668
virtual OGRGeometry * Normalize() const
Attempts to bring geometry into normalized/canonical form.
Definition ogrgeometry.cpp:4080
OGRMultiCurve * toMultiCurve()
Down-cast to OGRMultiCurve*.
Definition ogr_geometry.h:917
const OGRCompoundCurve * toCompoundCurve() const
Down-cast to OGRCompoundCurve*.
Definition ogr_geometry.h:766
virtual bool hasEmptyParts() const
Returns whether a geometry has empty parts/rings.
Definition ogrgeometry.cpp:8903
virtual OGRBoolean Disjoint(const OGRGeometry *) const
Test for disjointness.
Definition ogrgeometry.cpp:5558
virtual OGRGeometry * SymDifference(const OGRGeometry *) const
Compute symmetric difference.
Definition ogrgeometry.cpp:5423
virtual OGRwkbGeometryType getGeometryType() const =0
Fetch geometry type.
OGRGeometryCollection * toGeometryCollection()
Down-cast to OGRGeometryCollection*.
Definition ogr_geometry.h:845
virtual char * exportToKML() const
Convert a geometry into KML format.
Definition ogrgeometry.cpp:3139
virtual OGRGeometry * Boundary() const
Compute boundary.
Definition ogrgeometry.cpp:4374
virtual char * exportToGML(const char *const *papszOptions=nullptr) const
Convert a geometry into GML format.
Definition ogrgeometry.cpp:3116
OGRErr transformTo(const OGRSpatialReference *poSR)
Transform geometry to new spatial reference system.
Definition ogrgeometry.cpp:692
virtual OGRBoolean Touches(const OGRGeometry *) const
Test for touching.
Definition ogrgeometry.cpp:5631
OGRMultiPolygon * toMultiPolygon()
Down-cast to OGRMultiPolygon*.
Definition ogr_geometry.h:899
const OGRPolygon * toPolygon() const
Down-cast to OGRPolygon*.
Definition ogr_geometry.h:802
OGRCompoundCurve * toCompoundCurve()
Down-cast to OGRCompoundCurve*.
Definition ogr_geometry.h:757
OGRErr exportToWkb(OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc) const
Convert a geometry into well known binary format.
Definition ogrgeometry.cpp:1589
OGRwkbGeometryType getIsoGeometryType() const
Get the geometry type that conforms with ISO SQL/MM Part3.
Definition ogrgeometry.cpp:847
OGRErr importFromWkt(char **ppszInput)
Deprecated.
Definition ogr_geometry.h:468
const OGRLineString * toLineString() const
Down-cast to OGRLineString*.
Definition ogr_geometry.h:714
OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const
Convert a geometry into well known text format.
Definition ogrgeometry.cpp:1961
virtual bool segmentize(double dfMaxLength)
Modify the geometry such it has no segment longer then the given distance.
Definition ogrgeometry.cpp:880
void roundCoordinatesIEEE754(const OGRGeomCoordinateBinaryPrecision &options)
Round coordinates of a geometry, exploiting characteristics of the IEEE-754 double-precision binary r...
Definition ogrgeometry.cpp:8440
virtual size_t WkbSize() const =0
Returns size of related binary representation.
OGRCircularString * toCircularString()
Down-cast to OGRCircularString*.
Definition ogr_geometry.h:739
virtual void removeEmptyParts()
Remove empty parts/rings from this geometry.
Definition ogrgeometry.cpp:8917
const OGRCurve * toCurve() const
Down-cast to OGRCurve*.
Definition ogr_geometry.h:678
virtual OGRGeometry * getLinearGeometry(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const
Return, possibly approximate, non-curve version of this geometry.
Definition ogrgeometry.cpp:3477
OGRCurvePolygon * toCurvePolygon()
Down-cast to OGRCurvePolygon*.
Definition ogr_geometry.h:827
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:696
static GEOSContextHandle_t createGEOSContext()
Create a new GEOS context.
Definition ogrgeometry.cpp:3221
virtual OGRBoolean Crosses(const OGRGeometry *) const
Test for crossing.
Definition ogrgeometry.cpp:5705
OGRErr importFromWkb(const GByte *, size_t=static_cast< size_t >(-1), OGRwkbVariant=wkbVariantOldOgc)
Assign geometry from well known binary data.
Definition ogrgeometry.cpp:1495
virtual OGRGeometry * Intersection(const OGRGeometry *) const
Compute intersection.
Definition ogrgeometry.cpp:4867
static OGRGeometryH ToHandle(OGRGeometry *poGeom)
Convert a OGRGeometry* to a OGRGeometryH.
Definition ogr_geometry.h:637
virtual OGRBoolean Contains(const OGRGeometry *) const
Test for containment.
Definition ogrgeometry.cpp:5885
void dumpReadable(FILE *, const char *=nullptr, CSLConstList papszOptions=nullptr) const
Dump geometry in well known text format to indicated output file.
Definition ogrgeometry.cpp:195
OGRBoolean Is3D() const
Definition ogr_geometry.h:435
OGRMultiPoint * toMultiPoint()
Down-cast to OGRMultiPoint*.
Definition ogr_geometry.h:863
virtual const char * getGeometryName() const =0
Fetch WKT name for geometry type.
virtual void closeRings()
Force rings to be closed.
Definition ogrgeometry.cpp:6020
const OGRTriangulatedSurface * toTriangulatedSurface() const
Down-cast to OGRTriangulatedSurface*.
Definition ogr_geometry.h:978
const OGRTriangle * toTriangle() const
Down-cast to OGRTriangle*.
Definition ogr_geometry.h:818
virtual char * exportToJson(CSLConstList papszOptions=nullptr) const
Convert a geometry into GeoJSON format.
Definition ogrgeometry.cpp:3170
OGRSurface * toSurface()
Down-cast to OGRSurface*.
Definition ogr_geometry.h:775
virtual void assignSpatialReference(const OGRSpatialReference *poSR)
Assign spatial reference to this object.
Definition ogrgeometry.cpp:499
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition ogr_geometry.h:687
OGRTriangulatedSurface * toTriangulatedSurface()
Down-cast to OGRTriangulatedSurface*.
Definition ogr_geometry.h:970
virtual std::string exportToWkt(const OGRWktOptions &opts=OGRWktOptions(), OGRErr *err=nullptr) const =0
Export a WKT geometry.
OGRCurve * toCurve()
Down-cast to OGRCurve*.
Definition ogr_geometry.h:669
virtual OGRGeometry * BufferEx(double dfDist, CSLConstList papszOptions) const
Compute buffer of geometry.
Definition ogrgeometry.cpp:4609
virtual OGRBoolean IsSimple() const
Test if the geometry is simple.
Definition ogrgeometry.cpp:2393
Definition ogr_geometry.h:1427
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:1726
virtual double get_GeodesicLength(const OGRSpatialReference *poSRSOverride=nullptr) const override
Get the length of the curve, considered as a geodesic line on the underlying ellipsoid of the SRS att...
OGRSimpleCurve * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:1770
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:1786
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:1781
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:1776
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:1820
OGRLineString * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:1880
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:1896
const OGRLineString * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:1886
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:1891
A collection of OGRCurve.
Definition ogr_geometry.h:3903
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3941
OGRMultiCurve()=default
Create an empty multi curve collection.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3947
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3934
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:4012
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:4002
OGRMultiCurve & operator=(OGRMultiCurve &&other)=default
Move assignment operator.
const OGRCurve * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef().
Definition ogr_geometry.h:3961
OGRCurve * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef().
Definition ogr_geometry.h:3955
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:4007
OGRMultiCurve(const OGRMultiCurve &other)
Copy constructor.
OGRMultiCurve & operator=(const OGRMultiCurve &other)
Assignment operator.
Definition ogrmulticurve.cpp:41
OGRCurve ChildType
Type of child elements.
Definition ogr_geometry.h:3924
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3928
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3996
OGRMultiCurve(OGRMultiCurve &&other)=default
Move constructor.
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:4062
OGRMultiLineString & operator=(const OGRMultiLineString &other)
Assignment operator.
Definition ogrmultilinestring.cpp:42
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:4161
OGRLineString ChildType
Type of child elements.
Definition ogr_geometry.h:4079
OGRLineString * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef().
Definition ogr_geometry.h:4110
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:4145
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:4089
OGRMultiLineString()=default
Create an empty multi line string collection.
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:4102
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:4096
OGRMultiLineString(OGRMultiLineString &&other)=default
Move constructor.
const OGRLineString * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef().
Definition ogr_geometry.h:4116
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:4083
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:4151
OGRMultiLineString & operator=(OGRMultiLineString &&other)=default
Move assignment operator.
OGRMultiLineString(const OGRMultiLineString &other)
Copy constructor.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:4156
A collection of OGRPoint.
Definition ogr_geometry.h:3745
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3833
OGRMultiPoint & operator=(OGRMultiPoint &&other)=default
Move assignment operator.
OGRMultiPoint()=default
Create an empty multi point collection.
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3788
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3769
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3849
OGRMultiPoint(const OGRMultiPoint &other)
Copy constructor.
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3782
OGRMultiPoint(OGRMultiPoint &&other)=default
Move constructor.
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3839
OGRPoint ChildType
Type of child elements.
Definition ogr_geometry.h:3765
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3844
const OGRPoint * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef().
Definition ogr_geometry.h:3802
OGRMultiPoint & operator=(const OGRMultiPoint &other)
Assignment operator.
Definition ogrmultipoint.cpp:46
OGRPoint * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef().
Definition ogr_geometry.h:3796
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3775
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:3259
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3363
OGRPolygon ChildType
Type of child elements.
Definition ogr_geometry.h:3286
OGRMultiPolygon(const OGRMultiPolygon &other)
Copy constructor.
OGRMultiPolygon & operator=(OGRMultiPolygon &&other)=default
Move assignment operator.
OGRPolygon * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef().
Definition ogr_geometry.h:3317
OGRMultiPolygon()=default
Create an empty multi polygon collection.
const OGRPolygon * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef().
Definition ogr_geometry.h:3323
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3309
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:3296
OGRMultiPolygon(OGRMultiPolygon &&other)=default
Move constructor.
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3290
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3352
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3303
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3368
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3358
A collection of non-overlapping OGRSurface.
Definition ogr_geometry.h:3099
const OGRSurface * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef().
Definition ogr_geometry.h:3181
OGRMultiSurface & operator=(OGRMultiSurface &&other)=default
Move assignment operator.
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3120
OGRSurface ChildType
Type of child elements.
Definition ogr_geometry.h:3116
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3197
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3133
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3139
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:3207
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:3126
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3202
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3191
OGRSurface * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef().
Definition ogr_geometry.h:3175
Interface for a point iterator.
Definition ogr_geometry.h:1260
virtual OGRBoolean getNextPoint(OGRPoint *p)=0
Returns the next point followed by the iterator.
static void destroy(OGRPointIterator *)
Destroys a point iterator.
Definition ogrcurve.cpp:469
Point class.
Definition ogr_geometry.h:1095
double getM() const
Return m.
Definition ogr_geometry.h:1171
void setX(double xIn)
Set x.
Definition ogr_geometry.h:1182
OGRPoint & 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:1206
void setM(double mIn)
Set m.
Definition ogr_geometry.h:1215
int getDimension() const override
Get the dimension of this object.
Definition ogrpoint.cpp:187
double getX() const
Return x.
Definition ogr_geometry.h:1153
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:1232
OGRBoolean IsEmpty() const override
Returns TRUE (non-zero) if the object has no points.
Definition ogr_geometry.h:1146
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:1194
double getZ() const
Return z.
Definition ogr_geometry.h:1165
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:1237
double getY() const
Return y.
Definition ogr_geometry.h:1159
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:2635
OGRPolygon & operator=(OGRPolygon &&other)=default
Move assignment operator.
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:2771
OGRLinearRing ChildType
Type of child elements.
Definition ogr_geometry.h:2675
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:2679
OGRPolygon(OGRPolygon &&other)=default
Move constructor.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2766
const OGRCurvePolygon * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:2761
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:2685
OGRPolygon(const OGRPolygon &other)
Copy constructor.
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:2692
OGRPolygon & 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:2698
OGRCurvePolygon * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:2755
PolyhedralSurface class.
Definition ogr_geometry.h:3418
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3460
const ChildType *const * end() const
Return end of iterator.
Definition ogr_geometry.h:3473
OGRPolyhedralSurface(const OGRPolyhedralSurface &other)
Copy constructor.
OGRPolygon * getGeometryRef(int i)
Fetch geometry from container.
Definition ogrpolyhedralsurface.cpp:862
OGRPolyhedralSurface & operator=(const OGRPolyhedralSurface &other)
Assignment operator.
Definition ogrpolyhedralsurface.cpp:44
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3467
OGRPolyhedralSurface(OGRPolyhedralSurface &&other)=default
Move constructor.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3546
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3454
OGRPolyhedralSurface()=default
Create an empty PolyhedralSurface.
virtual OGRErr addGeometry(const OGRGeometry *)
Add a new geometry to a collection.
Definition ogrpolyhedralsurface.cpp:744
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3551
OGRPolygon ChildType
Type of child elements.
Definition ogr_geometry.h:3450
OGRPolyhedralSurface & operator=(OGRPolyhedralSurface &&other)=default
Move assignment operator.
Simple container for a position.
Definition ogr_geometry.h:89
OGRRawPoint(double xIn, double yIn)
Constructor.
Definition ogr_geometry.h:97
double x
x
Definition ogr_geometry.h:102
double y
y
Definition ogr_geometry.h:104
OGRRawPoint()
Constructor.
Definition ogr_geometry.h:92
Abstract curve base class for OGRLineString and OGRCircularString.
Definition ogr_geometry.h:1473
double getY(int i) const
Get Y at vertex.
Definition ogr_geometry.h:1626
double getX(int i) const
Get X at vertex.
Definition ogr_geometry.h:1621
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:1550
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:1614
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:2370
virtual double get_GeodesicLength(const OGRSpatialReference *poSRSOverride=nullptr) const =0
Get the length of the surface, where curve edges are geodesic lines on the underlying ellipsoid of th...
virtual double get_GeodesicArea(const OGRSpatialReference *poSRSOverride=nullptr) const =0
Get the area of the surface object, considered as a surface on the underlying ellipsoid of the SRS at...
virtual double get_Area() const =0
Get the area of the surface object.
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:2819
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:2864
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:2874
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:2858
OGRTriangle & operator=(OGRTriangle &&other)=default
Move assignment operator.
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:2869
OGRTriangle(const OGRTriangle &other)
Copy constructor.
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:3602
const OGRTriangle * getGeometryRef(int i) const
See OGRPolyhedralSurface::getGeometryRef().
Definition ogr_geometry.h:3666
OGRTriangle * getGeometryRef(int i)
See OGRPolyhedralSurface::getGeometryRef().
Definition ogr_geometry.h:3660
OGRTriangulatedSurface & 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:3650
const ChildType *const * begin() const
Return begin of iterator.
Definition ogr_geometry.h:3644
OGRPolyhedralSurface * toUpperClass()
Return pointer of this in upper class.
Definition ogr_geometry.h:3679
const OGRPolyhedralSurface * toUpperClass() const
Return pointer of this in upper class.
Definition ogr_geometry.h:3685
void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition ogr_geometry.h:3695
OGRTriangulatedSurface & operator=(OGRTriangulatedSurface &&other)=default
Move assignment operator.
OGRTriangle ChildType
Type of child elements.
Definition ogr_geometry.h:3627
OGRTriangulatedSurface()=default
Constructor.
ChildType ** begin()
Return begin of iterator.
Definition ogr_geometry.h:3631
ChildType ** end()
Return end of iterator.
Definition ogr_geometry.h:3637
void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition ogr_geometry.h:3690
Options for formatting WKT output.
Definition ogr_geometry.h:46
int mPrecision
Precision of output for M coordinates. Interpretation depends on format.
Definition ogr_geometry.h:55
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:81
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:76
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:496
Interface for read and write JSON documents.
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition cpl_port.h:936
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1087
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition cpl_port.h:870
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:175
Forward definitions of GDAL/OGR/OSR C handle types.
void * OGRGeometryH
Opaque type for a geometry.
Definition gdal_fwd.h:96
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:386
OGRwkbByteOrder
Enumeration to describe byte order.
Definition ogr_core.h:607
@ wkbNDR
LSB/Intel/Vax: Least Significant Byte First.
Definition ogr_core.h:609
OGRwkbVariant
Output variants of WKB we support.
Definition ogr_core.h:540
@ wkbVariantOldOgc
Old-style 99-402 extended dimension (Z) WKB types.
Definition ogr_core.h:541
OGRwkbGeometryType
List of well known binary geometry types.
Definition ogr_core.h:405
int OGRErr
Type for a OGR error.
Definition ogr_core.h:370
Geometry coordinate precision class.
const char * OGRToOGCGeomType(OGRwkbGeometryType eGeomType, bool bCamelCase=false, bool bAddZM=false, bool bSpaceBeforeZM=false)
Map OGR geometry format constants to corresponding OGC geometry type.
Definition ogrgeometry.cpp:2605
OGRWktFormat
WKT Output formatting options.
Definition ogr_geometry.h:38
@ Default
Format as F when abs(value) < 1, otherwise as G.
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:4346
struct GEOSContextHandle_HS * GEOSContextHandle_t
GEOS context handle type.
Definition ogr_geometry.h:110
OGRwkbGeometryType OGRFromOGCGeomType(const char *pszGeomType)
Map OGC geometry format type to corresponding OGR constants.
Definition ogrgeometry.cpp:2526
std::unique_ptr< OGRGeometry, OGRGeometryUniquePtrDeleter > OGRGeometryUniquePtr
Unique pointer type for OGRGeometry.
Definition ogr_geometry.h:995
struct GEOSGeom_t * GEOSGeom
GEOS geometry type.
Definition ogr_geometry.h:108
void sfcgal_geometry_t
SFCGAL geometry type.
Definition ogr_geometry.h:112
Coordinate systems services.
OGRLayer::FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition ogrsf_frmts.h:470
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition ogrsf_frmts.h:478
Geometry coordinate precision.
Definition ogr_geomcoordinateprecision.h:40
WKB export options.
Definition ogr_geometry.h:326
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