Go to the documentation of this file.
32 #ifndef OGR_GEOMETRY_H_INCLUDED
33 #define OGR_GEOMETRY_H_INCLUDED
50 #ifndef DEFINEH_OGRGeometryH
51 #define DEFINEH_OGRGeometryH
85 static int defPrecision = getDefaultPrecision();
86 static bool defRound = getDefaultRound();
88 precision = defPrecision;
96 static int getDefaultPrecision();
97 static bool getDefaultRound();
238 virtual void visit(
const OGRPoint*) = 0;
333 friend class OGRCurveCollection;
335 unsigned int flags = 0;
337 OGRErr importPreambleFromWkt(
const char ** ppszInput,
338 int* pbHasZ,
int* pbHasM,
340 OGRErr importCurveCollectionFromWkt(
341 const char ** ppszInput,
342 int bAllowEmptyComponent,
343 int bAllowLineString,
345 int bAllowCompoundCurve,
348 OGRErr importPreambleFromWkb(
const unsigned char * pabyData,
352 OGRErr importPreambleOfCollectionFromWkb(
353 const unsigned char * pabyData,
357 size_t nMinSubGeomSize,
363 void HomogenizeDimensionalityWith(
OGRGeometry* poOtherGeom );
378 static const unsigned int OGR_G_NOT_EMPTY_POINT = 0x1;
379 static const unsigned int OGR_G_3D = 0x2;
380 static const unsigned int OGR_G_MEASURED = 0x4;
396 virtual int getDimension()
const = 0;
397 virtual int getCoordinateDimension()
const;
398 int CoordinateDimension()
const;
409 virtual void empty() = 0;
411 virtual
void getEnvelope(
OGREnvelope * psEnvelope ) const = 0;
412 virtual
void getEnvelope(
OGREnvelope3D * psEnvelope ) const = 0;
415 virtual
size_t WkbSize() const = 0;
416 OGRErr importFromWkb( const
GByte*,
size_t=static_cast<
size_t>(-1),
418 virtual
OGRErr importFromWkb( const
unsigned char *,
421 size_t& nBytesConsumedOut ) = 0;
424 virtual
OGRErr importFromWkt( const
char ** ppszInput ) = 0;
432 CPL_WARN_DEPRECATED(
"Use importFromWkt(const char**) instead")
435 return importFromWkt(
const_cast<const char**
>(ppszInput) );
439 OGRErr exportToWkt(
char ** ppszDstText,
447 OGRErr *err =
nullptr)
const = 0;
452 virtual const char *getGeometryName()
const = 0;
453 virtual void dumpReadable( FILE *,
const char * =
nullptr
454 ,
char** papszOptions =
nullptr )
const;
455 virtual void flattenTo2D() = 0;
456 virtual char * exportToGML(
const char*
const * papszOptions =
nullptr )
const;
457 virtual char * exportToKML()
const;
458 virtual char * exportToJson()
const;
470 virtual OGRBoolean hasCurveGeometry(
int bLookForNonLinear = FALSE)
const;
474 double dfMaxAngleStepSizeDegrees = 0,
482 virtual
void closeRings();
484 virtual
void setCoordinateDimension(
int nDimension );
486 virtual
void setMeasured(
OGRBoolean bIsMeasured );
494 virtual void segmentize(
double dfMaxLength);
510 virtual
double Distance( const
OGRGeometry * ) const ;
513 virtual
OGRGeometry *Buffer(
double dfDist,
int nQuadSegs = 30 )
527 OGRGeometry *SimplifyPreserveTopology(
double dTolerance)
534 virtual
double Distance3D( const
OGRGeometry *poOtherGeom ) const;
539 const CPL_WARN_DEPRECATED("Non standard method. "
540 "Use Intersects() instead");
542 const CPL_WARN_DEPRECATED("Non standard method. "
543 "Use Equals() instead");
545 const CPL_WARN_DEPRECATED("Non standard method. "
546 "Use SymDifference() instead");
548 const CPL_WARN_DEPRECATED("Non standard method. "
549 "Use Boundary() instead");
554 static
int bGenerate_DB2_V72_BYTE_ORDER;
557 virtual
void swapXY();
580 {
return cpl::down_cast<OGRPoint*>(
this); }
587 {
return cpl::down_cast<const OGRPoint*>(
this); }
594 {
return cpl::down_cast<OGRCurve*>(
this); }
601 {
return cpl::down_cast<const OGRCurve*>(
this); }
608 {
return cpl::down_cast<OGRSimpleCurve*>(
this); }
615 {
return cpl::down_cast<const OGRSimpleCurve*>(
this); }
622 {
return cpl::down_cast<OGRLineString*>(
this); }
629 {
return cpl::down_cast<const OGRLineString*>(
this); }
636 {
return cpl::down_cast<OGRLinearRing*>(
this); }
643 {
return cpl::down_cast<const OGRLinearRing*>(
this); }
650 {
return cpl::down_cast<OGRCircularString*>(
this); }
657 {
return cpl::down_cast<const OGRCircularString*>(
this); }
664 {
return cpl::down_cast<OGRCompoundCurve*>(
this); }
671 {
return cpl::down_cast<const OGRCompoundCurve*>(
this); }
678 {
return cpl::down_cast<OGRSurface*>(
this); }
685 {
return cpl::down_cast<const OGRSurface*>(
this); }
692 {
return cpl::down_cast<OGRPolygon*>(
this); }
699 {
return cpl::down_cast<const OGRPolygon*>(
this); }
706 {
return cpl::down_cast<OGRTriangle*>(
this); }
713 {
return cpl::down_cast<const OGRTriangle*>(
this); }
720 {
return cpl::down_cast<OGRCurvePolygon*>(
this); }
727 {
return cpl::down_cast<const OGRCurvePolygon*>(
this); }
734 {
return cpl::down_cast<OGRGeometryCollection*>(
this); }
741 {
return cpl::down_cast<const OGRGeometryCollection*>(
this); }
748 {
return cpl::down_cast<OGRMultiPoint*>(
this); }
755 {
return cpl::down_cast<const OGRMultiPoint*>(
this); }
762 {
return cpl::down_cast<OGRMultiLineString*>(
this); }
769 {
return cpl::down_cast<const OGRMultiLineString*>(
this); }
776 {
return cpl::down_cast<OGRMultiPolygon*>(
this); }
783 {
return cpl::down_cast<const OGRMultiPolygon*>(
this); }
790 {
return cpl::down_cast<OGRMultiCurve*>(
this); }
797 {
return cpl::down_cast<const OGRMultiCurve*>(
this); }
804 {
return cpl::down_cast<OGRMultiSurface*>(
this); }
811 {
return cpl::down_cast<const OGRMultiSurface*>(
this); }
818 {
return cpl::down_cast<OGRPolyhedralSurface*>(
this); }
825 {
return cpl::down_cast<const OGRPolyhedralSurface*>(
this); }
832 {
return cpl::down_cast<OGRTriangulatedSurface*>(
this); }
839 {
return cpl::down_cast<const OGRTriangulatedSurface*>(
this); }
844 struct CPL_DLL OGRGeometryUniquePtrDeleter
857 #define OGR_FORBID_DOWNCAST_TO(name) \
858 inline OGR ## name * to ## name() = delete; \
859 inline const OGR ## name * to ## name() const = delete;
861 #define OGR_FORBID_DOWNCAST_TO_POINT OGR_FORBID_DOWNCAST_TO(Point)
862 #define OGR_FORBID_DOWNCAST_TO_CURVE OGR_FORBID_DOWNCAST_TO(Curve)
863 #define OGR_FORBID_DOWNCAST_TO_SIMPLE_CURVE OGR_FORBID_DOWNCAST_TO(SimpleCurve)
864 #define OGR_FORBID_DOWNCAST_TO_LINESTRING OGR_FORBID_DOWNCAST_TO(LineString)
865 #define OGR_FORBID_DOWNCAST_TO_LINEARRING OGR_FORBID_DOWNCAST_TO(LinearRing)
866 #define OGR_FORBID_DOWNCAST_TO_CIRCULARSTRING OGR_FORBID_DOWNCAST_TO(CircularString)
867 #define OGR_FORBID_DOWNCAST_TO_COMPOUNDCURVE OGR_FORBID_DOWNCAST_TO(CompoundCurve)
868 #define OGR_FORBID_DOWNCAST_TO_SURFACE OGR_FORBID_DOWNCAST_TO(Surface)
869 #define OGR_FORBID_DOWNCAST_TO_CURVEPOLYGON OGR_FORBID_DOWNCAST_TO(CurvePolygon)
870 #define OGR_FORBID_DOWNCAST_TO_POLYGON OGR_FORBID_DOWNCAST_TO(Polygon)
871 #define OGR_FORBID_DOWNCAST_TO_TRIANGLE OGR_FORBID_DOWNCAST_TO(Triangle)
872 #define OGR_FORBID_DOWNCAST_TO_MULTIPOINT OGR_FORBID_DOWNCAST_TO(MultiPoint)
873 #define OGR_FORBID_DOWNCAST_TO_MULTICURVE OGR_FORBID_DOWNCAST_TO(MultiCurve)
874 #define OGR_FORBID_DOWNCAST_TO_MULTILINESTRING OGR_FORBID_DOWNCAST_TO(MultiLineString)
875 #define OGR_FORBID_DOWNCAST_TO_MULTISURFACE OGR_FORBID_DOWNCAST_TO(MultiSurface)
876 #define OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON OGR_FORBID_DOWNCAST_TO(MultiPolygon)
877 #define OGR_FORBID_DOWNCAST_TO_GEOMETRYCOLLECTION OGR_FORBID_DOWNCAST_TO(GeometryCollection)
878 #define OGR_FORBID_DOWNCAST_TO_POLYHEDRALSURFACE OGR_FORBID_DOWNCAST_TO(PolyhedralSurface)
879 #define OGR_FORBID_DOWNCAST_TO_TIN OGR_FORBID_DOWNCAST_TO(TriangulatedSurface)
881 #define OGR_ALLOW_UPCAST_TO(name) \
882 inline OGR ## name * to ## name() { return this; } \
883 inline const OGR ## name * to ## name() const { return this; }
885 #ifndef SUPPRESS_OGR_ALLOW_CAST_TO_THIS_WARNING
886 #define CAST_TO_THIS_WARNING CPL_WARN_DEPRECATED("Casting to this is useless")
888 #define CAST_TO_THIS_WARNING
891 #define OGR_ALLOW_CAST_TO_THIS(name) \
892 inline OGR ## name * to ## name() CAST_TO_THIS_WARNING { return this; } \
893 inline const OGR ## name * to ## name() const CAST_TO_THIS_WARNING { return this; }
895 #define OGR_FORBID_DOWNCAST_TO_ALL_CURVES \
896 OGR_FORBID_DOWNCAST_TO_CURVE \
897 OGR_FORBID_DOWNCAST_TO_SIMPLE_CURVE \
898 OGR_FORBID_DOWNCAST_TO_LINESTRING \
899 OGR_FORBID_DOWNCAST_TO_LINEARRING \
900 OGR_FORBID_DOWNCAST_TO_CIRCULARSTRING \
901 OGR_FORBID_DOWNCAST_TO_COMPOUNDCURVE
903 #define OGR_FORBID_DOWNCAST_TO_ALL_SURFACES \
904 OGR_FORBID_DOWNCAST_TO_SURFACE \
905 OGR_FORBID_DOWNCAST_TO_CURVEPOLYGON \
906 OGR_FORBID_DOWNCAST_TO_POLYGON \
907 OGR_FORBID_DOWNCAST_TO_TRIANGLE \
908 OGR_FORBID_DOWNCAST_TO_POLYHEDRALSURFACE \
909 OGR_FORBID_DOWNCAST_TO_TIN
911 #define OGR_FORBID_DOWNCAST_TO_ALL_SINGLES \
912 OGR_FORBID_DOWNCAST_TO_POINT \
913 OGR_FORBID_DOWNCAST_TO_ALL_CURVES \
914 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
916 #define OGR_FORBID_DOWNCAST_TO_ALL_MULTI \
917 OGR_FORBID_DOWNCAST_TO_GEOMETRYCOLLECTION \
918 OGR_FORBID_DOWNCAST_TO_MULTIPOINT \
919 OGR_FORBID_DOWNCAST_TO_MULTICURVE \
920 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING \
921 OGR_FORBID_DOWNCAST_TO_MULTISURFACE \
922 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
946 OGRPoint(
double x,
double y,
double z );
947 OGRPoint(
double x,
double y,
double z,
double m );
949 static OGRPoint* createXYM(
double x,
double y,
double m );
955 size_t WkbSize()
const override;
959 size_t& nBytesConsumedOut )
override;
979 OGRErr *err =
nullptr)
const override;
984 virtual void empty()
override;
988 {
return !(flags & OGR_G_NOT_EMPTY_POINT); }
992 double getX()
const {
return x; }
994 double getY()
const {
return y; }
996 double getZ()
const {
return z; }
998 double getM()
const {
return m; }
1005 void setX(
double xIn ) { x = xIn;
if( std::isnan(x) || std::isnan(y) ) flags &= ~OGR_G_NOT_EMPTY_POINT;
else flags |= OGR_G_NOT_EMPTY_POINT; }
1009 void setY(
double yIn ) { y = yIn;
if( std::isnan(x) || std::isnan(y) ) flags &= ~OGR_G_NOT_EMPTY_POINT;
else flags |= OGR_G_NOT_EMPTY_POINT; }
1014 { z = zIn; flags |= OGR_G_3D; }
1019 { m = mIn; flags |= OGR_G_MEASURED; }
1034 virtual void swapXY()
override;
1036 OGR_ALLOW_CAST_TO_THIS(Point)
1037 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
1038 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1039 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
1077 virtual OGRCurveCasterToLineString GetCasterToLineString()
const = 0;
1078 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
const = 0;
1089 class CPL_DLL ConstIterator
1092 std::unique_ptr<Private> m_poPrivate;
1094 ConstIterator(
const OGRCurve* poSelf,
bool bStart);
1095 ConstIterator(ConstIterator&& oOther) noexcept;
1096 ConstIterator& operator=(ConstIterator&& oOther);
1099 ConstIterator& operator++();
1100 bool operator!=(
const ConstIterator& it)
const;
1124 ConstIterator
begin()
const;
1126 ConstIterator
end()
const;
1129 virtual OGRCurve *clone()
const override = 0;
1132 virtual double get_Length()
const = 0;
1133 virtual void StartPoint(
OGRPoint * )
const = 0;
1134 virtual void EndPoint(
OGRPoint * )
const = 0;
1135 virtual int get_IsClosed()
const;
1136 virtual void Value(
double,
OGRPoint * )
const = 0;
1137 virtual OGRLineString* CurveToLine(
double dfMaxAngleStepSizeDegrees = 0,
1138 const char*
const* papszOptions =
nullptr)
1140 virtual int getDimension()
const override;
1143 virtual int getNumPoints()
const = 0;
1146 virtual double get_Area()
const = 0;
1147 virtual int isClockwise()
const;
1152 {
return cpl::down_cast<OGRSimpleCurve*>(
this); }
1157 {
return cpl::down_cast<const OGRSimpleCurve*>(
this); }
1163 OGR_FORBID_DOWNCAST_TO_POINT
1164 OGR_ALLOW_CAST_TO_THIS(Curve)
1165 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
1166 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
1171 inline OGRCurve::ConstIterator
begin(
const OGRCurve* poCurve) {
return poCurve->begin(); }
1173 inline OGRCurve::ConstIterator
end(
const OGRCurve* poCurve) {
return poCurve->end(); }
1218 void setX(
double xIn );
1222 void setY(
double yIn );
1226 void setZ(
double zIn );
1230 void setM(
double mIn );
1263 OGRErr importFromWKTListOnly(
const char ** ppszInput,
int bHasZ,
int bHasM,
1269 virtual double get_LinearArea()
const;
1275 class CPL_DLL Iterator
1278 std::unique_ptr<Private> m_poPrivate;
1282 Iterator(Iterator&& oOther) noexcept;
1285 Iterator& operator++();
1286 bool operator!=(
const Iterator& it)
const;
1292 class CPL_DLL ConstIterator
1295 std::unique_ptr<Private> m_poPrivate;
1298 ConstIterator(ConstIterator&& oOther) noexcept;
1301 ConstIterator& operator++();
1302 bool operator!=(
const ConstIterator& it)
const;
1335 ConstIterator
begin()
const;
1337 ConstIterator
end()
const;
1340 virtual size_t WkbSize()
const override;
1341 virtual OGRErr importFromWkb(
const unsigned char *,
1344 size_t& nBytesConsumedOut )
override;
1353 OGRErr importFromWkt(
const char ** )
override;
1364 OGRErr *err =
nullptr)
const override;
1367 virtual void empty()
override;
1368 virtual void getEnvelope(
OGREnvelope * psEnvelope )
const override;
1369 virtual void getEnvelope(
OGREnvelope3D * psEnvelope )
const override;
1374 virtual double get_Length()
const override;
1375 virtual void StartPoint(
OGRPoint * )
const override;
1376 virtual void EndPoint(
OGRPoint * )
const override;
1377 virtual void Value(
double,
OGRPoint * )
const override;
1378 virtual double Project(
const OGRPoint * )
const;
1379 virtual OGRLineString* getSubLine(
double,
double,
int )
const;
1383 void getPoint(
int,
OGRPoint * )
const;
1384 double getX(
int i )
const {
return paoPoints[i].
x; }
1385 double getY(
int i )
const {
return paoPoints[i].
y; }
1386 double getZ(
int i )
const;
1387 double getM(
int i )
const;
1393 virtual void setCoordinateDimension(
int nDimension )
override;
1394 virtual void set3D(
OGRBoolean bIs3D )
override;
1395 virtual void setMeasured(
OGRBoolean bIsMeasured )
override;
1396 void setNumPoints(
int nNewPointCount,
1397 int bZeroizeNewContent = TRUE );
1399 void setPoint(
int,
double,
double );
1400 void setZ(
int,
double );
1401 void setM(
int,
double );
1402 void setPoint(
int,
double,
double,
double );
1403 void setPointM(
int,
double,
double,
double );
1404 void setPoint(
int,
double,
double,
double,
double );
1405 void setPoints(
int,
const OGRRawPoint *,
const double * =
nullptr );
1406 void setPointsM(
int,
const OGRRawPoint *,
const double * );
1407 void setPoints(
int,
const OGRRawPoint *,
const double *,
const double * );
1408 void setPoints(
int,
const double * padfX,
const double * padfY,
1409 const double *padfZIn =
nullptr );
1410 void setPointsM(
int,
const double * padfX,
const double * padfY,
1411 const double *padfMIn =
nullptr );
1412 void setPoints(
int,
const double * padfX,
const double * padfY,
1413 const double *padfZIn,
const double *padfMIn );
1415 void addPoint(
double,
double );
1416 void addPoint(
double,
double,
double );
1417 void addPointM(
double,
double,
double );
1418 void addPoint(
double,
double,
double,
double );
1420 bool removePoint(
int );
1422 void getPoints(
OGRRawPoint *,
double * =
nullptr )
const;
1423 void getPoints(
void* pabyX,
int nXStride,
1424 void* pabyY,
int nYStride,
1425 void* pabyZ =
nullptr,
int nZStride = 0,
1426 void* pabyM =
nullptr,
int nMStride = 0 )
const;
1429 int nStartVertex = 0,
int nEndVertex = -1 );
1430 void reversePoints(
void );
1435 virtual void flattenTo2D()
override;
1436 virtual void segmentize(
double dfMaxLength)
override;
1438 virtual void swapXY()
override;
1440 OGR_ALLOW_UPCAST_TO(Curve)
1441 OGR_ALLOW_CAST_TO_THIS(SimpleCurve)
1446 inline OGRSimpleCurve::Iterator
begin(
OGRSimpleCurve* poCurve) {
return poCurve->begin(); }
1448 inline OGRSimpleCurve::Iterator
end(
OGRSimpleCurve* poCurve) {
return poCurve->end(); }
1451 inline OGRSimpleCurve::ConstIterator
begin(
const OGRSimpleCurve* poCurve) {
return poCurve->begin(); }
1453 inline OGRSimpleCurve::ConstIterator
end(
const OGRSimpleCurve* poCurve) {
return poCurve->end(); }
1478 virtual OGRCurveCasterToLineString GetCasterToLineString()
1480 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
1497 const char*
const* papszOptions =
nullptr )
1500 const char*
const* papszOptions =
nullptr )
const override;
1501 virtual double get_Area()
const override;
1516 OGR_ALLOW_UPCAST_TO(SimpleCurve)
1517 OGR_ALLOW_CAST_TO_THIS(LineString)
1551 virtual size_t WkbSize()
const override;
1555 size_t& nBytesConsumedOut )
override;
1566 virtual size_t _WkbSize(
int _flags )
const;
1568 const unsigned char *,
size_t,
1569 size_t& nBytesConsumedOut );
1571 unsigned char * )
const;
1573 virtual OGRCurveCasterToLineString GetCasterToLineString()
1575 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
1592 virtual void reverseWindingOrder();
1595 int bTestEnvelope = TRUE )
const;
1597 int bTestEnvelope = TRUE )
const;
1608 OGR_ALLOW_UPCAST_TO(LineString)
1609 OGR_ALLOW_CAST_TO_THIS(LinearRing)
1631 void ExtendEnvelopeWithCircular(
OGREnvelope * psEnvelope )
const;
1633 int IsFullCircle(
double& cx,
double& cy,
double& square_R )
const;
1637 virtual OGRCurveCasterToLineString GetCasterToLineString()
1639 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
1657 size_t& nBytesConsumedOut )
override;
1677 OGRErr *err =
nullptr)
const override;
1688 const char*
const* papszOptions =
nullptr )
1691 virtual double get_Area()
const override;
1696 virtual void segmentize(
double dfMaxLength )
override;
1700 double dfMaxAngleStepSizeDegrees = 0,
1701 const char*
const* papszOptions =
nullptr)
const override;
1711 OGR_ALLOW_UPCAST_TO(SimpleCurve)
1712 OGR_ALLOW_CAST_TO_THIS(CircularString)
1729 class CPL_DLL OGRCurveCollection
1738 int nCurveCount = 0;
1742 OGRCurveCollection();
1743 OGRCurveCollection(
const OGRCurveCollection& other);
1744 ~OGRCurveCollection();
1746 OGRCurveCollection&
operator=(
const OGRCurveCollection& other);
1756 OGRCurve**
end() {
return papoCurves + nCurveCount; }
1762 const OGRCurve*
const*
end()
const {
return papoCurves + nCurveCount; }
1773 const unsigned char * pabyData,
1775 size_t& nDataOffset,
1777 size_t nMinSubGeomSize,
1779 OGRErr importBodyFromWkb(
1781 const unsigned char * pabyData,
1783 bool bAcceptCompoundCurve,
1787 size_t& nBytesConsumedOut );
1795 int nNewDimension );
1799 int getNumCurves()
const;
1801 const OGRCurve *getCurve(
int )
const;
1804 OGRErr removeCurve(
int iIndex,
bool bDelete =
true );
1832 OGRCurveCollection oCC{};
1835 double dfToleranceEps,
1841 OGRLineString* CurveToLineInternal(
double dfMaxAngleStepSizeDegrees,
1842 const char*
const* papszOptions,
1843 int bIsLinearRing )
const;
1854 virtual OGRCurveCasterToLineString GetCasterToLineString()
1856 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
1884 virtual size_t WkbSize()
const override;
1888 size_t& nBytesConsumedOut )
override;
1908 OGRErr *err =
nullptr)
const override;
1912 virtual void empty()
override;
1923 const char*
const* papszOptions =
nullptr )
1928 virtual double get_Area()
const override;
1934 int getNumCurves()
const;
1936 const OGRCurve *getCurve(
int )
const;
1945 OGRErr addCurve(
const OGRCurve*,
double dfToleranceEps = 1e-14 );
1946 OGRErr addCurveDirectly(
OGRCurve*,
double dfToleranceEps = 1e-14 );
1955 virtual void segmentize(
double dfMaxLength)
override;
1959 double dfMaxAngleStepSizeDegrees = 0,
1960 const char*
const* papszOptions =
nullptr)
const override;
1964 virtual void swapXY()
override;
1966 OGR_ALLOW_UPCAST_TO(Curve)
1967 OGR_ALLOW_CAST_TO_THIS(CompoundCurve)
1995 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const = 0;
1996 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
const = 0;
2000 virtual double get_Area()
const = 0;
2002 {
return PointOnSurfaceInternal(poPoint); }
2010 OGR_FORBID_DOWNCAST_TO_POINT
2011 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
2012 OGR_ALLOW_CAST_TO_THIS(Surface)
2013 OGR_FORBID_DOWNCAST_TO_ALL_MULTI
2040 virtual int checkRing(
OGRCurve * poNewRing )
const;
2052 OGRCurveCollection oCC{};
2054 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
2056 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
2090 virtual void empty()
override;
2094 virtual void segmentize(
double dfMaxLength )
override;
2098 double dfMaxAngleStepSizeDegrees = 0,
2099 const char*
const* papszOptions =
nullptr )
const override;
2102 virtual double get_Area()
const override;
2105 virtual size_t WkbSize()
const override;
2109 size_t& nBytesConsumedOut )
override;
2129 OGRErr *err =
nullptr)
const override;
2138 double dfMaxAngleStepSizeDegrees = 0,
2139 const char*
const* papszOptions =
nullptr )
const;
2168 virtual void swapXY()
override;
2170 OGR_ALLOW_UPCAST_TO(Surface)
2171 OGR_ALLOW_CAST_TO_THIS(CurvePolygon)
2209 virtual int checkRing(
OGRCurve * poNewRing )
const override;
2210 virtual OGRErr importFromWKTListOnly(
const char ** ppszInput,
2211 int bHasZ,
int bHasM,
2218 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
2220 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
2254 const char*
const* papszOptions =
nullptr )
const override;
2256 double dfMaxAngleStepSizeDegrees = 0,
2257 const char*
const* papszOptions =
nullptr)
const override;
2260 virtual size_t WkbSize()
const override;
2264 size_t& nBytesConsumedOut )
override;
2284 OGRErr *err =
nullptr)
const override;
2288 double dfMaxAngleStepSizeDegrees = 0,
2289 const char*
const* papszOptions =
nullptr )
const override;
2311 OGR_ALLOW_UPCAST_TO(CurvePolygon)
2312 OGR_ALLOW_CAST_TO_THIS(Polygon)
2342 bool quickValidityCheck()
const;
2346 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
const override;
2347 virtual OGRErr importFromWKTListOnly(
const char ** ppszInput,
2348 int bHasZ,
int bHasM,
2351 double*& padfZ )
override;
2369 size_t& nBytesConsumedOut )
override;
2386 OGR_ALLOW_UPCAST_TO(Polygon)
2387 OGR_ALLOW_CAST_TO_THIS(Triangle)
2403 OGRErr importFromWkbInternal(
const unsigned char * pabyData,
2407 OGRErr importFromWktInternal(
const char **ppszInput,
int nRecLevel );
2415 const std::string& exclude = std::string())
const;
2449 virtual void empty()
override;
2453 virtual void segmentize(
double dfMaxLength)
override;
2457 const char*
const* papszOptions =
nullptr )
const override;
2459 double dfMaxAngleStepSizeDegrees = 0,
2460 const char*
const* papszOptions =
nullptr )
const override;
2463 virtual size_t WkbSize()
const override;
2467 size_t& nBytesConsumedOut )
override;
2487 OGRErr *err =
nullptr)
const override;
2489 virtual double get_Length()
const;
2490 virtual double get_Area()
const;
2498 int getNumGeometries()
const;
2511 virtual OGRErr removeGeometry(
int iIndex,
int bDelete = TRUE );
2517 virtual void swapXY()
override;
2525 OGR_FORBID_DOWNCAST_TO_POINT
2526 OGR_FORBID_DOWNCAST_TO_ALL_CURVES
2527 OGR_FORBID_DOWNCAST_TO_ALL_SURFACES
2528 OGR_ALLOW_CAST_TO_THIS(GeometryCollection)
2602 OGRErr *err =
nullptr)
const override;
2630 OGR_ALLOW_CAST_TO_THIS(MultiSurface)
2631 OGR_ALLOW_UPCAST_TO(GeometryCollection)
2632 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
2633 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING
2634 OGR_FORBID_DOWNCAST_TO_MULTICURVE
2667 OGRErr _addGeometryWithExpectedSubGeometryType(
2670 OGRErr _addGeometryDirectlyWithExpectedSubGeometryType(
2719 OGRErr *err =
nullptr)
const override;
2735 OGR_ALLOW_CAST_TO_THIS(MultiPolygon)
2736 OGR_ALLOW_UPCAST_TO(MultiSurface)
2767 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
2769 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
2772 virtual const char* getSubGeometryName()
const;
2776 virtual OGRPolyhedralSurfaceCastToMultiPolygon GetCasterToMultiPolygon()
2804 virtual size_t WkbSize()
const override;
2810 size_t& nBytesConsumedOut )
override;
2830 OGRErr *err =
nullptr)
const override;
2835 virtual void empty()
override;
2844 virtual double get_Area()
const override;
2860 virtual void swapXY()
override;
2868 OGR_ALLOW_CAST_TO_THIS(PolyhedralSurface)
2869 OGR_ALLOW_UPCAST_TO(Surface)
2900 virtual const char* getSubGeometryName()
const override;
2903 virtual OGRPolyhedralSurfaceCastToMultiPolygon GetCasterToMultiPolygon()
2954 OGR_ALLOW_CAST_TO_THIS(TriangulatedSurface)
2955 OGR_ALLOW_UPCAST_TO(PolyhedralSurface)
2981 OGRErr importFromWkt_Bracketed(
const char **,
int bHasM,
int bHasZ );
3036 OGRErr *err =
nullptr)
const override;
3053 OGR_ALLOW_CAST_TO_THIS(MultiPoint)
3054 OGR_ALLOW_UPCAST_TO(GeometryCollection)
3055 OGR_FORBID_DOWNCAST_TO_MULTILINESTRING
3056 OGR_FORBID_DOWNCAST_TO_MULTICURVE
3057 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
3058 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
3142 OGRErr *err =
nullptr)
const override;
3161 OGR_ALLOW_CAST_TO_THIS(MultiCurve)
3162 OGR_ALLOW_UPCAST_TO(GeometryCollection)
3163 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
3164 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
3165 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
3237 OGRErr *err =
nullptr)
const override;
3253 OGR_ALLOW_CAST_TO_THIS(MultiLineString)
3254 OGR_ALLOW_UPCAST_TO(MultiCurve)
3255 OGR_FORBID_DOWNCAST_TO_MULTIPOINT
3256 OGR_FORBID_DOWNCAST_TO_MULTISURFACE
3257 OGR_FORBID_DOWNCAST_TO_MULTIPOLYGON
3282 static OGRErr createFromFgfInternal(
const unsigned char *pabyData,
3286 int *pnBytesConsumed,
3292 static OGRErr createFromWkb(
const void * pabyData,
3297 size_t& nBytesConsumedOut );
3307 CPL_WARN_DEPRECATED(
"Use createFromWkt(const char**, ...) instead")
3309 return createFromWkt(
const_cast<const char**
>(ppszInput), poSRS, ppoGeom);
3314 static OGRGeometry *createFromGML(
const char * );
3317 static OGRGeometry *createFromGeoJson(
const char *,
int = -1 );
3325 bool bOnlyInOrder =
true );
3332 const char*
const* papszOptions =
nullptr );
3338 int *pbResultValidGeometry,
3339 const char **papszOptions =
nullptr);
3340 static bool haveGEOS();
3347 std::unique_ptr<Private> d;
3356 char** papszOptions,
3360 approximateArcAngles(
double dfX,
double dfY,
double dfZ,
3361 double dfPrimaryRadius,
double dfSecondaryAxis,
3363 double dfStartAngle,
double dfEndAngle,
3364 double dfMaxAngleStepSizeDegrees,
3365 const bool bUseMaxGap =
false );
3367 static int GetCurveParameters(
double x0,
double y0,
3368 double x1,
double y1,
3369 double x2,
double y2,
3370 double& R,
double& cx,
double& cy,
3371 double& alpha0,
double& alpha1,
3374 double x0,
double y0,
double z0,
3375 double x1,
double y1,
double z1,
3376 double x2,
double y2,
double z2,
3378 double dfMaxAngleStepSizeDegrees,
3379 const char*
const * papszOptions =
nullptr );
3380 static OGRCurve* curveFromLineString(
3382 const char*
const * papszOptions =
nullptr);
3389 typedef struct _OGRPreparedGeometry OGRPreparedGeometry;
3391 struct CPL_DLL OGRPreparedGeometryUniquePtrDeleter
3393 void operator()(OGRPreparedGeometry*)
const;
virtual void visit(OGRPoint *)=0
Visit OGRPoint.
virtual void getEnvelope(OGREnvelope *psEnvelope) const override
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure.
Definition: ogrlinestring.cpp:2249
virtual void getEnvelope(OGREnvelope *psEnvelope) const override
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure.
Definition: ogrcurvepolygon.cpp:615
OGRErr importFromWkt(char **ppszInput)
Deprecated.
Definition: ogr_geometry.h:430
OGRBoolean Is3D() const
Definition: ogr_geometry.h:405
virtual OGRBoolean IsEmpty() const =0
Returns TRUE (non-zero) if the object has no points.
OGRMultiPolygon * toMultiPolygon()
Down-cast to OGRMultiPolygon*.
Definition: ogr_geometry.h:775
OGRPolygon ChildType
Type of child elements.
Definition: ogr_geometry.h:2684
OGRLineString ChildType
Type of child elements.
Definition: ogr_geometry.h:3202
OGRPolygon * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:2701
virtual void setCoordinateDimension(int nDimension)
Set the coordinate dimension.
Definition: ogrgeometry.cpp:1024
virtual OGRErr addRingDirectly(OGRCurve *)
Add a ring to a polygon.
Definition: ogrcurvepolygon.cpp:416
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:3244
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:3207
A collection of OGRCurve.
Definition: ogr_geometry.h:3083
static OGRLineString * CastToLineString(OGRCurve *poCurve)
Cast to linestring.
Definition: ogrcurve.cpp:352
OGRRawPoint()
Constructor.
Definition: ogr_geometry.h:107
virtual OGRBoolean isCompatibleSubType(OGRwkbGeometryType) const
Returns whether a geometry of the specified geometry type can be a member of this collection.
Definition: ogrgeometrycollection.cpp:1181
double getX(int i) const
Get X at vertex.
Definition: ogr_geometry.h:1384
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2795
virtual double get_Area() const =0
Get the area of the surface object.
virtual double get_AreaOfCurveSegments() const =0
Get the area of the purely curve portions of a (closed) curve.
bool operator==(const OGRGeometry &other) const
Returns if two geometries are equal.
Definition: ogr_geometry.h:390
Concrete representation of a multi-vertex line.
Definition: ogr_geometry.h:1467
int getNumGeometries() const
Fetch number of geometries in PolyhedralSurface.
Definition: ogrpolyhedralsurface.cpp:797
OGRPolygon * getGeometryRef(int i)
Fetch geometry from container.
Definition: ogrpolyhedralsurface.cpp:819
virtual OGRBoolean Contains(const OGRGeometry *) const
Test for containment.
Definition: ogrgeometry.cpp:5296
A collection of non-overlapping OGRPolygon.
Definition: ogr_geometry.h:2657
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:203
static OGRMultiPolygon * CastToMultiPolygon(OGRPolyhedralSurface *poPS)
Casts the OGRPolyhedralSurface to an OGRMultiPolygon.
Definition: ogrpolyhedralsurface.cpp:708
OGRErr addGeometryDirectly(OGRGeometry *poNewGeom)
Add a geometry directly to the container.
Definition: ogrpolyhedralsurface.cpp:765
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:3042
virtual OGRSimpleCurve * clone() const override=0
Make a copy of this object.
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2801
Interface for a point iterator.
Definition: ogr_geometry.h:1052
OGRSurface ChildType
Type of child elements.
Definition: ogr_geometry.h:2567
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2572
virtual void flattenTo2D() override
Convert geometry to strictly 2D. In a sense this converts all Z coordinates to 0.0.
Definition: ogrcurvepolygon.cpp:149
virtual void closeRings()
Force rings to be closed.
Definition: ogrgeometry.cpp:5432
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2626
Utility class to store a collection of curves.
Definition: ogr_geometry.h:1829
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2306
virtual OGRGeometry * clone() const =0
Make a copy of this object.
virtual int getNumPoints() const override
Fetch vertex count.
Definition: ogr_geometry.h:1382
virtual OGRwkbGeometryType getGeometryType() const =0
Fetch geometry type.
virtual void swapXY()
Swap x and y coordinates.
Definition: ogrgeometry.cpp:6122
OGRErr importFromWkt(const char **) override
deprecated
Definition: ogrlinestring.cpp:1731
virtual OGRwkbGeometryType getGeometryType() const override
Returns the WKB Type of PolyhedralSurface.
Definition: ogrpolyhedralsurface.cpp:120
OGRSimpleCurve * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:1509
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const override
Returns if this geometry is or has curve geometry.
Definition: ogrgeometrycollection.cpp:1192
OGRCurve * toCurve()
Down-cast to OGRCurve*.
Definition: ogr_geometry.h:593
OGRWktFormat format
Formatting type.
Definition: ogr_geometry.h:79
OGRLayer::FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition: ogrsf_frmts.h:325
virtual OGRBoolean IsEmpty() const override
Returns TRUE (non-zero) if the object has no points.
Definition: ogrcurvepolygon.cpp:713
OGRSurface * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:2612
OGRGeometry visitor interface.
Definition: ogr_geometry.h:231
OGRWktOptions()
Constructor.
Definition: ogr_geometry.h:82
virtual OGRErr exportToWkb(OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc) const override
Convert a geometry into well known binary format.
Definition: ogrlinestring.cpp:1632
void setM(double mIn)
Set m.
Definition: ogr_geometry.h:1018
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2922
virtual size_t WkbSize() const override
Returns size of related binary representation.
Definition: ogrlinestring.cpp:188
const OGRLineString * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:1603
virtual OGRPolygon * CurvePolyToPoly(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const
Return a polygon from a curve polygon.
Definition: ogrcurvepolygon.cpp:565
ChildType ** begin()
Return begin of curve iterator.
Definition: ogr_geometry.h:1873
virtual void set3D(OGRBoolean bIs3D)
Add or remove the Z coordinate dimension.
Definition: ogrgeometry.cpp:1047
const OGRCompoundCurve * toCompoundCurve() const
Down-cast to OGRCompoundCurve*.
Definition: ogr_geometry.h:670
Create geometry objects from well known text/binary.
Definition: ogr_geometry.h:3280
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2695
OGRMultiSurface * toMultiSurface()
Down-cast to OGRMultiSurface*.
Definition: ogr_geometry.h:803
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2728
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2864
virtual OGRBoolean isCompatibleSubType(OGRwkbGeometryType) const override
Returns whether a geometry of the specified geometry type can be a member of this collection.
Definition: ogrmulticurve.cpp:144
const OGRPolygon * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2377
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:3002
static OGRGeometry * FromHandle(OGRGeometryH hGeom)
Convert a OGRGeometryH to a OGRGeometry*.
Definition: ogr_geometry.h:572
const OGRSurface * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:2614
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:3112
OGRLinearRing ChildType
Type of child elements.
Definition: ogr_geometry.h:2232
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const override
Returns if this geometry is or has curve geometry.
Definition: ogrcurvepolygon.cpp:590
A collection of 1 or more geometry objects.
Definition: ogr_geometry.h:2401
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const
Returns if this geometry is or has curve geometry.
Definition: ogrgeometry.cpp:3201
@ wkbVariantOldOgc
Old-style 99-402 extended dimension (Z) WKB types.
Definition: ogr_core.h:486
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:3008
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:157
virtual const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition: ogrpolyhedralsurface.cpp:106
OGRGeometry * getGeometryRef(int)
Fetch geometry from container.
Definition: ogrgeometrycollection.cpp:261
OGRCircularString * toCircularString()
Down-cast to OGRCircularString*.
Definition: ogr_geometry.h:649
PolyhedralSurface class.
Definition: ogr_geometry.h:2761
virtual int isClockwise() const
Returns TRUE if the ring has clockwise winding (or less than 2 points)
Definition: ogrcurve.cpp:673
const OGRCircularString * toCircularString() const
Down-cast to OGRCircularString*.
Definition: ogr_geometry.h:656
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2730
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1961
virtual void Value(double, OGRPoint *) const =0
Fetch point at given distance along curve.
virtual const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition: ogrgeometrycollection.cpp:217
OGRTriangulatedSurface * toTriangulatedSurface()
Down-cast to OGRTriangulatedSurface*.
Definition: ogr_geometry.h:831
const OGRTriangle * toTriangle() const
Down-cast to OGRTriangle*.
Definition: ogr_geometry.h:712
const OGRPolygon * toPolygon() const
Down-cast to OGRPolygon*.
Definition: ogr_geometry.h:698
virtual OGRGeometry * getLinearGeometry(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const
Return, possibly approximate, non-curve version of this geometry.
Definition: ogrgeometry.cpp:3234
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:326
A collection of OGRPoint.
Definition: ogr_geometry.h:2978
virtual OGRBoolean IsValid() const
Test if the geometry is valid.
Definition: ogrgeometry.cpp:2145
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:3215
virtual const char * getGeometryName() const =0
Fetch WKT name for geometry type.
virtual const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition: ogrpolygon.cpp:131
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2307
Definition: ogr_geometry.h:1202
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:1156
virtual OGRCurvePolygon * clone() const override
Make a copy of this object.
Definition: ogrcurvepolygon.cpp:102
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2793
A collection of non-overlapping OGRSurface.
Definition: ogr_geometry.h:2553
OGRErr importFromWkb(const GByte *, size_t=static_cast< size_t >(-1), OGRwkbVariant=wkbVariantOldOgc)
Assign geometry from well known binary data.
Definition: ogrgeometry.cpp:1427
Point class.
Definition: ogr_geometry.h:936
bool round
Whether GDAL-special rounding should be applied.
Definition: ogr_geometry.h:77
virtual OGRErr exportToWkb(OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc) const override
Convert a geometry into well known binary format.
Definition: ogrpolygon.cpp:401
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:3156
virtual OGRErr addGeometry(const OGRGeometry *) override
Add a new geometry to a collection.
Definition: ogrtriangulatedsurface.cpp:189
double getY(int i) const
Get Y at vertex.
Definition: ogr_geometry.h:1385
OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const
Convert a geometry into well known text format.
Definition: ogrgeometry.cpp:1829
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:3154
virtual void empty() override
Clear geometry information. This restores the geometry to its initial state after construction,...
Definition: ogrcurvepolygon.cpp:112
virtual std::string exportToWkt(const OGRWktOptions &opts=OGRWktOptions(), OGRErr *err=nullptr) const override
Export a curve polygon to WKT.
Definition: ogrcurvepolygon.cpp:537
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2697
OGRGeometry & operator=(const OGRGeometry &other)
Assignment operator.
Definition: ogrgeometry.cpp:151
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2731
virtual OGRErr importFromWkt(const char **ppszInput)=0
Assign geometry from well known text data.
virtual std::string exportToWkt(const OGRWktOptions &opts=OGRWktOptions(), OGRErr *err=nullptr) const override
Export a multicurve to WKT.
Definition: ogrmulticurve.cpp:184
OGRwkbVariant variant
Type of WKT output to produce.
Definition: ogr_geometry.h:73
OGRPolygon & operator=(const OGRPolygon &other)
Assignment operator.
Definition: ogrpolygon.cpp:91
@ Default
Format as F when abs(value) < 1, otherwise as G.
int OGRBoolean
Type for a OGR boolean.
Definition: ogr_core.h:357
double x
x
Definition: ogr_geometry.h:113
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:3108
void setX(double xIn)
Set x.
Definition: ogr_geometry.h:1005
virtual const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition: ogrlinestring.cpp:2763
int precision
Precision of output. Interpretation depends on format.
Definition: ogr_geometry.h:75
const OGRLinearRing * toLinearRing() const
Down-cast to OGRLinearRing*.
Definition: ogr_geometry.h:642
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2519
virtual OGRErr PointOnSurface(OGRPoint *poPoint) const
This method relates to the SFCOM ISurface::get_PointOnSurface() method.
Definition: ogr_geometry.h:2001
virtual std::string exportToWkt(const OGRWktOptions &opts=OGRWktOptions(), OGRErr *err=nullptr) const override
Export a polygon to WKT.
Definition: ogrpolygon.cpp:650
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1605
virtual OGRErr exportToWkb(OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc) const =0
Convert a geometry into well known binary format.
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2689
virtual OGRMultiSurface * clone() const override
Make a copy of this object.
Definition: ogrmultisurface.cpp:98
Simple container for a position.
Definition: ogr_geometry.h:103
A collection of OGRLineString.
Definition: ogr_geometry.h:3188
OGRCurve ChildType
Type of child elements.
Definition: ogr_geometry.h:2071
virtual void flattenTo2D()=0
Convert geometry to strictly 2D. In a sense this converts all Z coordinates to 0.0.
virtual void StartPoint(OGRPoint *) const =0
Return the curve start point.
virtual OGRBoolean isCompatibleSubType(OGRwkbGeometryType) const override
Returns whether a geometry of the specified geometry type can be a member of this collection.
Definition: ogrmultisurface.cpp:146
OGRMultiCurve * toMultiCurve()
Down-cast to OGRMultiCurve*.
Definition: ogr_geometry.h:789
OGRPoint ChildType
Type of child elements.
Definition: ogr_geometry.h:2995
virtual OGRErr addGeometry(const OGRGeometry *)
Add a new geometry to a collection.
Definition: ogrpolyhedralsurface.cpp:729
OGRLineString * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3219
Abstract base class for 2 dimensional objects like polygons or curve polygons.
Definition: ogr_geometry.h:1991
OGRSimpleCurve & operator=(const OGRSimpleCurve &other)
Assignment operator.
Definition: ogrlinestring.cpp:115
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const override
Returns if this geometry is or has curve geometry.
Definition: ogrmultisurface.cpp:286
virtual int getNumPoints() const =0
Return the number of points of a curve geometry.
virtual size_t WkbSize() const override
Returns size of related binary representation.
Definition: ogrpolygon.cpp:327
OGRwkbByteOrder
Enumeration to describe byte order.
Definition: ogr_core.h:550
OGRPolyhedralSurface * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2944
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1709
OGRTriangle & operator=(const OGRTriangle &other)
Assignment operator.
Definition: ogrtriangle.cpp:137
OGRTriangle ChildType
Type of child elements.
Definition: ogr_geometry.h:2915
Concrete representation of a circular string, that is to say a curve made of one or several arc circl...
Definition: ogr_geometry.h:1628
OGRCurvePolygon()
Create an empty curve polygon.
virtual OGRSurface * clone() const override=0
Make a copy of this object.
virtual OGRwkbGeometryType getGeometryType() const override
Fetch geometry type.
Definition: ogrmulticurve.cpp:107
virtual OGRBoolean Intersects(const OGRGeometry *) const
Do these features intersect?
Definition: ogrgeometry.cpp:504
virtual OGRPolygon * CurvePolyToPoly(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const override
Return a polygon from a curve polygon.
Definition: ogrpolygon.cpp:765
const OGRLineString * toLineString() const
Down-cast to OGRLineString*.
Definition: ogr_geometry.h:628
OGRTriangle * toTriangle()
Down-cast to OGRTriangle*.
Definition: ogr_geometry.h:705
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1056
The CPLJSONArray class holds JSON object from CPLJSONDocument.
Definition: cpl_json.h:53
OGRGeometryCollection & operator=(const OGRGeometryCollection &other)
Assignment operator.
Definition: ogrgeometrycollection.cpp:110
virtual std::string exportToWkt(const OGRWktOptions &opts=OGRWktOptions(), OGRErr *err=nullptr) const override
Export a simple curve to WKT.
Definition: ogrlinestring.cpp:1850
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2948
OGRPoint * toPoint()
Down-cast to OGRPoint*.
Definition: ogr_geometry.h:579
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2578
virtual OGRLineString * clone() const override
Make a copy of this object.
Definition: ogrlinestring.cpp:2888
virtual void set3D(OGRBoolean bIs3D) override
Add or remove the Z coordinate dimension.
Definition: ogrcurvepolygon.cpp:690
const ChildType *const * begin() const
Return begin of sub-geometry iterator.
Definition: ogr_geometry.h:2441
OGRSurface * toSurface()
Down-cast to OGRSurface*.
Definition: ogr_geometry.h:677
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:3006
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:3106
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2625
const ChildType *const * begin() const
Return begin of curve iterator.
Definition: ogr_geometry.h:1879
OGRGeometry ChildType
Type of child elements.
Definition: ogr_geometry.h:2430
OGRCurve * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3118
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2623
virtual OGRMultiCurve * clone() const override
Make a copy of this object.
Definition: ogrmulticurve.cpp:97
OGRPolyhedralSurface * toPolyhedralSurface()
Down-cast to OGRPolyhedralSurface*.
Definition: ogr_geometry.h:817
virtual OGRErr importFromWkb(const unsigned char *, size_t, OGRwkbVariant, size_t &nBytesConsumedOut) override
Assign geometry from well known binary data.
Definition: ogrcurvepolygon.cpp:463
void sfcgal_geometry_t
SFCGAL geometry type.
Definition: ogr_geometry.h:123
virtual OGRErr transform(OGRCoordinateTransformation *poCT) override
Apply arbitrary coordinate transformation to geometry.
Definition: ogrcurvepolygon.cpp:654
virtual OGRLineString * CurveToLine(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const =0
Return a linestring from a curve geometry.
~OGRPolyhedralSurface() override
Destructor.
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2380
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:3248
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2928
static OGRErr createFromWkt(char **ppszInput, OGRSpatialReference *poSRS, OGRGeometry **ppoGeom)
Deprecated.
Definition: ogr_geometry.h:3305
OGRErr importFromWkt(const char **) override
deprecated
Definition: ogrgeometrycollection.cpp:777
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1514
virtual int ContainsPoint(const OGRPoint *p) const
Returns if a point is contained in a (closed) curve.
Definition: ogrcurve.cpp:395
virtual void setCoordinateDimension(int nDimension) override
Set the coordinate dimension.
Definition: ogrcurvepolygon.cpp:684
ChildType ** end()
Return end of curve iterator.
Definition: ogr_geometry.h:2078
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2621
OGRPoint ChildType
Type of child elements.
Definition: ogr_geometry.h:1314
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1032
const OGRPoint * toPoint() const
Down-cast to OGRPoint*.
Definition: ogr_geometry.h:586
OGRRawPoint(double xIn, double yIn)
Constructor.
Definition: ogr_geometry.h:110
OGRErr removeGeometry(int iIndex, int bDelete=TRUE)
Remove a geometry from the container.
Definition: ogrpolyhedralsurface.cpp:956
virtual void assignSpatialReference(OGRSpatialReference *poSR)
Assign spatial reference to this object.
Definition: ogrgeometry.cpp:433
virtual OGRwkbGeometryType getGeometryType() const override
Fetch geometry type.
Definition: ogrcurvepolygon.cpp:122
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:3152
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:1151
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2245
static OGRPolygon * CastToPolygon(OGRCurvePolygon *poCP)
Convert to polygon.
Definition: ogrcurvepolygon.cpp:826
const OGRPolyhedralSurface * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2946
virtual OGRwkbGeometryType getGeometryType() const override
Fetch geometry type.
Definition: ogrpolygon.cpp:114
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2520
OGRLineString * toLineString()
Down-cast to OGRLineString*.
Definition: ogr_geometry.h:621
virtual void EndPoint(OGRPoint *) const =0
Return the curve end point.
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:607
const ChildType *const * end() const
Return end of curve iterator.
Definition: ogr_geometry.h:2084
virtual void empty()=0
Clear geometry information. This restores the geometry to its initial state after construction,...
OGRPolygon * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2375
const OGRCurvePolygon * toCurvePolygon() const
Down-cast to OGRCurvePolygon*.
Definition: ogr_geometry.h:726
const OGRTriangulatedSurface * toTriangulatedSurface() const
Down-cast to OGRTriangulatedSurface*.
Definition: ogr_geometry.h:838
OGRCurve ChildType
Type of child elements.
Definition: ogr_geometry.h:3101
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:614
Abstract curve base class for OGRLineString and OGRCircularString.
Definition: ogr_geometry.h:1247
OGRwkbGeometryType OGRFromOGCGeomType(const char *pszGeomType)
Map OGCgeometry format type to corresponding OGR constants.
Definition: ogrgeometry.cpp:2400
void * OGRGeometryH
Opaque type for a geometry.
Definition: ogr_api.h:66
virtual const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition: ogrmulticurve.cpp:134
const OGRLineString * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3221
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2691
OGRTriangle * getGeometryRef(int i)
See OGRPolyhedralSurface::getGeometryRef()
Definition: ogr_geometry.h:2936
virtual OGRwkbGeometryType getGeometryType() const override
Fetch geometry type.
Definition: ogrmultisurface.cpp:108
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:3114
const OGRPolygon * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:2703
virtual OGRErr addRingDirectly(OGRCurve *poNewRing) override
Add a ring to a polygon.
Definition: ogrtriangle.cpp:255
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2166
struct GEOSGeom_t * GEOSGeom
GEOS geometry type.
Definition: ogr_geometry.h:119
virtual OGRBoolean IsEmpty() const override
Returns TRUE (non-zero) if the object has no points.
Definition: ogr_geometry.h:987
virtual OGRErr importFromWkb(const unsigned char *, size_t, OGRwkbVariant, size_t &nBytesConsumedOut) override
Assign geometry from well known binary data.
Definition: ogrlinestring.cpp:1515
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition: ogrsf_frmts.h:330
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:3047
virtual OGRPointIterator * getPointIterator() const =0
Returns a point iterator over the curve.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2165
OGRGeometry visitor interface.
Definition: ogr_geometry.h:157
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2949
ChildType ** end()
Return end of curve iterator.
Definition: ogr_geometry.h:1875
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:1706
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1031
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:3213
OGRSimpleCurve * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:1704
virtual int getDimension() const =0
Get the dimension of this object.
virtual OGRCurve * clone() const override=0
Make a copy of this object.
OGRLinearRing * toLinearRing()
Down-cast to OGRLinearRing*.
Definition: ogr_geometry.h:635
int OGRErr
Type for a OGR error.
Definition: ogr_core.h:341
virtual void segmentize(double dfMaxLength) override
Modify the geometry such it has no segment longer then the given distance.
Definition: ogrlinestring.cpp:2473
virtual OGRErr importFromWkb(const unsigned char *, size_t, OGRwkbVariant, size_t &nBytesConsumedOut) override
Assign geometry from well known binary data.
Definition: ogrpolygon.cpp:347
OGRCurvePolygon * toCurvePolygon()
Down-cast to OGRCurvePolygon*.
Definition: ogr_geometry.h:719
virtual void segmentize(double dfMaxLength)
Modify the geometry such it has no segment longer then the given distance.
Definition: ogrgeometry.cpp:806
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:3246
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1962
OGRPoint * getGeometryRef(int i)
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3012
OGRMultiSurface & operator=(const OGRMultiSurface &other)
Assignment operator.
Definition: ogrmultisurface.cpp:85
OGRPolygon * toPolygon()
Down-cast to OGRPolygon*.
Definition: ogr_geometry.h:691
OGRWktFormat
WKT Output formatting options.
Definition: ogr_geometry.h:61
virtual std::string exportToWkt(const OGRWktOptions &opts=OGRWktOptions(), OGRErr *err=nullptr) const override
Export a geometry collection to WKT.
Definition: ogrmultisurface.cpp:275
OGRGeometryCollection * toGeometryCollection()
Down-cast to OGRGeometryCollection*.
Definition: ogr_geometry.h:733
OGRCurve * getExteriorRingCurve()
Fetch reference to external polygon ring.
Definition: ogrcurvepolygon.cpp:185
const OGRMultiCurve * toMultiCurve() const
Down-cast to OGRMultiCurve*.
Definition: ogr_geometry.h:796
int getNumInteriorRings() const
Fetch the number of internal rings.
Definition: ogrcurvepolygon.cpp:222
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:3046
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:368
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2574
virtual OGRBoolean Equals(const OGRGeometry *) const override
Returns TRUE if two geometries are equivalent.
Definition: ogrcurvepolygon.cpp:635
OGRMultiCurve & operator=(const OGRMultiCurve &other)
Assignment operator.
Definition: ogrmulticurve.cpp:84
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2920
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition: cpl_port.h:869
Triangle class.
Definition: ogr_geometry.h:2337
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:3249
virtual OGRPolyhedralSurface * clone() const override
Make a copy of this object.
Definition: ogrpolyhedralsurface.cpp:96
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2580
virtual OGRPolygon * clone() const override
Make a copy of this object.
Definition: ogrpolygon.cpp:104
const OGRMultiPoint * toMultiPoint() const
Down-cast to OGRMultiPoint*.
Definition: ogr_geometry.h:754
virtual const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition: ogrcurvepolygon.cpp:159
void setY(double yIn)
Set y.
Definition: ogr_geometry.h:1009
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2237
OGRGeometry visitor default implementation.
Definition: ogr_geometry.h:278
OGRErr removeRing(int iIndex, bool bDelete=true)
Remove a geometry from the container.
Definition: ogrcurvepolygon.cpp:323
virtual double get_AreaOfCurveSegments() const override
Return area of curve segments.
Definition: ogrcompoundcurve.cpp:893
ChildType ** end()
Return end of sub-geometry iterator.
Definition: ogr_geometry.h:2437
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2243
virtual size_t WkbSize() const override
Returns size of related binary representation.
Definition: ogrcurvepolygon.cpp:439
const OGRMultiSurface * toMultiSurface() const
Down-cast to OGRMultiSurface*.
Definition: ogr_geometry.h:810
ChildType ** begin()
Return begin of sub-geometry iterator.
Definition: ogr_geometry.h:2435
double getZ() const
Return z.
Definition: ogr_geometry.h:996
void setZ(double zIn)
Set z.
Definition: ogr_geometry.h:1013
const OGRSurface * toSurface() const
Down-cast to OGRSurface*.
Definition: ogr_geometry.h:684
virtual OGRErr addRing(OGRCurve *)
Add a ring to a polygon.
Definition: ogrcurvepolygon.cpp:346
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const override
Returns if this geometry is or has curve geometry.
Definition: ogrpolygon.cpp:776
Simple container for a bounding region in 3D.
Definition: ogr_core.h:198
virtual size_t WkbSize() const =0
Returns size of related binary representation.
const ChildType *const * end() const
Return end of curve iterator.
Definition: ogr_geometry.h:1881
OGRBoolean IsMeasured() const
Definition: ogr_geometry.h:407
OGRCurvePolygon & operator=(const OGRCurvePolygon &other)
Assignment operator.
Definition: ogrcurvepolygon.cpp:87
std::unique_ptr< OGRPreparedGeometry, OGRPreparedGeometryUniquePtrDeleter > OGRPreparedGeometryUniquePtr
Unique pointer type for OGRPreparedGeometry.
Definition: ogr_geometry.h:3400
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const override
Returns if this geometry is or has curve geometry.
Definition: ogrmulticurve.cpp:195
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2926
virtual OGRGeometry * getCurveGeometry(const char *const *papszOptions=nullptr) const
Return curve version of this geometry.
Definition: ogrgeometry.cpp:3269
Abstract curve base class for OGRLineString, OGRCircularString and OGRCompoundCurve.
Definition: ogr_geometry.h:1070
virtual OGRErr transform(OGRCoordinateTransformation *poCT) override
Apply arbitrary coordinate transformation to geometry.
Definition: ogrlinestring.cpp:2352
virtual void assignSpatialReference(OGRSpatialReference *poSR) override
Assign spatial reference to this object.
Definition: ogrcurvepolygon.cpp:704
virtual double get_Length() const override
Returns the length of the curve.
Definition: ogrlinestring.cpp:1906
double getY() const
Return y.
Definition: ogr_geometry.h:994
void visit(OGRPoint *) override
Visit OGRPoint.
Definition: ogr_geometry.h:210
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:3044
virtual void segmentize(double dfMaxLength) override
Modify the geometry such it has no segment longer then the given distance.
Definition: ogrcurvepolygon.cpp:722
struct GEOSContextHandle_HS * GEOSContextHandle_t
GEOS context handle type.
Definition: ogr_geometry.h:121
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2239
virtual int getDimension() const override
Get the dimension of this object.
Definition: ogrgeometrycollection.cpp:178
virtual OGRErr transform(OGRCoordinateTransformation *poCT)=0
Apply arbitrary coordinate transformation to geometry.
OGRPolyhedralSurface & operator=(const OGRPolyhedralSurface &other)
Assignment operator.
Definition: ogrpolyhedralsurface.cpp:81
OGRPolyhedralSurface()
Create an empty PolyhedralSurface.
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2726
Concrete representation of a closed ring.
Definition: ogr_geometry.h:1544
std::unique_ptr< OGRGeometry, OGRGeometryUniquePtrDeleter > OGRGeometryUniquePtr
Unique pointer type for OGRGeometry.
Definition: ogr_geometry.h:853
Simple container for a bounding region (rectangle)
Definition: ogr_core.h:57
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2379
const OGRGeometryCollection * toGeometryCollection() const
Down-cast to OGRGeometryCollection*.
Definition: ogr_geometry.h:740
virtual void Value(double, OGRPoint *) const override
Fetch point at given distance along curve.
Definition: ogrlinestring.cpp:1948
ChildType ** begin()
Return begin of curve iterator.
Definition: ogr_geometry.h:2076
const OGRMultiPolygon * toMultiPolygon() const
Down-cast to OGRMultiPolygon*.
Definition: ogr_geometry.h:782
const OGRCurve * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3120
virtual void visit(const OGRPoint *)=0
Visit OGRPoint.
static OGRLinearRing * CastToLinearRing(OGRCurve *poCurve)
Cast to linear ring.
Definition: ogrcurve.cpp:374
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:3157
OGRPolygon ChildType
Type of child elements.
Definition: ogr_geometry.h:2788
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:3000
OGRMultiPoint * toMultiPoint()
Down-cast to OGRMultiPoint*.
Definition: ogr_geometry.h:747
const char * OGRToOGCGeomType(OGRwkbGeometryType eGeomType)
Map OGR geometry format constants to corresponding OGC geometry type.
Definition: ogrgeometry.cpp:2473
double y
y
Definition: ogr_geometry.h:115
const OGRCurve * toCurve() const
Down-cast to OGRCurve*.
Definition: ogr_geometry.h:600
Options for formatting WKT output.
Definition: ogr_geometry.h:69
OGRErr importFromWkt(const char **) override
deprecated
Definition: ogrcurvepolygon.cpp:522
const OGRMultiLineString * toMultiLineString() const
Down-cast to OGRMultiLineString*.
Definition: ogr_geometry.h:768
const OGRTriangle * getGeometryRef(int i) const
See OGRPolyhedralSurface::getGeometryRef()
Definition: ogr_geometry.h:2938
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:1511
virtual void setMeasured(OGRBoolean bIsMeasured) override
Add or remove the M coordinate dimension.
Definition: ogrcurvepolygon.cpp:695
virtual int IntersectsPoint(const OGRPoint *p) const
Returns if a point intersects a (closed) curve.
Definition: ogrcurve.cpp:415
const OGRCurvePolygon * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2304
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1513
Concrete class representing polygons.
Definition: ogr_geometry.h:2199
TriangulatedSurface class.
Definition: ogr_geometry.h:2894
Concrete class representing curve polygons.
Definition: ogr_geometry.h:2033
double getM() const
Return m.
Definition: ogr_geometry.h:998
virtual void getEnvelope(OGREnvelope *psEnvelope) const =0
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure.
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2863
OGRCurve * getInteriorRingCurve(int)
Fetch reference to indicated internal ring.
Definition: ogrcurvepolygon.cpp:250
virtual OGRBoolean Equals(const OGRGeometry *) const =0
Returns TRUE if two geometries are equivalent.
const ChildType *const * begin() const
Return begin of curve iterator.
Definition: ogr_geometry.h:2082
virtual double get_Length() const =0
Returns the length of the curve.
const OGRPoint * getGeometryRef(int i) const
See OGRGeometryCollection::getGeometryRef()
Definition: ogr_geometry.h:3014
virtual const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition: ogrmultisurface.cpp:135
const OGRPolyhedralSurface * toPolyhedralSurface() const
Down-cast to OGRPolyhedralSurface*.
Definition: ogr_geometry.h:824
OGRMultiLineString * toMultiLineString()
Down-cast to OGRMultiLineString*.
Definition: ogr_geometry.h:761
OGRLineString & operator=(const OGRLineString &other)
Assignment operator.
Definition: ogrlinestring.cpp:2733
virtual OGRGeometry * getLinearGeometry(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const override
Return, possibly approximate, non-curve version of this geometry.
Definition: ogrcurvepolygon.cpp:605
virtual OGRBoolean Within(const OGRGeometry *) const
Test for containment.
Definition: ogrgeometry.cpp:5222
virtual OGRwkbGeometryType getGeometryType() const override
Fetch geometry type.
Definition: ogrgeometrycollection.cpp:161
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1708
virtual void setMeasured(OGRBoolean bIsMeasured)
Add or remove the M coordinate dimension.
Definition: ogrgeometry.cpp:1070
OGRCurvePolygon * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2302
virtual OGRErr exportToWkb(OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc) const override
Convert a geometry into well known binary format.
Definition: ogrcurvepolygon.cpp:494
#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:930
bool operator!=(const OGRGeometry &other) const
Returns if two geometries are different.
Definition: ogr_geometry.h:393
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2799
void visit(const OGRPoint *) override
Visit OGRPoint.
Definition: ogr_geometry.h:284
OGRwkbVariant
Output variants of WKB we support.
Definition: ogr_core.h:484
virtual std::string exportToWkt(const OGRWktOptions &opts=OGRWktOptions(), OGRErr *err=nullptr) const override
Export a geometry collection to WKT.
Definition: ogrgeometrycollection.cpp:790
OGRCurve * stealExteriorRingCurve()
"Steal" reference to external ring.
Definition: ogrcurvepolygon.cpp:291
OGRPoint ChildType
Type of child elements.
Definition: ogr_geometry.h:1114
OGRCurve ChildType
Type of child elements.
Definition: ogr_geometry.h:1868
OGRLineString * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:1601
const ChildType *const * end() const
Return end of sub-geometry iterator.
Definition: ogr_geometry.h:2443
virtual OGRGeometryCollection * clone() const override
Make a copy of this object.
Definition: ogrgeometrycollection.cpp:151
OGRCompoundCurve * toCompoundCurve()
Down-cast to OGRCompoundCurve*.
Definition: ogr_geometry.h:663
virtual void swapXY() override
Swap x and y coordinates.
Definition: ogrcurvepolygon.cpp:736
double getX() const
Return x.
Definition: ogr_geometry.h:992
virtual double get_Area() const =0
Get the area of the (closed) curve.
static OGRGeometryH ToHandle(OGRGeometry *poGeom)
Convert a OGRGeometry* to a OGRGeometryH.
Definition: ogr_geometry.h:566
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:3209
OGRGeometry visitor default implementation.
Definition: ogr_geometry.h:204
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1606