GDAL

- Main Page
- Related Pages
- Classes
- Files
- Download
- Issue Tracker

- File List
- File Members

ogr_geometry.h
Go to the documentation of this file.
1 /******************************************************************************
2 * $Id$
3 *
4 * Project: OpenGIS Simple Features Reference Implementation
5 * Purpose: Classes for manipulating simple features that is not specific
6 * to a particular interface technology.
7 * Author: Frank Warmerdam, warmerdam@pobox.com
8 *
9 ******************************************************************************
10 * Copyright (c) 1999, Frank Warmerdam
11 * Copyright (c) 2008-2014, Even Rouault <even dot rouault at mines-paris dot org>
12 *
13 * Permission is hereby granted, free of charge, to any person obtaining a
14 * copy of this software and associated documentation files (the "Software"),
15 * to deal in the Software without restriction, including without limitation
16 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 * and/or sell copies of the Software, and to permit persons to whom the
18 * Software is furnished to do so, subject to the following conditions:
19 *
20 * The above copyright notice and this permission notice shall be included
21 * in all copies or substantial portions of the Software.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 * DEALINGS IN THE SOFTWARE.
30 ****************************************************************************/
31
32 #ifndef OGR_GEOMETRY_H_INCLUDED
33 #define OGR_GEOMETRY_H_INCLUDED
34
35 #include "cpl_conv.h"
36 #include "cpl_json.h"
37 #include "ogr_core.h"
38 #include "ogr_spatialref.h"
39
40 #include <memory>
41
49 #ifndef DEFINEH_OGRGeometryH
50 #define DEFINEH_OGRGeometryH
51 #ifdef DEBUG
52 typedef struct OGRGeometryHS *OGRGeometryH;
53 #else
54 typedef void *OGRGeometryH;
55 #endif
56 #endif /* DEFINEH_OGRGeometryH */
57
63 class OGRRawPoint
64 {
65 public:
67 OGRRawPoint() : x(0.0), y(0.0) {}
68
70 OGRRawPoint(double xIn, double yIn) : x(xIn), y(yIn) {}
71
73 double x;
75 double y;
76 };
77
79 typedef struct GEOSGeom_t *GEOSGeom;
81 typedef struct GEOSContextHandle_HS *GEOSContextHandle_t;
83 typedef void sfcgal_geometry_t;
84
85 class OGRPoint;
86 class OGRCurve;
87 class OGRCompoundCurve;
88 class OGRSimpleCurve;
89 class OGRLinearRing;
90 class OGRLineString;
91 class OGRCircularString;
92 class OGRSurface;
93 class OGRCurvePolygon;
94 class OGRPolygon;
95 class OGRMultiPoint;
96 class OGRMultiSurface;
97 class OGRMultiPolygon;
98 class OGRMultiCurve;
99 class OGRMultiLineString;
100 class OGRGeometryCollection;
101 class OGRTriangle;
102 class OGRPolyhedralSurface;
103 class OGRTriangulatedSurface;
104
106 typedef OGRLineString* (*OGRCurveCasterToLineString)(OGRCurve*);
107 typedef OGRLinearRing* (*OGRCurveCasterToLinearRing)(OGRCurve*);
108
109 typedef OGRPolygon* (*OGRSurfaceCasterToPolygon)(OGRSurface*);
110 typedef OGRCurvePolygon* (*OGRSurfaceCasterToCurvePolygon)(OGRSurface*);
111 typedef OGRMultiPolygon* (*OGRPolyhedralSurfaceCastToMultiPolygon)(OGRPolyhedralSurface*);
113
117 class CPL_DLL IOGRGeometryVisitor
118 {
119 public:
121 virtual ~IOGRGeometryVisitor() = default;
122
124 virtual void visit(OGRPoint*) = 0;
126 virtual void visit(OGRLineString*) = 0;
128 virtual void visit(OGRLinearRing*) = 0;
130 virtual void visit(OGRPolygon*) = 0;
132 virtual void visit(OGRMultiPoint*) = 0;
134 virtual void visit(OGRMultiLineString*) = 0;
136 virtual void visit(OGRMultiPolygon*) = 0;
138 virtual void visit(OGRGeometryCollection*) = 0;
140 virtual void visit(OGRCircularString*) = 0;
142 virtual void visit(OGRCompoundCurve*) = 0;
144 virtual void visit(OGRCurvePolygon*) = 0;
146 virtual void visit(OGRMultiCurve*) = 0;
148 virtual void visit(OGRMultiSurface*) = 0;
150 virtual void visit(OGRTriangle*) = 0;
152 virtual void visit(OGRPolyhedralSurface*) = 0;
154 virtual void visit(OGRTriangulatedSurface*) = 0;
155 };
156
164 class CPL_DLL OGRDefaultGeometryVisitor: public IOGRGeometryVisitor
165 {
166 void _visit(OGRSimpleCurve* poGeom);
167
168 public:
169
170 void visit(OGRPoint*) override {}
171 void visit(OGRLineString*) override;
172 void visit(OGRLinearRing*) override;
173 void visit(OGRPolygon*) override;
174 void visit(OGRMultiPoint*) override;
175 void visit(OGRMultiLineString*) override;
176 void visit(OGRMultiPolygon*) override;
177 void visit(OGRGeometryCollection*) override;
178 void visit(OGRCircularString*) override;
179 void visit(OGRCompoundCurve*) override;
180 void visit(OGRCurvePolygon*) override;
181 void visit(OGRMultiCurve*) override;
182 void visit(OGRMultiSurface*) override;
183 void visit(OGRTriangle*) override;
184 void visit(OGRPolyhedralSurface*) override;
185 void visit(OGRTriangulatedSurface*) override;
186 };
187
191 class CPL_DLL IOGRConstGeometryVisitor
192 {
193 public:
195 virtual ~IOGRConstGeometryVisitor() = default;
196
198 virtual void visit(const OGRPoint*) = 0;
200 virtual void visit(const OGRLineString*) = 0;
202 virtual void visit(const OGRLinearRing*) = 0;
204 virtual void visit(const OGRPolygon*) = 0;
206 virtual void visit(const OGRMultiPoint*) = 0;
208 virtual void visit(const OGRMultiLineString*) = 0;
210 virtual void visit(const OGRMultiPolygon*) = 0;
212 virtual void visit(const OGRGeometryCollection*) = 0;
214 virtual void visit(const OGRCircularString*) = 0;
216 virtual void visit(const OGRCompoundCurve*) = 0;
218 virtual void visit(const OGRCurvePolygon*) = 0;
220 virtual void visit(const OGRMultiCurve*) = 0;
222 virtual void visit(const OGRMultiSurface*) = 0;
224 virtual void visit(const OGRTriangle*) = 0;
226 virtual void visit(const OGRPolyhedralSurface*) = 0;
228 virtual void visit(const OGRTriangulatedSurface*) = 0;
229 };
230
238 class CPL_DLL OGRDefaultConstGeometryVisitor: public IOGRConstGeometryVisitor
239 {
240 void _visit(const OGRSimpleCurve* poGeom);
241
242 public:
243
244 void visit(const OGRPoint*) override {}
245 void visit(const OGRLineString*) override;
246 void visit(const OGRLinearRing*) override;
247 void visit(const OGRPolygon*) override;
248 void visit(const OGRMultiPoint*) override;
249 void visit(const OGRMultiLineString*) override;
250 void visit(const OGRMultiPolygon*) override;
251 void visit(const OGRGeometryCollection*) override;
252 void visit(const OGRCircularString*) override;
253 void visit(const OGRCompoundCurve*) override;
254 void visit(const OGRCurvePolygon*) override;
255 void visit(const OGRMultiCurve*) override;
256 void visit(const OGRMultiSurface*) override;
257 void visit(const OGRTriangle*) override;
258 void visit(const OGRPolyhedralSurface*) override;
259 void visit(const OGRTriangulatedSurface*) override;
260 };
261
262 /************************************************************************/
263 /* OGRGeometry */
264 /************************************************************************/
265
286 class CPL_DLL OGRGeometry
287 {
288 private:
289 OGRSpatialReference * poSRS = nullptr; // may be NULL
290
291 protected:
293 friend class OGRCurveCollection;
294
295 unsigned int flags = 0;
296
297 OGRErr importPreambleFromWkt( const char ** ppszInput,
298 int* pbHasZ, int* pbHasM,
299 bool* pbIsEmpty );
300 OGRErr importCurveCollectionFromWkt(
301 const char ** ppszInput,
302 int bAllowEmptyComponent,
303 int bAllowLineString,
304 int bAllowCurve,
305 int bAllowCompoundCurve,
306 OGRErr (*pfnAddCurveDirectly)(OGRGeometry* poSelf,
307 OGRCurve* poCurve) );
308 OGRErr importPreambleFromWkb( const unsigned char * pabyData,
309 int nSize,
310 OGRwkbByteOrder& eByteOrder,
311 OGRwkbVariant eWkbVariant );
312 OGRErr importPreambleOfCollectionFromWkb(
313 const unsigned char * pabyData,
314 int& nSize,
315 int& nDataOffset,
316 OGRwkbByteOrder& eByteOrder,
317 int nMinSubGeomSize,
318 int& nGeomCount,
319 OGRwkbVariant eWkbVariant );
320 OGRErr PointOnSurfaceInternal( OGRPoint * poPoint ) const;
321 OGRBoolean IsSFCGALCompatible() const;
322
323 void HomogenizeDimensionalityWith( OGRGeometry* poOtherGeom );
324
326
327 public:
328
329 /************************************************************************/
330 /* Bit flags for OGRGeometry */
331 /* The OGR_G_NOT_EMPTY_POINT is used *only* for points. */
332 /* Do not use these outside of the core. */
333 /* Use Is3D, IsMeasured, set3D, and setMeasured instead */
334 /************************************************************************/
335
337 static const unsigned int OGR_G_NOT_EMPTY_POINT = 0x1;
338 static const unsigned int OGR_G_3D = 0x2;
339 static const unsigned int OGR_G_MEASURED = 0x4;
341
342 OGRGeometry();
343 OGRGeometry( const OGRGeometry& other );
344 virtual ~OGRGeometry();
345
346 OGRGeometry& operator=( const OGRGeometry& other );
347
349 bool operator==( const OGRGeometry& other ) const { return CPL_TO_BOOL(Equals(&other)); }
350
352 bool operator!=( const OGRGeometry& other ) const { return !CPL_TO_BOOL(Equals(&other)); }
353
354 // Standard IGeometry.
355 virtual int getDimension() const = 0;
356 virtual int getCoordinateDimension() const;
357 int CoordinateDimension() const;
358 virtual OGRBoolean IsEmpty() const = 0;
359 virtual OGRBoolean IsValid() const;
360 virtual OGRBoolean IsSimple() const;
362 OGRBoolean Is3D() const { return flags & OGR_G_3D; }
364 OGRBoolean IsMeasured() const { return flags & OGR_G_MEASURED; }
365 virtual OGRBoolean IsRing() const;
366 virtual void empty() = 0;
367 virtual OGRGeometry *clone() const CPL_WARN_UNUSED_RESULT = 0;
368 virtual void getEnvelope( OGREnvelope * psEnvelope ) const = 0;
369 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const = 0;
370
371 // IWks Interface.
372 virtual int WkbSize() const = 0;
373 OGRErr importFromWkb( const GByte*, int=-1,
374 OGRwkbVariant=wkbVariantOldOgc );
375 virtual OGRErr importFromWkb( const unsigned char *,
376 int,
377 OGRwkbVariant,
378 int& nBytesConsumedOut ) = 0;
379 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
380 OGRwkbVariant=wkbVariantOldOgc ) const = 0;
381 virtual OGRErr importFromWkt( const char ** ppszInput ) = 0;
382
386 OGRErr importFromWkt( char ** ppszInput ) CPL_WARN_DEPRECATED("Use importFromWkt(const char**) instead")
387 {
388 return importFromWkt( const_cast<const char**>(ppszInput) );
389 }
390
391 virtual OGRErr exportToWkt( char ** ppszDstText,
392 OGRwkbVariant=wkbVariantOldOgc ) const = 0;
393
394 // Non-standard.
395 virtual OGRwkbGeometryType getGeometryType() const = 0;
396 OGRwkbGeometryType getIsoGeometryType() const;
397 virtual const char *getGeometryName() const = 0;
398 virtual void dumpReadable( FILE *, const char * = nullptr
399 , char** papszOptions = nullptr ) const;
400 virtual void flattenTo2D() = 0;
401 virtual char * exportToGML( const char* const * papszOptions = nullptr ) const;
402 virtual char * exportToKML() const;
403 virtual char * exportToJson() const;
404
406 virtual void accept(IOGRGeometryVisitor* visitor) = 0;
407
409 virtual void accept(IOGRConstGeometryVisitor* visitor) const = 0;
410
411 static GEOSContextHandle_t createGEOSContext();
412 static void freeGEOSContext( GEOSContextHandle_t hGEOSCtxt );
413 virtual GEOSGeom exportToGEOS( GEOSContextHandle_t hGEOSCtxt )
414 const CPL_WARN_UNUSED_RESULT;
415 virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear = FALSE) const;
416 virtual OGRGeometry* getCurveGeometry(
417 const char* const* papszOptions = nullptr ) const CPL_WARN_UNUSED_RESULT;
418 virtual OGRGeometry* getLinearGeometry(
419 double dfMaxAngleStepSizeDegrees = 0,
420 const char* const* papszOptions = nullptr ) const CPL_WARN_UNUSED_RESULT;
421
422 // SFCGAL interfacing methods.
424 static sfcgal_geometry_t* OGRexportToSFCGAL( const OGRGeometry *poGeom );
425 static OGRGeometry* SFCGALexportToOGR( const sfcgal_geometry_t* _geometry );
427 virtual void closeRings();
428
429 virtual void setCoordinateDimension( int nDimension );
430 virtual void set3D( OGRBoolean bIs3D );
431 virtual void setMeasured( OGRBoolean bIsMeasured );
432
433 virtual void assignSpatialReference( OGRSpatialReference * poSR );
434 OGRSpatialReference *getSpatialReference( void ) const { return poSRS; }
435
436 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) = 0;
437 OGRErr transformTo( OGRSpatialReference *poSR );
438
439 virtual void segmentize(double dfMaxLength);
440
441 // ISpatialRelation
442 virtual OGRBoolean Intersects( const OGRGeometry * ) const;
443 virtual OGRBoolean Equals( const OGRGeometry * ) const = 0;
444 virtual OGRBoolean Disjoint( const OGRGeometry * ) const;
445 virtual OGRBoolean Touches( const OGRGeometry * ) const;
446 virtual OGRBoolean Crosses( const OGRGeometry * ) const;
447 virtual OGRBoolean Within( const OGRGeometry * ) const;
448 virtual OGRBoolean Contains( const OGRGeometry * ) const;
449 virtual OGRBoolean Overlaps( const OGRGeometry * ) const;
450 // virtual OGRBoolean Relate( const OGRGeometry *, const char * ) const;
451 // virtual OGRGeometry *LocateAlong( double mValue ) const;
452 // virtual OGRGeometry *LocateBetween( double mStart, double mEnd ) const;
453
454 virtual OGRGeometry *Boundary() const CPL_WARN_UNUSED_RESULT;
455 virtual double Distance( const OGRGeometry * ) const ;
456 virtual OGRGeometry *ConvexHull() const CPL_WARN_UNUSED_RESULT;
457 virtual OGRGeometry *Buffer( double dfDist, int nQuadSegs = 30 )
458 const CPL_WARN_UNUSED_RESULT;
459 virtual OGRGeometry *Intersection( const OGRGeometry *)
460 const CPL_WARN_UNUSED_RESULT;
461 virtual OGRGeometry *Union( const OGRGeometry * )
462 const CPL_WARN_UNUSED_RESULT;
463 virtual OGRGeometry *UnionCascaded() const CPL_WARN_UNUSED_RESULT;
464 virtual OGRGeometry *Difference( const OGRGeometry * )
465 const CPL_WARN_UNUSED_RESULT;
466 virtual OGRGeometry *SymDifference( const OGRGeometry * )
467 const CPL_WARN_UNUSED_RESULT;
468 virtual OGRErr Centroid( OGRPoint * poPoint ) const;
469 virtual OGRGeometry *Simplify(double dTolerance)
470 const CPL_WARN_UNUSED_RESULT;
471 OGRGeometry *SimplifyPreserveTopology(double dTolerance)
472 const CPL_WARN_UNUSED_RESULT;
473 virtual OGRGeometry *DelaunayTriangulation(
474 double dfTolerance, int bOnlyEdges ) const CPL_WARN_UNUSED_RESULT;
475
476 virtual OGRGeometry *Polygonize() const CPL_WARN_UNUSED_RESULT;
477
478 virtual double Distance3D( const OGRGeometry *poOtherGeom ) const;
479
481 // backward compatibility to non-standard method names.
482 OGRBoolean Intersect( OGRGeometry * )
483 const CPL_WARN_DEPRECATED("Non standard method. "
484 "Use Intersects() instead");
485 OGRBoolean Equal( OGRGeometry * )
486 const CPL_WARN_DEPRECATED("Non standard method. "
487 "Use Equals() instead");
488 OGRGeometry *SymmetricDifference( const OGRGeometry * )
489 const CPL_WARN_DEPRECATED("Non standard method. "
490 "Use SymDifference() instead");
491 OGRGeometry *getBoundary()
492 const CPL_WARN_DEPRECATED("Non standard method. "
493 "Use Boundary() instead");
495
497 // Special HACK for DB2 7.2 support
498 static int bGenerate_DB2_V72_BYTE_ORDER;
500
501 virtual void swapXY();
503 static OGRGeometry* CastToIdentity( OGRGeometry* poGeom ) { return poGeom; }
504 static OGRGeometry* CastToError( OGRGeometry* poGeom );
506
510 static inline OGRGeometryH ToHandle(OGRGeometry* poGeom)
511 { return reinterpret_cast<OGRGeometryH>(poGeom); }
512
516 static inline OGRGeometry* FromHandle(OGRGeometryH hGeom)
517 { return reinterpret_cast<OGRGeometry*>(hGeom); }
518
523 inline OGRPoint* toPoint()
524 { return cpl::down_cast<OGRPoint*>(this); }
525
530 inline const OGRPoint* toPoint() const
531 { return cpl::down_cast<const OGRPoint*>(this); }
532
537 inline OGRCurve* toCurve()
538 { return cpl::down_cast<OGRCurve*>(this); }
539
544 inline const OGRCurve* toCurve() const
545 { return cpl::down_cast<const OGRCurve*>(this); }
546
551 inline OGRSimpleCurve* toSimpleCurve()
552 { return cpl::down_cast<OGRSimpleCurve*>(this); }
553
558 inline const OGRSimpleCurve* toSimpleCurve() const
559 { return cpl::down_cast<const OGRSimpleCurve*>(this); }
560
565 inline OGRLineString* toLineString()
566 { return cpl::down_cast<OGRLineString*>(this); }
567
572 inline const OGRLineString* toLineString() const
573 { return cpl::down_cast<const OGRLineString*>(this); }
574
579 inline OGRLinearRing* toLinearRing()
580 { return cpl::down_cast<OGRLinearRing*>(this); }
581
586 inline const OGRLinearRing* toLinearRing() const
587 { return cpl::down_cast<const OGRLinearRing*>(this); }
588
593 inline OGRCircularString* toCircularString()
594 { return cpl::down_cast<OGRCircularString*>(this); }
595
600 inline const OGRCircularString* toCircularString() const
601 { return cpl::down_cast<const OGRCircularString*>(this); }
602
607 inline OGRCompoundCurve* toCompoundCurve()
608 { return cpl::down_cast<OGRCompoundCurve*>(this); }
609
614 inline const OGRCompoundCurve* toCompoundCurve() const
615 { return cpl::down_cast<const OGRCompoundCurve*>(this); }
616
621 inline OGRSurface* toSurface()
622 { return cpl::down_cast<OGRSurface*>(this); }
623
628 inline const OGRSurface* toSurface() const
629 { return cpl::down_cast<const OGRSurface*>(this); }
630
635 inline OGRPolygon* toPolygon()
636 { return cpl::down_cast<OGRPolygon*>(this); }
637
642 inline const OGRPolygon* toPolygon() const
643 { return cpl::down_cast<const OGRPolygon*>(this); }
644
649 inline OGRTriangle* toTriangle()
650 { return cpl::down_cast<OGRTriangle*>(this); }
651
656 inline const OGRTriangle* toTriangle() const
657 { return cpl::down_cast<const OGRTriangle*>(this); }
658
663 inline OGRCurvePolygon* toCurvePolygon()
664 { return cpl::down_cast<OGRCurvePolygon*>(this); }
665
670 inline const OGRCurvePolygon* toCurvePolygon() const
671 { return cpl::down_cast<const OGRCurvePolygon*>(this); }
672
677 inline OGRGeometryCollection* toGeometryCollection()
678 { return cpl::down_cast<OGRGeometryCollection*>(this); }
679
684 inline const OGRGeometryCollection* toGeometryCollection() const
685 { return cpl::down_cast<const OGRGeometryCollection*>(this); }
686
691 inline OGRMultiPoint* toMultiPoint()
692 { return cpl::down_cast<OGRMultiPoint*>(this); }
693
698 inline const OGRMultiPoint* toMultiPoint() const
699 { return cpl::down_cast<const OGRMultiPoint*>(this); }
700
705 inline OGRMultiLineString* toMultiLineString()
706 { return cpl::down_cast<OGRMultiLineString*>(this); }
707
712 inline const OGRMultiLineString* toMultiLineString() const
713 { return cpl::down_cast<const OGRMultiLineString*>(this); }
714
719 inline OGRMultiPolygon* toMultiPolygon()
720 { return cpl::down_cast<OGRMultiPolygon*>(this); }
721
726 inline const OGRMultiPolygon* toMultiPolygon() const
727 { return cpl::down_cast<const OGRMultiPolygon*>(this); }
728
733 inline OGRMultiCurve* toMultiCurve()
734 { return cpl::down_cast<OGRMultiCurve*>(this); }
735
740 inline const OGRMultiCurve* toMultiCurve() const
741 { return cpl::down_cast<const OGRMultiCurve*>(this); }
742
747 inline OGRMultiSurface* toMultiSurface()
748 { return cpl::down_cast<OGRMultiSurface*>(this); }
749
754 inline const OGRMultiSurface* toMultiSurface() const
755 { return cpl::down_cast<const OGRMultiSurface*>(this); }
756
761 inline OGRPolyhedralSurface* toPolyhedralSurface()
762 { return cpl::down_cast<OGRPolyhedralSurface*>(this); }
763
768 inline const OGRPolyhedralSurface* toPolyhedralSurface() const
769 { return cpl::down_cast<const OGRPolyhedralSurface*>(this); }
770
775 inline OGRTriangulatedSurface* toTriangulatedSurface()
776 { return cpl::down_cast<OGRTriangulatedSurface*>(this); }
777
782 inline const OGRTriangulatedSurface* toTriangulatedSurface() const
783 { return cpl::down_cast<const OGRTriangulatedSurface*>(this); }
784
785 };
786
788 struct CPL_DLL OGRGeometryUniquePtrDeleter
789 {
790 void operator()(OGRGeometry*) const;
791 };
793
797 typedef std::unique_ptr<OGRGeometry, OGRGeometryUniquePtrDeleter> OGRGeometryUniquePtr;
798
799 /************************************************************************/
800 /* OGRPoint */
801 /************************************************************************/
802
809 class CPL_DLL OGRPoint : public OGRGeometry
810 {
811 double x;
812 double y;
813 double z;
814 double m;
815
816 public:
817 OGRPoint();
818 OGRPoint( double x, double y );
819 OGRPoint( double x, double y, double z );
820 OGRPoint( double x, double y, double z, double m );
821 OGRPoint( const OGRPoint& other );
822 ~OGRPoint() override;
823
824 OGRPoint& operator=( const OGRPoint& other );
825
826 // IWks Interface
827 int WkbSize() const override;
828 OGRErr importFromWkb( const unsigned char *,
829 int,
830 OGRwkbVariant,
831 int& nBytesConsumedOut ) override;
832 OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
833 OGRwkbVariant=wkbVariantOldOgc )
834 const override;
835 using OGRGeometry::importFromWkt;
836 OGRErr importFromWkt( const char ** ) override;
837 OGRErr exportToWkt( char ** ppszDstText,
838 OGRwkbVariant=wkbVariantOldOgc )
839 const override;
840
841 // IGeometry
842 virtual int getDimension() const override;
843 virtual OGRGeometry *clone() const override;
844 virtual void empty() override;
845 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
846 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
847 virtual OGRBoolean IsEmpty() const override
848 { return !(flags & OGR_G_NOT_EMPTY_POINT); }
849
850 // IPoint
852 double getX() const { return x; }
854 double getY() const { return y; }
856 double getZ() const { return z; }
858 double getM() const { return m; }
859
860 // Non standard
861 virtual void setCoordinateDimension( int nDimension ) override;
865 void setX( double xIn ) { x = xIn; flags |= OGR_G_NOT_EMPTY_POINT; }
869 void setY( double yIn ) { y = yIn; flags |= OGR_G_NOT_EMPTY_POINT; }
873 void setZ( double zIn )
874 { z = zIn; flags |= (OGR_G_NOT_EMPTY_POINT | OGR_G_3D); }
878 void setM( double mIn )
879 { m = mIn; flags |= (OGR_G_NOT_EMPTY_POINT | OGR_G_MEASURED); }
880
881 // ISpatialRelation
882 virtual OGRBoolean Equals( const OGRGeometry * ) const override;
883 virtual OGRBoolean Intersects( const OGRGeometry * ) const override;
884 virtual OGRBoolean Within( const OGRGeometry * ) const override;
885
886 // Non standard from OGRGeometry
887 virtual const char *getGeometryName() const override;
888 virtual OGRwkbGeometryType getGeometryType() const override;
889 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) override;
890 virtual void flattenTo2D() override;
891 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
892 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
893
894 virtual void swapXY() override;
895 };
896
897 /************************************************************************/
898 /* OGRPointIterator */
899 /************************************************************************/
900
907 class CPL_DLL OGRPointIterator
908 {
909 public:
910 virtual ~OGRPointIterator();
911 virtual OGRBoolean getNextPoint( OGRPoint* p ) = 0;
912
913 static void destroy( OGRPointIterator* );
914 };
915
916 /************************************************************************/
917 /* OGRCurve */
918 /************************************************************************/
919
925 class CPL_DLL OGRCurve : public OGRGeometry
926 {
927 protected:
929 OGRCurve();
930 OGRCurve( const OGRCurve& other );
931
932 virtual OGRCurveCasterToLineString GetCasterToLineString() const = 0;
933 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing() const = 0;
934
935 friend class OGRCurvePolygon;
936 friend class OGRCompoundCurve;
938 virtual int ContainsPoint( const OGRPoint* p ) const;
939 virtual int IntersectsPoint( const OGRPoint* p ) const;
940 virtual double get_AreaOfCurveSegments() const = 0;
941
942 private:
943
944 class CPL_DLL ConstIterator
945 {
946 struct Private;
947 std::unique_ptr<Private> m_poPrivate;
948 public:
949 ConstIterator(const OGRCurve* poSelf, bool bStart);
950 ConstIterator(ConstIterator&& oOther) noexcept; // declared but not defined. Needed for gcc 5.4 at least
951 ~ConstIterator();
952 const OGRPoint& operator*() const;
953 ConstIterator& operator++();
954 bool operator!=(const ConstIterator& it) const;
955 };
956
957 friend inline ConstIterator begin(const OGRCurve*);
958 friend inline ConstIterator end(const OGRCurve*);
959
960 public:
961 ~OGRCurve() override;
962
964 OGRCurve& operator=( const OGRCurve& other );
966
968 typedef OGRPoint ChildType;
969
978 ConstIterator begin() const;
980 ConstIterator end() const;
981
982 // ICurve methods
983 virtual double get_Length() const = 0;
984 virtual void StartPoint( OGRPoint * ) const = 0;
985 virtual void EndPoint( OGRPoint * ) const = 0;
986 virtual int get_IsClosed() const;
987 virtual void Value( double, OGRPoint * ) const = 0;
988 virtual OGRLineString* CurveToLine( double dfMaxAngleStepSizeDegrees = 0,
989 const char* const* papszOptions = nullptr)
990 const = 0;
991 virtual int getDimension() const override;
992
993 // non standard
994 virtual int getNumPoints() const = 0;
995 virtual OGRPointIterator* getPointIterator() const = 0;
996 virtual OGRBoolean IsConvex() const;
997 virtual double get_Area() const = 0;
998
1001 inline OGRSimpleCurve* toSimpleCurve()
1002 { return cpl::down_cast<OGRSimpleCurve*>(this); }
1003
1006 inline const OGRSimpleCurve* toSimpleCurve() const
1007 { return cpl::down_cast<const OGRSimpleCurve*>(this); }
1008
1009 static OGRCompoundCurve* CastToCompoundCurve( OGRCurve* puCurve );
1010 static OGRLineString* CastToLineString( OGRCurve* poCurve );
1011 static OGRLinearRing* CastToLinearRing( OGRCurve* poCurve );
1012 };
1013
1015
1016 inline OGRCurve::ConstIterator begin(const OGRCurve* poCurve) { return poCurve->begin(); }
1018 inline OGRCurve::ConstIterator end(const OGRCurve* poCurve) { return poCurve->end(); }
1020
1021 /************************************************************************/
1022 /* OGRSimpleCurve */
1023 /************************************************************************/
1024
1034 class CPL_DLL OGRSimpleCurve: public OGRCurve
1035 {
1036 protected:
1038 friend class OGRGeometry;
1039
1040 int nPointCount;
1041 OGRRawPoint *paoPoints;
1042 double *padfZ;
1043 double *padfM;
1044
1045 void Make3D();
1046 void Make2D();
1047 void RemoveM();
1048 void AddM();
1049
1050 OGRErr importFromWKTListOnly( const char ** ppszInput, int bHasZ, int bHasM,
1051 OGRRawPoint*& paoPointsIn,
1052 int& nMaxPoints,
1053 double*& padfZIn );
1054
1056
1057 virtual double get_LinearArea() const;
1058
1059 OGRSimpleCurve();
1060 OGRSimpleCurve( const OGRSimpleCurve& other );
1061
1062 private:
1063 class CPL_DLL Iterator
1064 {
1065 struct Private;
1066 std::unique_ptr<Private> m_poPrivate;
1067 void update();
1068 public:
1069 Iterator(OGRSimpleCurve* poSelf, int nPos);
1070 Iterator(Iterator&& oOther) noexcept; // declared but not defined. Needed for gcc 5.4 at least
1071 ~Iterator();
1072 OGRPoint& operator*();
1073 Iterator& operator++();
1074 bool operator!=(const Iterator& it) const;
1075 };
1076
1077 friend inline Iterator begin(OGRSimpleCurve*);
1078 friend inline Iterator end(OGRSimpleCurve*);
1079
1080 class CPL_DLL ConstIterator
1081 {
1082 struct Private;
1083 std::unique_ptr<Private> m_poPrivate;
1084 public:
1085 ConstIterator(const OGRSimpleCurve* poSelf, int nPos);
1086 ConstIterator(ConstIterator&& oOther) noexcept; // declared but not defined. Needed for gcc 5.4 at least
1087 ~ConstIterator();
1088 const OGRPoint& operator*() const;
1089 ConstIterator& operator++();
1090 bool operator!=(const ConstIterator& it) const;
1091 };
1092
1093 friend inline ConstIterator begin(const OGRSimpleCurve*);
1094 friend inline ConstIterator end(const OGRSimpleCurve*);
1095
1096 public:
1097 ~OGRSimpleCurve() override;
1098
1099 OGRSimpleCurve& operator=( const OGRSimpleCurve& other );
1100
1102 typedef OGRPoint ChildType;
1103
1112 Iterator begin();
1114 Iterator end();
1123 ConstIterator begin() const;
1125 ConstIterator end() const;
1126
1127 // IWks Interface.
1128 virtual int WkbSize() const override;
1129 virtual OGRErr importFromWkb( const unsigned char *,
1130 int,
1131 OGRwkbVariant,
1132 int& nBytesConsumedOut ) override;
1133 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1134 OGRwkbVariant=wkbVariantOldOgc )
1135 const override;
1136 using OGRGeometry::importFromWkt;
1137 OGRErr importFromWkt( const char ** ) override;
1138 virtual OGRErr exportToWkt( char ** ppszDstText,
1139 OGRwkbVariant=wkbVariantOldOgc )
1140 const override;
1141
1142 // IGeometry interface.
1143 virtual OGRGeometry *clone() const override;
1144 virtual void empty() override;
1145 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
1146 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
1147 virtual OGRBoolean IsEmpty() const override;
1148
1149 // ICurve methods.
1150 virtual double get_Length() const override;
1151 virtual void StartPoint( OGRPoint * ) const override;
1152 virtual void EndPoint( OGRPoint * ) const override;
1153 virtual void Value( double, OGRPoint * ) const override;
1154 virtual double Project( const OGRPoint * ) const;
1155 virtual OGRLineString* getSubLine( double, double, int ) const;
1156
1157 // ILineString methods.
1158 virtual int getNumPoints() const override { return nPointCount; }
1159 void getPoint( int, OGRPoint * ) const;
1160 double getX( int i ) const { return paoPoints[i].x; }
1161 double getY( int i ) const { return paoPoints[i].y; }
1162 double getZ( int i ) const;
1163 double getM( int i ) const;
1164
1165 // ISpatialRelation
1166 virtual OGRBoolean Equals( const OGRGeometry * ) const override;
1167
1168 // non standard.
1169 virtual void setCoordinateDimension( int nDimension ) override;
1170 virtual void set3D( OGRBoolean bIs3D ) override;
1171 virtual void setMeasured( OGRBoolean bIsMeasured ) override;
1172 void setNumPoints( int nNewPointCount,
1173 int bZeroizeNewContent = TRUE );
1174 void setPoint( int, OGRPoint * );
1175 void setPoint( int, double, double );
1176 void setZ( int, double );
1177 void setM( int, double );
1178 void setPoint( int, double, double, double );
1179 void setPointM( int, double, double, double );
1180 void setPoint( int, double, double, double, double );
1181 void setPoints( int, const OGRRawPoint *, const double * = nullptr );
1182 void setPointsM( int, const OGRRawPoint *, const double * );
1183 void setPoints( int, const OGRRawPoint *, const double *, const double * );
1184 void setPoints( int, const double * padfX, const double * padfY,
1185 const double *padfZIn = nullptr );
1186 void setPointsM( int, const double * padfX, const double * padfY,
1187 const double *padfMIn = nullptr );
1188 void setPoints( int, const double * padfX, const double * padfY,
1189 const double *padfZIn, const double *padfMIn );
1190 void addPoint( const OGRPoint * );
1191 void addPoint( double, double );
1192 void addPoint( double, double, double );
1193 void addPointM( double, double, double );
1194 void addPoint( double, double, double, double );
1195
1196 void getPoints( OGRRawPoint *, double * = nullptr ) const;
1197 void getPoints( void* pabyX, int nXStride,
1198 void* pabyY, int nYStride,
1199 void* pabyZ = nullptr, int nZStride = 0 ) const;
1200 void getPoints( void* pabyX, int nXStride,
1201 void* pabyY, int nYStride,
1202 void* pabyZ, int nZStride,
1203 void* pabyM, int nMStride ) const;
1204
1205 void addSubLineString( const OGRLineString *,
1206 int nStartVertex = 0, int nEndVertex = -1 );
1207 void reversePoints( void );
1208 virtual OGRPointIterator* getPointIterator() const override;
1209
1210 // non-standard from OGRGeometry
1211 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) override;
1212 virtual void flattenTo2D() override;
1213 virtual void segmentize(double dfMaxLength) override;
1214
1215 virtual void swapXY() override;
1216 };
1217
1219
1220 inline OGRSimpleCurve::Iterator begin(OGRSimpleCurve* poCurve) { return poCurve->begin(); }
1222 inline OGRSimpleCurve::Iterator end(OGRSimpleCurve* poCurve) { return poCurve->end(); }
1223
1225 inline OGRSimpleCurve::ConstIterator begin(const OGRSimpleCurve* poCurve) { return poCurve->begin(); }
1227 inline OGRSimpleCurve::ConstIterator end(const OGRSimpleCurve* poCurve) { return poCurve->end(); }
1229
1230 /************************************************************************/
1231 /* OGRLineString */
1232 /************************************************************************/
1233
1241 class CPL_DLL OGRLineString : public OGRSimpleCurve
1242 {
1243 // cppcheck-suppress unusedPrivateFunction
1244 static OGRLinearRing* CasterToLinearRing(OGRCurve* poCurve);
1245
1246 protected:
1248 static OGRLineString* TransferMembersAndDestroy(
1249 OGRLineString* poSrc,
1250 OGRLineString* poDst);
1251
1252 virtual OGRCurveCasterToLineString GetCasterToLineString()
1253 const override;
1254 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
1255 const override;
1256
1257 virtual double get_AreaOfCurveSegments() const override;
1259
1260 static OGRLinearRing* CastToLinearRing( OGRLineString* poLS );
1261
1262 public:
1263 OGRLineString();
1264 OGRLineString( const OGRLineString& other );
1265 ~OGRLineString() override;
1266
1267 OGRLineString& operator=(const OGRLineString& other);
1268
1269 virtual OGRLineString* CurveToLine( double dfMaxAngleStepSizeDegrees = 0,
1270 const char* const* papszOptions = nullptr )
1271 const override;
1272 virtual OGRGeometry* getCurveGeometry(
1273 const char* const* papszOptions = nullptr ) const override;
1274 virtual double get_Area() const override;
1275
1276 // Non-standard from OGRGeometry.
1277 virtual OGRwkbGeometryType getGeometryType() const override;
1278 virtual const char *getGeometryName() const override;
1279
1281 inline OGRSimpleCurve* toUpperClass() { return this; }
1283 inline const OGRSimpleCurve* toUpperClass() const { return this; }
1284
1285 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
1286 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
1287 };
1288
1289 /************************************************************************/
1290 /* OGRLinearRing */
1291 /************************************************************************/
1292
1313 class CPL_DLL OGRLinearRing : public OGRLineString
1314 {
1315 static OGRLineString* CasterToLineString( OGRCurve* poCurve );
1316
1317 protected:
1319 friend class OGRPolygon;
1320 friend class OGRTriangle;
1321
1322 // These are not IWks compatible ... just a convenience for OGRPolygon.
1323 virtual int _WkbSize( int _flags ) const;
1324 virtual OGRErr _importFromWkb( OGRwkbByteOrder, int _flags,
1325 const unsigned char *, int,
1326 int& nBytesConsumedOut );
1327 virtual OGRErr _exportToWkb( OGRwkbByteOrder, int _flags,
1328 unsigned char * ) const;
1329
1330 virtual OGRCurveCasterToLineString GetCasterToLineString()
1331 const override;
1332 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
1333 const override;
1335
1336 static OGRLineString* CastToLineString( OGRLinearRing* poLR );
1337
1338 public:
1339 OGRLinearRing();
1340 OGRLinearRing( const OGRLinearRing& other );
1341 explicit OGRLinearRing( OGRLinearRing * );
1342 ~OGRLinearRing() override;
1343
1344 OGRLinearRing& operator=( const OGRLinearRing& other );
1345
1346 // Non standard.
1347 virtual const char *getGeometryName() const override;
1348 virtual OGRGeometry *clone() const override;
1349 virtual int isClockwise() const;
1350 virtual void reverseWindingOrder();
1351 virtual void closeRings() override;
1352 OGRBoolean isPointInRing( const OGRPoint* pt,
1353 int bTestEnvelope = TRUE ) const;
1354 OGRBoolean isPointOnRingBoundary( const OGRPoint* pt,
1355 int bTestEnvelope = TRUE ) const;
1356 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) override;
1357
1359 inline OGRLineString* toUpperClass() { return this; }
1361 inline const OGRLineString* toUpperClass() const { return this; }
1362
1363 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
1364 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
1365
1366 // IWks Interface - Note this isn't really a first class object
1367 // for the purposes of WKB form. These methods always fail since this
1368 // object can't be serialized on its own.
1369 virtual int WkbSize() const override;
1370 virtual OGRErr importFromWkb( const unsigned char *,
1371 int,
1372 OGRwkbVariant,
1373 int& nBytesConsumedOut ) override;
1374 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1375 OGRwkbVariant=wkbVariantOldOgc )
1376 const override;
1377 };
1378
1379 /************************************************************************/
1380 /* OGRCircularString */
1381 /************************************************************************/
1382
1395 class CPL_DLL OGRCircularString : public OGRSimpleCurve
1396 {
1397 private:
1398 void ExtendEnvelopeWithCircular( OGREnvelope * psEnvelope ) const;
1399 OGRBoolean IsValidFast() const;
1400 int IsFullCircle( double& cx, double& cy, double& square_R ) const;
1401
1402 protected:
1404 virtual OGRCurveCasterToLineString GetCasterToLineString()
1405 const override;
1406 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
1407 const override;
1408 virtual int IntersectsPoint( const OGRPoint* p ) const override;
1409 virtual int ContainsPoint( const OGRPoint* p ) const override;
1410 virtual double get_AreaOfCurveSegments() const override;
1412
1413 public:
1414 OGRCircularString();
1415 OGRCircularString( const OGRCircularString& other );
1416 ~OGRCircularString() override;
1417
1418 OGRCircularString& operator=(const OGRCircularString& other);
1419
1420 // IWks Interface.
1421 virtual OGRErr importFromWkb( const unsigned char *,
1422 int,
1423 OGRwkbVariant,
1424 int& nBytesConsumedOut ) override;
1425 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1426 OGRwkbVariant=wkbVariantOldOgc )
1427 const override;
1428 using OGRGeometry::importFromWkt;
1429 OGRErr importFromWkt( const char ** ) override;
1430 virtual OGRErr exportToWkt( char ** ppszDstText,
1431 OGRwkbVariant=wkbVariantOldOgc )
1432 const override;
1433
1434 // IGeometry interface.
1435 virtual OGRBoolean IsValid() const override;
1436 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
1437 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
1438
1439 // ICurve methods.
1440 virtual double get_Length() const override;
1441 virtual OGRLineString* CurveToLine( double dfMaxAngleStepSizeDegrees = 0,
1442 const char* const* papszOptions = nullptr )
1443 const override;
1444 virtual void Value( double, OGRPoint * ) const override;
1445 virtual double get_Area() const override;
1446
1447 // Non-standard from OGRGeometry.
1448 virtual OGRwkbGeometryType getGeometryType() const override;
1449 virtual const char *getGeometryName() const override;
1450 virtual void segmentize( double dfMaxLength ) override;
1451 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
1452 const override;
1453 virtual OGRGeometry* getLinearGeometry(
1454 double dfMaxAngleStepSizeDegrees = 0,
1455 const char* const* papszOptions = nullptr) const override;
1456
1458 inline OGRSimpleCurve* toUpperClass() { return this; }
1460 inline const OGRSimpleCurve* toUpperClass() const { return this; }
1461
1462 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
1463 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
1464 };
1465
1466 /************************************************************************/
1467 /* OGRCurveCollection */
1468 /************************************************************************/
1469
1480 class CPL_DLL OGRCurveCollection
1482 {
1483 protected:
1484 friend class OGRCompoundCurve;
1485 friend class OGRCurvePolygon;
1486 friend class OGRPolygon;
1487 friend class OGRTriangle;
1488
1489 int nCurveCount = 0;
1490 OGRCurve **papoCurves = nullptr;
1491
1492 public:
1493 OGRCurveCollection();
1494 OGRCurveCollection(const OGRCurveCollection& other);
1495 ~OGRCurveCollection();
1496
1497 OGRCurveCollection& operator=(const OGRCurveCollection& other);
1498
1500 typedef OGRCurve ChildType;
1501
1505 OGRCurve** begin() { return papoCurves; }
1507 OGRCurve** end() { return papoCurves + nCurveCount; }
1511 const OGRCurve* const* begin() const { return papoCurves; }
1513 const OGRCurve* const* end() const { return papoCurves + nCurveCount; }
1514
1515 void empty(OGRGeometry* poGeom);
1516 OGRBoolean IsEmpty() const;
1517 void getEnvelope( OGREnvelope * psEnvelope ) const;
1518 void getEnvelope( OGREnvelope3D * psEnvelope ) const;
1519
1520 OGRErr addCurveDirectly( OGRGeometry* poGeom, OGRCurve* poCurve,
1521 int bNeedRealloc );
1522 int WkbSize() const;
1523 OGRErr importPreambleFromWkb( OGRGeometry* poGeom,
1524 const unsigned char * pabyData,
1525 int& nSize,
1526 int& nDataOffset,
1527 OGRwkbByteOrder& eByteOrder,
1528 int nMinSubGeomSize,
1529 OGRwkbVariant eWkbVariant );
1530 OGRErr importBodyFromWkb(
1531 OGRGeometry* poGeom,
1532 const unsigned char * pabyData,
1533 int nSize,
1534 int bAcceptCompoundCurve,
1535 OGRErr (*pfnAddCurveDirectlyFromWkb)( OGRGeometry* poGeom,
1536 OGRCurve* poCurve ),
1537 OGRwkbVariant eWkbVariant,
1538 int& nBytesConsumedOut );
1539 OGRErr exportToWkt( const OGRGeometry* poGeom,
1540 char ** ppszDstText ) const;
1541 OGRErr exportToWkb( const OGRGeometry* poGeom, OGRwkbByteOrder,
1542 unsigned char *,
1543 OGRwkbVariant eWkbVariant ) const;
1544 OGRBoolean Equals(const OGRCurveCollection *poOCC) const;
1545 void setCoordinateDimension( OGRGeometry* poGeom,
1546 int nNewDimension );
1547 void set3D( OGRGeometry* poGeom, OGRBoolean bIs3D );
1548 void setMeasured( OGRGeometry* poGeom, OGRBoolean bIsMeasured );
1549 void assignSpatialReference( OGRGeometry* poGeom, OGRSpatialReference * poSR );
1550 int getNumCurves() const;
1551 OGRCurve *getCurve( int );
1552 const OGRCurve *getCurve( int ) const;
1553 OGRCurve *stealCurve( int );
1554
1555 OGRErr removeCurve( int iIndex, bool bDelete = true );
1556
1557 OGRErr transform( OGRGeometry* poGeom,
1558 OGRCoordinateTransformation *poCT );
1559 void flattenTo2D( OGRGeometry* poGeom );
1560 void segmentize( double dfMaxLength );
1561 void swapXY();
1562 OGRBoolean hasCurveGeometry(int bLookForNonLinear) const;
1563 };
1565
1566 /************************************************************************/
1567 /* OGRCompoundCurve */
1568 /************************************************************************/
1569
1580 class CPL_DLL OGRCompoundCurve : public OGRCurve
1581 {
1582 private:
1583 OGRCurveCollection oCC{};
1584
1585 OGRErr addCurveDirectlyInternal( OGRCurve* poCurve,
1586 double dfToleranceEps,
1587 int bNeedRealloc );
1588 static OGRErr addCurveDirectlyFromWkt( OGRGeometry* poSelf,
1589 OGRCurve* poCurve );
1590 static OGRErr addCurveDirectlyFromWkb( OGRGeometry* poSelf,
1591 OGRCurve* poCurve );
1592 OGRLineString* CurveToLineInternal( double dfMaxAngleStepSizeDegrees,
1593 const char* const* papszOptions,
1594 int bIsLinearRing ) const;
1595 // cppcheck-suppress unusedPrivateFunction
1596 static OGRLineString* CasterToLineString( OGRCurve* poCurve );
1597 // cppcheck-suppress unusedPrivateFunction
1598 static OGRLinearRing* CasterToLinearRing( OGRCurve* poCurve );
1599
1600 protected:
1602 static OGRLineString* CastToLineString( OGRCompoundCurve* poCC );
1603 static OGRLinearRing* CastToLinearRing( OGRCompoundCurve* poCC );
1604
1605 virtual OGRCurveCasterToLineString GetCasterToLineString()
1606 const override;
1607 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
1608 const override;
1610
1611 public:
1612 OGRCompoundCurve();
1613 OGRCompoundCurve( const OGRCompoundCurve& other );
1614 ~OGRCompoundCurve() override;
1615
1616 OGRCompoundCurve& operator=( const OGRCompoundCurve& other );
1617
1619 typedef OGRCurve ChildType;
1620
1624 ChildType** begin() { return oCC.begin(); }
1626 ChildType** end() { return oCC.end(); }
1630 const ChildType* const * begin() const { return oCC.begin(); }
1632 const ChildType* const * end() const { return oCC.end(); }
1633
1634 // IWks Interface
1635 virtual int WkbSize() const override;
1636 virtual OGRErr importFromWkb( const unsigned char *,
1637 int,
1638 OGRwkbVariant,
1639 int& nBytesConsumedOut ) override;
1640 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1641 OGRwkbVariant=wkbVariantOldOgc )
1642 const override;
1643 using OGRGeometry::importFromWkt;
1644 OGRErr importFromWkt( const char ** ) override;
1645 virtual OGRErr exportToWkt( char ** ppszDstText,
1646 OGRwkbVariant=wkbVariantOldOgc )
1647 const override;
1648
1649 // IGeometry interface.
1650 virtual OGRGeometry *clone() const override;
1651 virtual void empty() override;
1652 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
1653 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
1654 virtual OGRBoolean IsEmpty() const override;
1655
1656 // ICurve methods.
1657 virtual double get_Length() const override;
1658 virtual void StartPoint( OGRPoint * ) const override;
1659 virtual void EndPoint( OGRPoint * ) const override;
1660 virtual void Value( double, OGRPoint * ) const override;
1661 virtual OGRLineString* CurveToLine( double dfMaxAngleStepSizeDegrees = 0,
1662 const char* const* papszOptions = nullptr )
1663 const override;
1664
1665 virtual int getNumPoints() const override;
1666 virtual double get_AreaOfCurveSegments() const override;
1667 virtual double get_Area() const override;
1668
1669 // ISpatialRelation.
1670 virtual OGRBoolean Equals( const OGRGeometry * ) const override;
1671
1672 // ICompoundCurve method.
1673 int getNumCurves() const;
1674 OGRCurve *getCurve( int );
1675 const OGRCurve *getCurve( int ) const;
1676
1677 // Non-standard.
1678 virtual void setCoordinateDimension( int nDimension ) override;
1679 virtual void set3D( OGRBoolean bIs3D ) override;
1680 virtual void setMeasured( OGRBoolean bIsMeasured ) override;
1681
1682 virtual void assignSpatialReference( OGRSpatialReference * poSR ) override;
1683
1684 OGRErr addCurve( OGRCurve*, double dfToleranceEps = 1e-14 );
1685 OGRErr addCurveDirectly( OGRCurve*, double dfToleranceEps = 1e-14 );
1686 OGRCurve *stealCurve( int );
1687 virtual OGRPointIterator* getPointIterator() const override;
1688
1689 // Non-standard from OGRGeometry.
1690 virtual OGRwkbGeometryType getGeometryType() const override;
1691 virtual const char *getGeometryName() const override;
1692 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) override;
1693 virtual void flattenTo2D() override;
1694 virtual void segmentize(double dfMaxLength) override;
1695 virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear = FALSE)
1696 const override;
1697 virtual OGRGeometry* getLinearGeometry(
1698 double dfMaxAngleStepSizeDegrees = 0,
1699 const char* const* papszOptions = nullptr) const override;
1700 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
1701 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
1702
1703 virtual void swapXY() override;
1704 };
1705
1707
1708 inline const OGRCompoundCurve::ChildType* const * begin(const OGRCompoundCurve* poCurve) { return poCurve->begin(); }
1710 inline const OGRCompoundCurve::ChildType* const * end(const OGRCompoundCurve* poCurve) { return poCurve->end(); }
1711
1713 inline OGRCompoundCurve::ChildType** begin(OGRCompoundCurve* poCurve) { return poCurve->begin(); }
1715 inline OGRCompoundCurve::ChildType** end(OGRCompoundCurve* poCurve) { return poCurve->end(); }
1717
1718 /************************************************************************/
1719 /* OGRSurface */
1720 /************************************************************************/
1721
1727 class CPL_DLL OGRSurface : public OGRGeometry
1728 {
1729 protected:
1731 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon() const = 0;
1732 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon() const = 0;
1734
1735 public:
1736 virtual double get_Area() const = 0;
1737 virtual OGRErr PointOnSurface( OGRPoint * poPoint ) const
1738 { return PointOnSurfaceInternal(poPoint); }
1740 static OGRPolygon* CastToPolygon(OGRSurface* poSurface);
1741 static OGRCurvePolygon* CastToCurvePolygon(OGRSurface* poSurface);
1743 };
1744
1745 /************************************************************************/
1746 /* OGRCurvePolygon */
1747 /************************************************************************/
1748
1762 class CPL_DLL OGRCurvePolygon : public OGRSurface
1763 {
1764 static OGRPolygon* CasterToPolygon(OGRSurface* poSurface);
1765
1766 private:
1767 OGRBoolean IntersectsPoint( const OGRPoint* p ) const;
1768 OGRBoolean ContainsPoint( const OGRPoint* p ) const;
1769 virtual int checkRing( OGRCurve * poNewRing ) const;
1770 OGRErr addRingDirectlyInternal( OGRCurve* poCurve,
1771 int bNeedRealloc );
1772 static OGRErr addCurveDirectlyFromWkt( OGRGeometry* poSelf,
1773 OGRCurve* poCurve );
1774 static OGRErr addCurveDirectlyFromWkb( OGRGeometry* poSelf,
1775 OGRCurve* poCurve );
1776
1777 protected:
1779 friend class OGRPolygon;
1780 friend class OGRTriangle;
1781 OGRCurveCollection oCC{};
1782
1783 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
1784 const override;
1785 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
1786 const override;
1788
1789 static OGRPolygon* CastToPolygon( OGRCurvePolygon* poCP );
1790
1791 public:
1792 OGRCurvePolygon();
1793 OGRCurvePolygon( const OGRCurvePolygon& );
1794 ~OGRCurvePolygon() override;
1795
1796 OGRCurvePolygon& operator=( const OGRCurvePolygon& other );
1797
1799 typedef OGRCurve ChildType;
1800
1804 ChildType** begin() { return oCC.begin(); }
1806 ChildType** end() { return oCC.end(); }
1810 const ChildType* const * begin() const { return oCC.begin(); }
1812 const ChildType* const * end() const { return oCC.end(); }
1813
1814 // Non standard (OGRGeometry).
1815 virtual const char *getGeometryName() const override;
1816 virtual OGRwkbGeometryType getGeometryType() const override;
1817 virtual OGRGeometry *clone() const override;
1818 virtual void empty() override;
1819 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) override;
1820 virtual void flattenTo2D() override;
1821 virtual OGRBoolean IsEmpty() const override;
1822 virtual void segmentize( double dfMaxLength ) override;
1823 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
1824 const override;
1825 virtual OGRGeometry* getLinearGeometry(
1826 double dfMaxAngleStepSizeDegrees = 0,
1827 const char* const* papszOptions = nullptr ) const override;
1828
1829 // ISurface Interface
1830 virtual double get_Area() const override;
1831
1832 // IWks Interface
1833 virtual int WkbSize() const override;
1834 virtual OGRErr importFromWkb( const unsigned char *,
1835 int,
1836 OGRwkbVariant,
1837 int& nBytesConsumedOut ) override;
1838 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1839 OGRwkbVariant=wkbVariantOldOgc )
1840 const override;
1841 using OGRGeometry::importFromWkt;
1842 OGRErr importFromWkt( const char ** ) override;
1843 virtual OGRErr exportToWkt( char ** ppszDstText,
1844 OGRwkbVariant eWkbVariant = wkbVariantOldOgc )
1845 const override;
1846
1847 // IGeometry
1848 virtual int getDimension() const override;
1849 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
1850 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
1851
1852 // ICurvePolygon
1853 virtual OGRPolygon* CurvePolyToPoly(
1854 double dfMaxAngleStepSizeDegrees = 0,
1855 const char* const* papszOptions = nullptr ) const;
1856
1857 // ISpatialRelation
1858 virtual OGRBoolean Equals( const OGRGeometry * ) const override;
1859 virtual OGRBoolean Intersects( const OGRGeometry * ) const override;
1860 virtual OGRBoolean Contains( const OGRGeometry * ) const override;
1861
1862 // Non standard
1863 virtual void setCoordinateDimension( int nDimension ) override;
1864 virtual void set3D( OGRBoolean bIs3D ) override;
1865 virtual void setMeasured( OGRBoolean bIsMeasured ) override;
1866
1867 virtual void assignSpatialReference( OGRSpatialReference * poSR ) override;
1868
1869 virtual OGRErr addRing( OGRCurve * );
1870 virtual OGRErr addRingDirectly( OGRCurve * );
1871
1872 OGRCurve *getExteriorRingCurve();
1873 const OGRCurve *getExteriorRingCurve() const;
1874 int getNumInteriorRings() const;
1875 OGRCurve *getInteriorRingCurve( int );
1876 const OGRCurve *getInteriorRingCurve( int ) const;
1877
1878 OGRCurve *stealExteriorRingCurve();
1879
1880 OGRErr removeRing( int iIndex, bool bDelete = true );
1881 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
1882 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
1883
1884 virtual void swapXY() override;
1885 };
1886
1888
1889 inline const OGRCurvePolygon::ChildType* const * begin(const OGRCurvePolygon* poGeom) { return poGeom->begin(); }
1891 inline const OGRCurvePolygon::ChildType* const * end(const OGRCurvePolygon* poGeom) { return poGeom->end(); }
1892
1894 inline OGRCurvePolygon::ChildType** begin(OGRCurvePolygon* poGeom) { return poGeom->begin(); }
1896 inline OGRCurvePolygon::ChildType** end(OGRCurvePolygon* poGeom) { return poGeom->end(); }
1898
1899 /************************************************************************/
1900 /* OGRPolygon */
1901 /************************************************************************/
1902
1912 class CPL_DLL OGRPolygon : public OGRCurvePolygon
1913 {
1914 static OGRCurvePolygon* CasterToCurvePolygon(OGRSurface* poSurface);
1915
1916 protected:
1918 friend class OGRMultiSurface;
1919 friend class OGRPolyhedralSurface;
1920 friend class OGRTriangulatedSurface;
1921
1922 virtual int checkRing( OGRCurve * poNewRing ) const override;
1923 virtual OGRErr importFromWKTListOnly( const char ** ppszInput,
1924 int bHasZ, int bHasM,
1925 OGRRawPoint*& paoPoints,
1926 int& nMaxPoints,
1927 double*& padfZ );
1928
1929 static OGRCurvePolygon* CastToCurvePolygon(OGRPolygon* poPoly);
1930
1931 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
1932 const override;
1933 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
1934 const override;
1936
1937 public:
1938 OGRPolygon();
1939 OGRPolygon(const OGRPolygon& other);
1940 ~OGRPolygon() override;
1941
1942 OGRPolygon& operator=(const OGRPolygon& other);
1943
1945 typedef OGRLinearRing ChildType;
1946
1950 ChildType** begin() { return reinterpret_cast<ChildType**>(oCC.begin()); }
1952 ChildType** end() { return reinterpret_cast<ChildType**>(oCC.end()); }
1956 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(oCC.begin()); }
1958 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(oCC.end()); }
1959
1960 // Non-standard (OGRGeometry).
1961 virtual const char *getGeometryName() const override;
1962 virtual OGRwkbGeometryType getGeometryType() const override;
1963 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
1964 const override;
1965 virtual OGRGeometry* getCurveGeometry(
1966 const char* const* papszOptions = nullptr ) const override;
1967 virtual OGRGeometry* getLinearGeometry(
1968 double dfMaxAngleStepSizeDegrees = 0,
1969 const char* const* papszOptions = nullptr) const override;
1970
1971 // IWks Interface.
1972 virtual int WkbSize() const override;
1973 virtual OGRErr importFromWkb( const unsigned char *,
1974 int,
1975 OGRwkbVariant,
1976 int& nBytesConsumedOut ) override;
1977 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1978 OGRwkbVariant=wkbVariantOldOgc )
1979 const override;
1980 using OGRGeometry::importFromWkt;
1981 OGRErr importFromWkt( const char ** ) override;
1982
1983 virtual OGRErr exportToWkt( char ** ppszDstText,
1984 OGRwkbVariant=wkbVariantOldOgc )
1985 const override;
1986
1987 // ICurvePolygon.
1988 virtual OGRPolygon* CurvePolyToPoly(
1989 double dfMaxAngleStepSizeDegrees = 0,
1990 const char* const* papszOptions = nullptr ) const override;
1991
1992 OGRLinearRing *getExteriorRing();
1993 const OGRLinearRing *getExteriorRing() const;
1994 virtual OGRLinearRing *getInteriorRing( int );
1995 virtual const OGRLinearRing *getInteriorRing( int ) const;
1996
1997 OGRLinearRing *stealExteriorRing();
1998 virtual OGRLinearRing *stealInteriorRing(int);
1999
2000 OGRBoolean IsPointOnSurface( const OGRPoint * ) const;
2001
2003 inline OGRCurvePolygon* toUpperClass() { return this; }
2005 inline const OGRCurvePolygon* toUpperClass() const { return this; }
2006
2007 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2008 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2009
2010 virtual void closeRings() override;
2011 };
2012
2014
2015 inline const OGRPolygon::ChildType* const * begin(const OGRPolygon* poGeom) { return poGeom->begin(); }
2017 inline const OGRPolygon::ChildType* const * end(const OGRPolygon* poGeom) { return poGeom->end(); }
2018
2020 inline OGRPolygon::ChildType** begin(OGRPolygon* poGeom) { return poGeom->begin(); }
2022 inline OGRPolygon::ChildType** end(OGRPolygon* poGeom) { return poGeom->end(); }
2024
2025 /************************************************************************/
2026 /* OGRTriangle */
2027 /************************************************************************/
2028
2035 class CPL_DLL OGRTriangle : public OGRPolygon
2036 {
2037 private:
2038 // cppcheck-suppress unusedPrivateFunction
2039 static OGRPolygon* CasterToPolygon(OGRSurface* poSurface);
2040 bool quickValidityCheck() const;
2041
2042 protected:
2044 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon() const override;
2045 virtual OGRErr importFromWKTListOnly( const char ** ppszInput,
2046 int bHasZ, int bHasM,
2047 OGRRawPoint*& paoPoints,
2048 int& nMaxPoints,
2049 double*& padfZ ) override;
2051
2052 public:
2053 OGRTriangle();
2054 OGRTriangle( const OGRPoint &p, const OGRPoint &q, const OGRPoint &r );
2055 OGRTriangle( const OGRTriangle &other );
2056 OGRTriangle( const OGRPolygon &other, OGRErr &eErr );
2057 OGRTriangle& operator=( const OGRTriangle& other );
2058 ~OGRTriangle() override;
2059 virtual const char *getGeometryName() const override;
2060 virtual OGRwkbGeometryType getGeometryType() const override;
2061
2062 // IWks Interface.
2063 virtual OGRErr importFromWkb( const unsigned char *,
2064 int,
2065 OGRwkbVariant,
2066 int& nBytesConsumedOut ) override;
2067
2068 // New methods rewritten from OGRPolygon/OGRCurvePolygon/OGRGeometry.
2069 virtual OGRErr addRingDirectly( OGRCurve * poNewRing ) override;
2070
2072 inline OGRPolygon* toUpperClass() { return this; }
2074 inline const OGRPolygon* toUpperClass() const { return this; }
2075
2076 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2077 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2078
2080 static OGRGeometry* CastToPolygon( OGRGeometry* poGeom );
2082 };
2083
2084 /************************************************************************/
2085 /* OGRGeometryCollection */
2086 /************************************************************************/
2087
2095 class CPL_DLL OGRGeometryCollection : public OGRGeometry
2096 {
2097 OGRErr importFromWkbInternal( const unsigned char * pabyData,
2098 int nSize,
2099 int nRecLevel,
2100 OGRwkbVariant, int& nBytesConsumedOut );
2101 OGRErr importFromWktInternal( const char **ppszInput, int nRecLevel );
2102
2103 protected:
2105 int nGeomCount = 0;
2106 OGRGeometry **papoGeoms = nullptr;
2107
2108 OGRErr exportToWktInternal( char ** ppszDstText,
2109 OGRwkbVariant eWkbVariant,
2110 const char* pszSkipPrefix ) const;
2111 static OGRGeometryCollection* TransferMembersAndDestroy(
2112 OGRGeometryCollection* poSrc,
2113 OGRGeometryCollection* poDst );
2115 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType ) const;
2116
2117 public:
2118 OGRGeometryCollection();
2119 OGRGeometryCollection( const OGRGeometryCollection& other );
2120 ~OGRGeometryCollection() override;
2121
2122 OGRGeometryCollection& operator=( const OGRGeometryCollection& other );
2123
2125 typedef OGRGeometry ChildType;
2126
2130 ChildType** begin() { return papoGeoms; }
2132 ChildType** end() { return papoGeoms + nGeomCount; }
2136 const ChildType* const* begin() const { return papoGeoms; }
2138 const ChildType* const* end() const { return papoGeoms + nGeomCount; }
2139
2140 // Non standard (OGRGeometry).
2141 virtual const char *getGeometryName() const override;
2142 virtual OGRwkbGeometryType getGeometryType() const override;
2143 virtual OGRGeometry *clone() const override;
2144 virtual void empty() override;
2145 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) override;
2146 virtual void flattenTo2D() override;
2147 virtual OGRBoolean IsEmpty() const override;
2148 virtual void segmentize(double dfMaxLength) override;
2149 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2150 const override;
2151 virtual OGRGeometry* getCurveGeometry(
2152 const char* const* papszOptions = nullptr ) const override;
2153 virtual OGRGeometry* getLinearGeometry(
2154 double dfMaxAngleStepSizeDegrees = 0,
2155 const char* const* papszOptions = nullptr ) const override;
2156
2157 // IWks Interface
2158 virtual int WkbSize() const override;
2159 virtual OGRErr importFromWkb( const unsigned char *,
2160 int,
2161 OGRwkbVariant,
2162 int& nBytesConsumedOut ) override;
2163 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
2164 OGRwkbVariant=wkbVariantOldOgc )
2165 const override;
2166 using OGRGeometry::importFromWkt;
2167 OGRErr importFromWkt( const char ** ) override;
2168
2169 virtual OGRErr exportToWkt( char ** ppszDstText,
2170 OGRwkbVariant=wkbVariantOldOgc )
2171 const override;
2172
2173 virtual double get_Length() const;
2174 virtual double get_Area() const;
2175
2176 // IGeometry methods
2177 virtual int getDimension() const override;
2178 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
2179 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
2180
2181 // IGeometryCollection
2182 int getNumGeometries() const;
2183 OGRGeometry *getGeometryRef( int );
2184 const OGRGeometry *getGeometryRef( int ) const;
2185
2186 // ISpatialRelation
2187 virtual OGRBoolean Equals( const OGRGeometry * ) const override;
2188
2189 // Non standard
2190 virtual void setCoordinateDimension( int nDimension ) override;
2191 virtual void set3D( OGRBoolean bIs3D ) override;
2192 virtual void setMeasured( OGRBoolean bIsMeasured ) override;
2193 virtual OGRErr addGeometry( const OGRGeometry * );
2194 virtual OGRErr addGeometryDirectly( OGRGeometry * );
2195 virtual OGRErr removeGeometry( int iIndex, int bDelete = TRUE );
2196
2197 virtual void assignSpatialReference( OGRSpatialReference * poSR ) override;
2198
2199 void closeRings() override;
2200
2201 virtual void swapXY() override;
2202
2203 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2204 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2205
2206 static OGRGeometryCollection* CastToGeometryCollection(
2207 OGRGeometryCollection* poSrc );
2208 };
2209
2211
2212 inline const OGRGeometryCollection::ChildType* const * begin(const OGRGeometryCollection* poGeom) { return poGeom->begin(); }
2214 inline const OGRGeometryCollection::ChildType* const * end(const OGRGeometryCollection* poGeom) { return poGeom->end(); }
2215
2217 inline OGRGeometryCollection::ChildType** begin(OGRGeometryCollection* poGeom) { return poGeom->begin(); }
2219 inline OGRGeometryCollection::ChildType** end(OGRGeometryCollection* poGeom) { return poGeom->end(); }
2221
2222 /************************************************************************/
2223 /* OGRMultiSurface */
2224 /************************************************************************/
2225
2232 class CPL_DLL OGRMultiSurface : public OGRGeometryCollection
2233 {
2234 protected:
2235 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
2236 const override;
2237
2238 public:
2239 OGRMultiSurface();
2240 OGRMultiSurface( const OGRMultiSurface& other );
2241 ~OGRMultiSurface() override;
2242
2243 OGRMultiSurface& operator=( const OGRMultiSurface& other );
2244
2246 typedef OGRSurface ChildType;
2247
2251 ChildType** begin() { return reinterpret_cast<ChildType**>(papoGeoms); }
2253 ChildType** end() { return reinterpret_cast<ChildType**>(papoGeoms + nGeomCount); }
2257 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(papoGeoms); }
2259 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(papoGeoms + nGeomCount); }
2260
2261 // Non standard (OGRGeometry).
2262 virtual const char *getGeometryName() const override;
2263 virtual OGRwkbGeometryType getGeometryType() const override;
2264 using OGRGeometry::importFromWkt;
2265 OGRErr importFromWkt( const char ** ) override;
2266
2267 virtual OGRErr exportToWkt( char **, OGRwkbVariant=wkbVariantOldOgc )
2268 const override;
2269
2270 // IMultiSurface methods
2271 virtual OGRErr PointOnSurface( OGRPoint * poPoint ) const;
2272
2273 // IGeometry methods
2274 virtual int getDimension() const override;
2275
2276 // Non standard
2277 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2278 const override;
2279
2281 inline OGRGeometryCollection* toUpperClass() { return this; }
2283 inline const OGRGeometryCollection* toUpperClass() const { return this; }
2284
2285 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2286 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2287
2288 static OGRMultiPolygon* CastToMultiPolygon( OGRMultiSurface* poMS );
2289 };
2290
2292
2293 inline const OGRMultiSurface::ChildType* const * begin(const OGRMultiSurface* poGeom) { return poGeom->begin(); }
2295 inline const OGRMultiSurface::ChildType* const * end(const OGRMultiSurface* poGeom) { return poGeom->end(); }
2296
2298 inline OGRMultiSurface::ChildType** begin(OGRMultiSurface* poGeom) { return poGeom->begin(); }
2300 inline OGRMultiSurface::ChildType** end(OGRMultiSurface* poGeom) { return poGeom->end(); }
2302
2303 /************************************************************************/
2304 /* OGRMultiPolygon */
2305 /************************************************************************/
2306
2311 class CPL_DLL OGRMultiPolygon : public OGRMultiSurface
2312 {
2313 protected:
2314 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
2315 const override;
2316 friend class OGRPolyhedralSurface;
2317 friend class OGRTriangulatedSurface;
2318
2319 private:
2321 OGRErr _addGeometryWithExpectedSubGeometryType(
2322 const OGRGeometry * poNewGeom,
2323 OGRwkbGeometryType eSubGeometryType );
2324 OGRErr _addGeometryDirectlyWithExpectedSubGeometryType(
2325 OGRGeometry * poNewGeom,
2326 OGRwkbGeometryType eSubGeometryType );
2328
2329
2330 public:
2331 OGRMultiPolygon();
2332 OGRMultiPolygon( const OGRMultiPolygon& other );
2333 ~OGRMultiPolygon() override;
2334
2335 OGRMultiPolygon& operator=(const OGRMultiPolygon& other);
2336
2338 typedef OGRPolygon ChildType;
2339
2343 ChildType** begin() { return reinterpret_cast<ChildType**>(papoGeoms); }
2345 ChildType** end() { return reinterpret_cast<ChildType**>(papoGeoms + nGeomCount); }
2349 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(papoGeoms); }
2351 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(papoGeoms + nGeomCount); }
2352
2353 // Non-standard (OGRGeometry).
2354 virtual const char *getGeometryName() const override;
2355 virtual OGRwkbGeometryType getGeometryType() const override;
2356 virtual OGRErr exportToWkt( char **, OGRwkbVariant=wkbVariantOldOgc )
2357 const override;
2358
2359 // Non standard
2360 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2361 const override;
2362
2364 inline OGRGeometryCollection* toUpperClass() { return this; }
2366 inline const OGRGeometryCollection* toUpperClass() const { return this; }
2367
2368 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2369 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2370
2371 static OGRMultiSurface* CastToMultiSurface( OGRMultiPolygon* poMP );
2372 };
2373
2375
2376 inline const OGRMultiPolygon::ChildType* const * begin(const OGRMultiPolygon* poGeom) { return poGeom->begin(); }
2378 inline const OGRMultiPolygon::ChildType* const * end(const OGRMultiPolygon* poGeom) { return poGeom->end(); }
2379
2381 inline OGRMultiPolygon::ChildType** begin(OGRMultiPolygon* poGeom) { return poGeom->begin(); }
2383 inline OGRMultiPolygon::ChildType** end(OGRMultiPolygon* poGeom) { return poGeom->end(); }
2385
2386 /************************************************************************/
2387 /* OGRPolyhedralSurface */
2388 /************************************************************************/
2389
2396 class CPL_DLL OGRPolyhedralSurface : public OGRSurface
2397 {
2398 protected:
2400 friend class OGRTriangulatedSurface;
2401 OGRMultiPolygon oMP{};
2402 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
2403 const override;
2404 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
2405 const override;
2406 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType ) const;
2407 virtual const char* getSubGeometryName() const;
2408 virtual OGRwkbGeometryType getSubGeometryType() const;
2409 OGRErr exportToWktInternal (char ** ppszDstText, OGRwkbVariant eWkbVariant,
2410 const char* pszSkipPrefix ) const;
2411
2412 virtual OGRPolyhedralSurfaceCastToMultiPolygon GetCasterToMultiPolygon()
2413 const;
2414 static OGRMultiPolygon* CastToMultiPolygonImpl(OGRPolyhedralSurface* poPS);
2416
2417 public:
2418 OGRPolyhedralSurface();
2419 OGRPolyhedralSurface( const OGRPolyhedralSurface &poGeom );
2420 ~OGRPolyhedralSurface() override;
2421 OGRPolyhedralSurface& operator=(const OGRPolyhedralSurface& other);
2422
2424 typedef OGRPolygon ChildType;
2425
2429 ChildType** begin() { return oMP.begin(); }
2431 ChildType** end() { return oMP.end(); }
2435 const ChildType* const* begin() const { return oMP.begin(); }
2437 const ChildType* const* end() const { return oMP.end(); }
2438
2439 // IWks Interface.
2440 virtual int WkbSize() const override;
2441 virtual const char *getGeometryName() const override;
2442 virtual OGRwkbGeometryType getGeometryType() const override;
2443 virtual OGRErr importFromWkb( const unsigned char *,
2444 int,
2445 OGRwkbVariant,
2446 int& nBytesConsumedOut ) override;
2447 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
2448 OGRwkbVariant=wkbVariantOldOgc )
2449 const override;
2450 using OGRGeometry::importFromWkt;
2451 OGRErr importFromWkt( const char ** ) override;
2452 virtual OGRErr exportToWkt( char ** ppszDstText,
2453 OGRwkbVariant=wkbVariantOldOgc )
2454 const override;
2455
2456 // IGeometry methods.
2457 virtual int getDimension() const override;
2458
2459 virtual void empty() override;
2460
2461 virtual OGRGeometry *clone() const override;
2462 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
2463 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
2464
2465 virtual void flattenTo2D() override;
2466 virtual OGRErr transform( OGRCoordinateTransformation* ) override;
2467 virtual OGRBoolean Equals( const OGRGeometry* ) const override;
2468 virtual double get_Area() const override;
2469 virtual OGRErr PointOnSurface( OGRPoint* ) const override;
2470
2471 static OGRMultiPolygon* CastToMultiPolygon( OGRPolyhedralSurface* poPS );
2472 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2473 const override;
2474 virtual OGRErr addGeometry( const OGRGeometry * );
2475 OGRErr addGeometryDirectly( OGRGeometry *poNewGeom );
2476 int getNumGeometries() const;
2477 OGRGeometry* getGeometryRef(int i);
2478 const OGRGeometry* getGeometryRef(int i) const;
2479
2480 virtual OGRBoolean IsEmpty() const override;
2481 virtual void setCoordinateDimension( int nDimension ) override;
2482 virtual void set3D( OGRBoolean bIs3D ) override;
2483 virtual void setMeasured( OGRBoolean bIsMeasured ) override;
2484 virtual void swapXY() override;
2485 OGRErr removeGeometry( int iIndex, int bDelete = TRUE );
2486
2487 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2488 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2489
2490 virtual void assignSpatialReference( OGRSpatialReference * poSR ) override;
2491 };
2492
2494
2495 inline const OGRPolyhedralSurface::ChildType* const * begin(const OGRPolyhedralSurface* poGeom) { return poGeom->begin(); }
2497 inline const OGRPolyhedralSurface::ChildType* const * end(const OGRPolyhedralSurface* poGeom) { return poGeom->end(); }
2498
2500 inline OGRPolyhedralSurface::ChildType** begin(OGRPolyhedralSurface* poGeom) { return poGeom->begin(); }
2502 inline OGRPolyhedralSurface::ChildType** end(OGRPolyhedralSurface* poGeom) { return poGeom->end(); }
2504
2505 /************************************************************************/
2506 /* OGRTriangulatedSurface */
2507 /************************************************************************/
2508
2515 class CPL_DLL OGRTriangulatedSurface : public OGRPolyhedralSurface
2516 {
2517 protected:
2519 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
2520 const override;
2521 virtual const char* getSubGeometryName() const override;
2522 virtual OGRwkbGeometryType getSubGeometryType() const override;
2523
2524 virtual OGRPolyhedralSurfaceCastToMultiPolygon GetCasterToMultiPolygon()
2525 const override;
2526 static OGRMultiPolygon *
2527 CastToMultiPolygonImpl( OGRPolyhedralSurface* poPS );
2529
2530 public:
2531 OGRTriangulatedSurface();
2532 OGRTriangulatedSurface( const OGRTriangulatedSurface &other );
2533 ~OGRTriangulatedSurface();
2534
2536 typedef OGRTriangle ChildType;
2537
2541 ChildType** begin() { return reinterpret_cast<ChildType**>(oMP.begin()); }
2543 ChildType** end() { return reinterpret_cast<ChildType**>(oMP.end()); }
2547 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(oMP.begin()); }
2549 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(oMP.end()); }
2550
2551 OGRTriangulatedSurface& operator=( const OGRTriangulatedSurface& other );
2552 virtual const char *getGeometryName() const override;
2553 virtual OGRwkbGeometryType getGeometryType() const override;
2554
2555 // IWks Interface.
2556 virtual OGRErr addGeometry( const OGRGeometry * ) override;
2557
2559 inline OGRPolyhedralSurface* toUpperClass() { return this; }
2561 inline const OGRPolyhedralSurface* toUpperClass() const { return this; }
2562
2563 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2564 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2565
2566 static OGRPolyhedralSurface *
2567 CastToPolyhedralSurface( OGRTriangulatedSurface* poTS );
2568 };
2569
2571
2572 inline const OGRTriangulatedSurface::ChildType* const * begin(const OGRTriangulatedSurface* poGeom) { return poGeom->begin(); }
2574 inline const OGRTriangulatedSurface::ChildType* const * end(const OGRTriangulatedSurface* poGeom) { return poGeom->end(); }
2575
2577 inline OGRTriangulatedSurface::ChildType** begin(OGRTriangulatedSurface* poGeom) { return poGeom->begin(); }
2579 inline OGRTriangulatedSurface::ChildType** end(OGRTriangulatedSurface* poGeom) { return poGeom->end(); }
2581
2582 /************************************************************************/
2583 /* OGRMultiPoint */
2584 /************************************************************************/
2585
2590 class CPL_DLL OGRMultiPoint : public OGRGeometryCollection
2591 {
2592 private:
2593 OGRErr importFromWkt_Bracketed( const char **, int bHasM, int bHasZ );
2594
2595 protected:
2596 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
2597 const override;
2598
2599 public:
2600 OGRMultiPoint();
2601 OGRMultiPoint(const OGRMultiPoint& other);
2602 ~OGRMultiPoint() override;
2603
2604 OGRMultiPoint& operator=(const OGRMultiPoint& other);
2605
2607 typedef OGRPoint ChildType;
2608
2612 ChildType** begin() { return reinterpret_cast<ChildType**>(papoGeoms); }
2614 ChildType** end() { return reinterpret_cast<ChildType**>(papoGeoms + nGeomCount); }
2618 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(papoGeoms); }
2620 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(papoGeoms + nGeomCount); }
2621
2622 // Non-standard (OGRGeometry).
2623 virtual const char *getGeometryName() const override;
2624 virtual OGRwkbGeometryType getGeometryType() const override;
2625 using OGRGeometry::importFromWkt;
2626 OGRErr importFromWkt( const char ** ) override;
2627 virtual OGRErr exportToWkt( char **, OGRwkbVariant=wkbVariantOldOgc )
2628 const override;
2629
2630 // IGeometry methods.
2631 virtual int getDimension() const override;
2632
2634 inline OGRGeometryCollection* toUpperClass() { return this; }
2636 inline const OGRGeometryCollection* toUpperClass() const { return this; }
2637
2638 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2639 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2640
2641 // Non-standard.
2642 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2643 const override;
2644 };
2645
2647
2648 inline const OGRMultiPoint::ChildType* const * begin(const OGRMultiPoint* poGeom) { return poGeom->begin(); }
2650 inline const OGRMultiPoint::ChildType* const * end(const OGRMultiPoint* poGeom) { return poGeom->end(); }
2651
2653 inline OGRMultiPoint::ChildType** begin(OGRMultiPoint* poGeom) { return poGeom->begin(); }
2655 inline OGRMultiPoint::ChildType** end(OGRMultiPoint* poGeom) { return poGeom->end(); }
2657
2658 /************************************************************************/
2659 /* OGRMultiCurve */
2660 /************************************************************************/
2661
2668 class CPL_DLL OGRMultiCurve : public OGRGeometryCollection
2669 {
2670 protected:
2672 static OGRErr addCurveDirectlyFromWkt( OGRGeometry* poSelf,
2673 OGRCurve* poCurve );
2675 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
2676 const override;
2677
2678 public:
2679 OGRMultiCurve();
2680 OGRMultiCurve( const OGRMultiCurve& other );
2681 ~OGRMultiCurve() override;
2682
2683 OGRMultiCurve& operator=( const OGRMultiCurve& other );
2684
2686 typedef OGRCurve ChildType;
2687
2691 ChildType** begin() { return reinterpret_cast<ChildType**>(papoGeoms); }
2693 ChildType** end() { return reinterpret_cast<ChildType**>(papoGeoms + nGeomCount); }
2697 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(papoGeoms); }
2699 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(papoGeoms + nGeomCount); }
2700
2701 // Non standard (OGRGeometry).
2702 virtual const char *getGeometryName() const override;
2703 virtual OGRwkbGeometryType getGeometryType() const override;
2704 using OGRGeometry::importFromWkt;
2705 OGRErr importFromWkt( const char ** ) override;
2706 virtual OGRErr exportToWkt( char **, OGRwkbVariant=wkbVariantOldOgc )
2707 const override;
2708
2709 // IGeometry methods.
2710 virtual int getDimension() const override;
2711
2712 // Non-standard.
2713 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2714 const override;
2715
2717 inline OGRGeometryCollection* toUpperClass() { return this; }
2719 inline const OGRGeometryCollection* toUpperClass() const { return this; }
2720
2721 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2722 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2723
2724 static OGRMultiLineString* CastToMultiLineString(OGRMultiCurve* poMC);
2725 };
2726
2728
2729 inline const OGRMultiCurve::ChildType* const * begin(const OGRMultiCurve* poGeom) { return poGeom->begin(); }
2731 inline const OGRMultiCurve::ChildType* const * end(const OGRMultiCurve* poGeom) { return poGeom->end(); }
2732
2734 inline OGRMultiCurve::ChildType** begin(OGRMultiCurve* poGeom) { return poGeom->begin(); }
2736 inline OGRMultiCurve::ChildType** end(OGRMultiCurve* poGeom) { return poGeom->end(); }
2738
2739 /************************************************************************/
2740 /* OGRMultiLineString */
2741 /************************************************************************/
2742
2747 class CPL_DLL OGRMultiLineString : public OGRMultiCurve
2748 {
2749 protected:
2750 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
2751 const override;
2752
2753 public:
2754 OGRMultiLineString();
2755 OGRMultiLineString( const OGRMultiLineString& other );
2756 ~OGRMultiLineString() override;
2757
2758 OGRMultiLineString& operator=( const OGRMultiLineString& other );
2759
2761 typedef OGRLineString ChildType;
2762
2766 ChildType** begin() { return reinterpret_cast<ChildType**>(papoGeoms); }
2768 ChildType** end() { return reinterpret_cast<ChildType**>(papoGeoms + nGeomCount); }
2772 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(papoGeoms); }
2774 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(papoGeoms + nGeomCount); }
2775
2776 // Non standard (OGRGeometry).
2777 virtual const char *getGeometryName() const override;
2778 virtual OGRwkbGeometryType getGeometryType() const override;
2779 virtual OGRErr exportToWkt( char **, OGRwkbVariant=wkbVariantOldOgc )
2780 const override;
2781
2782 // Non standard
2783 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2784 const override;
2785
2787 inline OGRGeometryCollection* toUpperClass() { return this; }
2789 inline const OGRGeometryCollection* toUpperClass() const { return this; }
2790
2791 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2792 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2793
2794 static OGRMultiCurve* CastToMultiCurve( OGRMultiLineString* poMLS );
2795 };
2796
2798
2799 inline const OGRMultiLineString::ChildType* const * begin(const OGRMultiLineString* poGeom) { return poGeom->begin(); }
2801 inline const OGRMultiLineString::ChildType* const * end(const OGRMultiLineString* poGeom) { return poGeom->end(); }
2802
2804 inline OGRMultiLineString::ChildType** begin(OGRMultiLineString* poGeom) { return poGeom->begin(); }
2806 inline OGRMultiLineString::ChildType** end(OGRMultiLineString* poGeom) { return poGeom->end(); }
2808
2809 /************************************************************************/
2810 /* OGRGeometryFactory */
2811 /************************************************************************/
2812
2817 class CPL_DLL OGRGeometryFactory
2818 {
2819 static OGRErr createFromFgfInternal( const unsigned char *pabyData,
2820 OGRSpatialReference * poSR,
2821 OGRGeometry **ppoReturn,
2822 int nBytes,
2823 int *pnBytesConsumed,
2824 int nRecLevel );
2825 public:
2826 static OGRErr createFromWkb( const void *, OGRSpatialReference *,
2827 OGRGeometry **, int = -1,
2828 OGRwkbVariant=wkbVariantOldOgc );
2829 static OGRErr createFromWkb( const void * pabyData,
2830 OGRSpatialReference *,
2831 OGRGeometry **,
2832 int nSize,
2833 OGRwkbVariant eVariant,
2834 int& nBytesConsumedOut );
2835 static OGRErr createFromWkt( const char* , OGRSpatialReference *,
2836 OGRGeometry ** );
2837 static OGRErr createFromWkt( const char **, OGRSpatialReference *,
2838 OGRGeometry ** );
2842 static OGRErr createFromWkt( char ** ppszInput, OGRSpatialReference * poSRS,
2843 OGRGeometry ** ppoGeom )
2844 CPL_WARN_DEPRECATED("Use createFromWkt(const char**, ...) instead")
2845 {
2846 return createFromWkt( const_cast<const char**>(ppszInput), poSRS, ppoGeom);
2847 }
2848
2849 static OGRErr createFromFgf( const void*, OGRSpatialReference *,
2850 OGRGeometry **, int = -1, int * = nullptr );
2851 static OGRGeometry *createFromGML( const char * );
2852 static OGRGeometry *createFromGEOS( GEOSContextHandle_t hGEOSCtxt,
2853 GEOSGeom );
2854 static OGRGeometry *createFromGeoJson( const char *);
2855 static OGRGeometry *createFromGeoJson( const CPLJSONObject &oJSONObject );
2856
2857 static void destroyGeometry( OGRGeometry * );
2858 static OGRGeometry *createGeometry( OGRwkbGeometryType );
2859
2860 static OGRGeometry * forceToPolygon( OGRGeometry * );
2861 static OGRGeometry * forceToLineString( OGRGeometry *,
2862 bool bOnlyInOrder = true );
2863 static OGRGeometry * forceToMultiPolygon( OGRGeometry * );
2864 static OGRGeometry * forceToMultiPoint( OGRGeometry * );
2865 static OGRGeometry * forceToMultiLineString( OGRGeometry * );
2866
2867 static OGRGeometry * forceTo( OGRGeometry* poGeom,
2868 OGRwkbGeometryType eTargetType,
2869 const char*const* papszOptions = nullptr );
2870
2871 static OGRGeometry * organizePolygons( OGRGeometry **papoPolygons,
2872 int nPolygonCount,
2873 int *pbResultValidGeometry,
2874 const char **papszOptions = nullptr);
2875 static bool haveGEOS();
2876
2877 static OGRGeometry* transformWithOptions( const OGRGeometry* poSrcGeom,
2878 OGRCoordinateTransformation *poCT,
2879 char** papszOptions );
2880
2881 static OGRGeometry*
2882 approximateArcAngles( double dfX, double dfY, double dfZ,
2883 double dfPrimaryRadius, double dfSecondaryAxis,
2884 double dfRotation,
2885 double dfStartAngle, double dfEndAngle,
2886 double dfMaxAngleStepSizeDegrees );
2887
2888 static int GetCurveParmeters( double x0, double y0,
2889 double x1, double y1,
2890 double x2, double y2,
2891 double& R, double& cx, double& cy,
2892 double& alpha0, double& alpha1,
2893 double& alpha2 );
2894 static OGRLineString* curveToLineString(
2895 double x0, double y0, double z0,
2896 double x1, double y1, double z1,
2897 double x2, double y2, double z2,
2898 int bHasZ,
2899 double dfMaxAngleStepSizeDegrees,
2900 const char* const * papszOptions = nullptr );
2901 static OGRCurve* curveFromLineString(
2902 const OGRLineString* poLS,
2903 const char* const * papszOptions = nullptr);
2904 };
2905
2906 OGRwkbGeometryType CPL_DLL OGRFromOGCGeomType( const char *pszGeomType );
2907 const char CPL_DLL * OGRToOGCGeomType( OGRwkbGeometryType eGeomType );
2908
2910 typedef struct _OGRPreparedGeometry OGRPreparedGeometry;
2911 int OGRHasPreparedGeometrySupport();
2912 OGRPreparedGeometry* OGRCreatePreparedGeometry( const OGRGeometry* poGeom );
2913 void OGRDestroyPreparedGeometry( OGRPreparedGeometry* poPreparedGeom );
2914 int OGRPreparedGeometryIntersects( const OGRPreparedGeometry* poPreparedGeom,
2915 const OGRGeometry* poOtherGeom );
2916 int OGRPreparedGeometryContains( const OGRPreparedGeometry* poPreparedGeom,
2917 const OGRGeometry* poOtherGeom );
2918
2920 struct CPL_DLL OGRPreparedGeometryUniquePtrDeleter
2921 {
2922 void operator()(OGRPreparedGeometry*) const;
2923 };
2925
2929 typedef std::unique_ptr<OGRPreparedGeometry, OGRPreparedGeometryUniquePtrDeleter> OGRPreparedGeometryUniquePtr;
2930
2931 #endif /* ndef OGR_GEOMETRY_H_INCLUDED */
OGRCurve::toSimpleCurve
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:1006
OGRCompoundCurve::begin
const ChildType *const * begin() const
Return begin of curve iterator.
Definition: ogr_geometry.h:1630
OGRGeometry::toMultiPoint
OGRMultiPoint * toMultiPoint()
Down-cast to OGRMultiPoint*.
Definition: ogr_geometry.h:691
OGRCurve::Value
virtual void Value(double, OGRPoint *) const =0
Fetch point at given distance along curve.
OGRSimpleCurve::ChildType
OGRPoint ChildType
Type of child elements.
Definition: ogr_geometry.h:1102
OGRPolyhedralSurface::~OGRPolyhedralSurface
~OGRPolyhedralSurface() override
Destructor.
OGRGeometry::closeRings
virtual void closeRings()
Force rings to be closed.
Definition: ogrgeometry.cpp:4925
OGRGeometry::getGeometryType
virtual OGRwkbGeometryType getGeometryType() const =0
Fetch geometry type.
OGRGeometry::toPolygon
const OGRPolygon * toPolygon() const
Down-cast to OGRPolygon*.
Definition: ogr_geometry.h:642
OGRGeometry::toTriangle
const OGRTriangle * toTriangle() const
Down-cast to OGRTriangle*.
Definition: ogr_geometry.h:656
OGRMultiPoint::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2612
OGRCurve::IntersectsPoint
virtual int IntersectsPoint(const OGRPoint *p) const
Returns if a point intersects a (closed) curve.
Definition: ogrcurve.cpp:416
OGRGeometryCollection::end
const ChildType *const * end() const
Return end of sub-geometry iterator.
Definition: ogr_geometry.h:2138
OGRGeometry::setCoordinateDimension
virtual void setCoordinateDimension(int nDimension)
Set the coordinate dimension.
Definition: ogrgeometry.cpp:1002
OGRSimpleCurve::exportToWkt
virtual OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const override
Convert a geometry into well known text format.
Definition: ogrlinestring.cpp:1838
OGRGeometry::Is3D
OGRBoolean Is3D() const
Definition: ogr_geometry.h:362
OGRCurvePolygon::getEnvelope
virtual void getEnvelope(OGREnvelope *psEnvelope) const override
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure...
Definition: ogrcurvepolygon.cpp:619
OGRMultiCurve::toUpperClass
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2719
OGRGeometry::toMultiLineString
OGRMultiLineString * toMultiLineString()
Down-cast to OGRMultiLineString*.
Definition: ogr_geometry.h:705
OGRGeometry::set3D
virtual void set3D(OGRBoolean bIs3D)
Add or remove the Z coordinate dimension.
Definition: ogrgeometry.cpp:1025
OGRGeometry::toLineString
const OGRLineString * toLineString() const
Down-cast to OGRLineString*.
Definition: ogr_geometry.h:572
OGRCircularString::toUpperClass
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:1460
OGRGeometry::setMeasured
virtual void setMeasured(OGRBoolean bIsMeasured)
Add or remove the M coordinate dimension.
Definition: ogrgeometry.cpp:1048
OGRPolyhedralSurface::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2488
OGRPolygon::getGeometryType
virtual OGRwkbGeometryType getGeometryType() const override
Fetch geometry type.
Definition: ogrpolygon.cpp:104
OGRRawPoint::y
double y
y
Definition: ogr_geometry.h:75
OGRCurvePolygon::ChildType
OGRCurve ChildType
Type of child elements.
Definition: ogr_geometry.h:1799
OGRCurve::CurveToLine
virtual OGRLineString * CurveToLine(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const =0
Return a linestring from a curve geometry.
OGRPolygon::exportToWkt
virtual OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const override
Convert a geometry into well known text format.
Definition: ogrpolygon.cpp:621
OGRLineString
Concrete representation of a multi-vertex line.
Definition: ogr_geometry.h:1241
OGRMultiPoint::ChildType
OGRPoint ChildType
Type of child elements.
Definition: ogr_geometry.h:2607
OGRGeometry::toCompoundCurve
OGRCompoundCurve * toCompoundCurve()
Down-cast to OGRCompoundCurve*.
Definition: ogr_geometry.h:607
OGRGeometry::toMultiPolygon
const OGRMultiPolygon * toMultiPolygon() const
Down-cast to OGRMultiPolygon*.
Definition: ogr_geometry.h:726
OGRGeometry::hasCurveGeometry
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const
Returns if this geometry is or has curve geometry.
Definition: ogrgeometry.cpp:3089
OGRGeometry::ToHandle
static OGRGeometryH ToHandle(OGRGeometry *poGeom)
Convert a OGRGeometry* to a OGRGeometryH.
Definition: ogr_geometry.h:510
OGRLineString::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1285
OGRPoint::getY
double getY() const
Return y.
Definition: ogr_geometry.h:854
OGRCurvePolygon::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1882
OGRGeometry::swapXY
virtual void swapXY()
Swap x and y coordinates.
Definition: ogrgeometry.cpp:5615
OGRSimpleCurve::transform
virtual OGRErr transform(OGRCoordinateTransformation *poCT) override
Apply arbitrary coordinate transformation to geometry.
Definition: ogrlinestring.cpp:2382
OGRLineString::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1286
OGRGeometry::toCurve
OGRCurve * toCurve()
Down-cast to OGRCurve*.
Definition: ogr_geometry.h:537
OGRGeometryFactory
Create geometry objects from well known text/binary.
Definition: ogr_geometry.h:2817
OGRPolyhedralSurface::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2437
OGRGeometry::toMultiPolygon
OGRMultiPolygon * toMultiPolygon()
Down-cast to OGRMultiPolygon*.
Definition: ogr_geometry.h:719
OGRMultiLineString::toUpperClass
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2789
OGRMultiCurve::getGeometryType
virtual OGRwkbGeometryType getGeometryType() const override
Fetch geometry type.
Definition: ogrmulticurve.cpp:98
OGRLinearRing::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1364
OGRRawPoint::x
double x
x
Definition: ogr_geometry.h:73
OGRSimpleCurve::exportToWkb
virtual OGRErr exportToWkb(OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc) const override
Convert a geometry into well known binary format.
Definition: ogrlinestring.cpp:1621
OGRMultiLineString::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2766
OGRGeometry::getGeometryName
virtual const char * getGeometryName() const =0
Fetch WKT name for geometry type.
OGRCurvePolygon::transform
virtual OGRErr transform(OGRCoordinateTransformation *poCT) override
Apply arbitrary coordinate transformation to geometry.
Definition: ogrcurvepolygon.cpp:658
OGRGeometry::toSurface
const OGRSurface * toSurface() const
Down-cast to OGRSurface*.
Definition: ogr_geometry.h:628
OGRMultiLineString::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2768
OGRCurvePolygon::set3D
virtual void set3D(OGRBoolean bIs3D) override
Add or remove the Z coordinate dimension.
Definition: ogrcurvepolygon.cpp:694
OGRCircularString::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1462
OGRGeometry::getCurveGeometry
virtual OGRGeometry * getCurveGeometry(const char *const *papszOptions=nullptr) const CPL_WARN_UNUSED_RESULT
Return curve version of this geometry.
Definition: ogrgeometry.cpp:3157
OGRPolyhedralSurface::OGRPolyhedralSurface
OGRPolyhedralSurface()
Create an empty PolyhedralSurface.
OGRPolyhedralSurface::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2487
OGRGeometry::toMultiSurface
OGRMultiSurface * toMultiSurface()
Down-cast to OGRMultiSurface*.
Definition: ogr_geometry.h:747
OGRGeometry::exportToWkb
virtual OGRErr exportToWkb(OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc) const =0
Convert a geometry into well known binary format.
OGRMultiCurve::operator=
OGRMultiCurve & operator=(const OGRMultiCurve &other)
Assignment operator.
Definition: ogrmulticurve.cpp:85
OGRGeometry::FromHandle
static OGRGeometry * FromHandle(OGRGeometryH hGeom)
Convert a OGRGeometryH to a OGRGeometry*.
Definition: ogr_geometry.h:516
OGRCurvePolygon::setCoordinateDimension
virtual void setCoordinateDimension(int nDimension) override
Set the coordinate dimension.
Definition: ogrcurvepolygon.cpp:688
OGRCurvePolygon::end
ChildType ** end()
Return end of curve iterator.
Definition: ogr_geometry.h:1806
OGRMultiSurface::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2285
OGRGeometry::clone
virtual OGRGeometry * clone() const CPL_WARN_UNUSED_RESULT=0
Make a copy of this object.
OGRCurvePolygon::stealExteriorRingCurve
OGRCurve * stealExteriorRingCurve()
"Steal" reference to external ring.
Definition: ogrcurvepolygon.cpp:307
OGRGeometry::getLinearGeometry
virtual OGRGeometry * getLinearGeometry(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const CPL_WARN_UNUSED_RESULT
Return, possibly approximate, non-curve version of this geometry.
Definition: ogrgeometry.cpp:3122
OGRGeometry::Within
virtual OGRBoolean Within(const OGRGeometry *) const
Test for containment.
Definition: ogrgeometry.cpp:4715
OGRMultiPolygon::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2368
OGRGeometry::operator!=
bool operator!=(const OGRGeometry &other) const
Returns if two geometries are different.
Definition: ogr_geometry.h:352
OGRBoolean
int OGRBoolean
Type for a OGR boolean.
Definition: ogr_core.h:306
OGRPolygon::begin
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:1956
OGRCurvePolygon::getExteriorRingCurve
OGRCurve * getExteriorRingCurve()
Fetch reference to external polygon ring.
Definition: ogrcurvepolygon.cpp:201
OGRCurvePolygon::hasCurveGeometry
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const override
Returns if this geometry is or has curve geometry.
Definition: ogrcurvepolygon.cpp:594
OGRCurvePolygon::end
const ChildType *const * end() const
Return end of curve iterator.
Definition: ogr_geometry.h:1812
OGRPolygon::hasCurveGeometry
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const override
Returns if this geometry is or has curve geometry.
Definition: ogrpolygon.cpp:829
OGRCurvePolygon::removeRing
OGRErr removeRing(int iIndex, bool bDelete=true)
Remove a geometry from the container.
Definition: ogrcurvepolygon.cpp:339
OGRCurvePolygon::CastToPolygon
static OGRPolygon * CastToPolygon(OGRCurvePolygon *poCP)
Convert to polygon.
Definition: ogrcurvepolygon.cpp:830
GByte
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:215
ogr_spatialref.h
Coordinate systems services.
OGRGeometry::toTriangulatedSurface
OGRTriangulatedSurface * toTriangulatedSurface()
Down-cast to OGRTriangulatedSurface*.
Definition: ogr_geometry.h:775
OGRPoint::getM
double getM() const
Return m.
Definition: ogr_geometry.h:858
OGRCircularString::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1463
OGRTriangle::toUpperClass
const OGRPolygon * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2074
OGRGeometryCollection::begin
const ChildType *const * begin() const
Return begin of sub-geometry iterator.
Definition: ogr_geometry.h:2136
OGRCurvePolygon::importFromWkb
virtual OGRErr importFromWkb(const unsigned char *, int, OGRwkbVariant, int &nBytesConsumedOut) override
Assign geometry from well known binary data.
Definition: ogrcurvepolygon.cpp:464
OGRMultiSurface::begin
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2257
OGRGeometryCollection::hasCurveGeometry
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const override
Returns if this geometry is or has curve geometry.
Definition: ogrgeometrycollection.cpp:1292
OGRRawPoint::OGRRawPoint
OGRRawPoint()
Constructor.
Definition: ogr_geometry.h:67
OGRGeometry::toTriangulatedSurface
const OGRTriangulatedSurface * toTriangulatedSurface() const
Down-cast to OGRTriangulatedSurface*.
Definition: ogr_geometry.h:782
OGRCurve::EndPoint
virtual void EndPoint(OGRPoint *) const =0
Return the curve end point.
OGRMultiSurface::ChildType
OGRSurface ChildType
Type of child elements.
Definition: ogr_geometry.h:2246
OGRPolygon::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:1950
OGRCurvePolygon::assignSpatialReference
virtual void assignSpatialReference(OGRSpatialReference *poSR) override
Assign spatial reference to this object.
Definition: ogrcurvepolygon.cpp:708
OGRMultiPolygon
A collection of non-overlapping OGRPolygon.
Definition: ogr_geometry.h:2311
OGRCurvePolygon::exportToWkt
virtual OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant eWkbVariant=wkbVariantOldOgc) const override
Convert a geometry into well known text format.
Definition: ogrcurvepolygon.cpp:539
OGRGeometry::toPoint
OGRPoint * toPoint()
Down-cast to OGRPoint*.
Definition: ogr_geometry.h:523
OGRCurvePolygon::segmentize
virtual void segmentize(double dfMaxLength) override
Modify the geometry such it has no segment longer then the given distance.
Definition: ogrcurvepolygon.cpp:726
OGRHasPreparedGeometrySupport
int OGRHasPreparedGeometrySupport()
Returns if GEOS has prepared geometry support.
Definition: ogrgeometry.cpp:5663
OGRwkbByteOrder
OGRwkbByteOrder
Enumeration to describe byte order.
Definition: ogr_core.h:489
OGRCurvePolygon::CurvePolyToPoly
virtual OGRPolygon * CurvePolyToPoly(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const
Return a polygon from a curve polygon.
Definition: ogrcurvepolygon.cpp:569
OGRLinearRing::toUpperClass
const OGRLineString * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:1361
OGRMultiLineString::begin
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2772
OGRCircularString
Concrete representation of a circular string, that is to say a curve made of one or several arc circl...
Definition: ogr_geometry.h:1395
OGRMultiCurve::ChildType
OGRCurve ChildType
Type of child elements.
Definition: ogr_geometry.h:2686
OGRGeometry::flattenTo2D
virtual void flattenTo2D()=0
Convert geometry to strictly 2D.
OGRCurve
Abstract curve base class for OGRLineString, OGRCircularString and OGRCompoundCurve.
Definition: ogr_geometry.h:925
OGRGeometryCollection
A collection of 1 or more geometry objects.
Definition: ogr_geometry.h:2095
OGRMultiCurve::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2722
OGRCurvePolygon::getNumInteriorRings
int getNumInteriorRings() const
Fetch the number of internal rings.
Definition: ogrcurvepolygon.cpp:238
OGRLinearRing::toUpperClass
OGRLineString * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:1359
OGRLinearRing
Concrete representation of a closed ring.
Definition: ogr_geometry.h:1313
OGRPoint::setM
void setM(double mIn)
Set m.
Definition: ogr_geometry.h:878
OGRCurvePolygon::begin
ChildType ** begin()
Return begin of curve iterator.
Definition: ogr_geometry.h:1804
OGRGeometry::operator=
OGRGeometry & operator=(const OGRGeometry &other)
Assignment operator.
Definition: ogrgeometry.cpp:137
OGRSimpleCurve::get_Length
virtual double get_Length() const override
Returns the length of the curve.
Definition: ogrlinestring.cpp:1936
OGRPolyhedralSurface::getGeometryName
virtual const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition: ogrpolyhedralsurface.cpp:95
OGRTriangulatedSurface::ChildType
OGRTriangle ChildType
Type of child elements.
Definition: ogr_geometry.h:2536
OGRGeometry::toCircularString
OGRCircularString * toCircularString()
Down-cast to OGRCircularString*.
Definition: ogr_geometry.h:593
OGRGeometryFactory::createFromWkt
static OGRErr createFromWkt(char **ppszInput, OGRSpatialReference *poSRS, OGRGeometry **ppoGeom)
Deprecated.
Definition: ogr_geometry.h:2842
OGRPolygon::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:1958
OGRCurvePolygon::setMeasured
virtual void setMeasured(OGRBoolean bIsMeasured) override
Add or remove the M coordinate dimension.
Definition: ogrcurvepolygon.cpp:699
OGRMultiSurface::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2253
OGRCurvePolygon::importFromWkt
OGRErr importFromWkt(const char **) override
deprecated
Definition: ogrcurvepolygon.cpp:523
OGRSimpleCurve::clone
virtual OGRGeometry * clone() const override
Make a copy of this object.
Definition: ogrlinestring.cpp:140
OGRPolygon::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:1952
OGRTriangulatedSurface::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2563
CPLJSONObject
The CPLJSONArray class holds JSON object from CPLJSONDocument.
Definition: cpl_json.h:53
OGRTriangle::addRingDirectly
virtual OGRErr addRingDirectly(OGRCurve *poNewRing) override
Add a ring to a polygon.
Definition: ogrtriangle.cpp:246
IOGRConstGeometryVisitor::visit
virtual void visit(const OGRPoint *)=0
Visit OGRPoint.
OGRMultiPoint::toUpperClass
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2636
OGRMultiCurve::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2693
OGRPolygon::WkbSize
virtual int WkbSize() const override
Returns size of related binary representation.
Definition: ogrpolygon.cpp:298
OGRPolyhedralSurface::begin
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2435
OGRGeometryCollection::isCompatibleSubType
virtual OGRBoolean isCompatibleSubType(OGRwkbGeometryType) const
Returns whether a geometry of the specified geometry type can be a member of this collection...
Definition: ogrgeometrycollection.cpp:1281
IOGRGeometryVisitor
OGRGeometry visitor interface.
Definition: ogr_geometry.h:117
OGRGeometry::toMultiSurface
const OGRMultiSurface * toMultiSurface() const
Down-cast to OGRMultiSurface*.
Definition: ogr_geometry.h:754
OGRMultiLineString::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2774
OGRMultiCurve::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2691
OGRGeometry::importFromWkb
OGRErr importFromWkb(const GByte *, int=-1, OGRwkbVariant=wkbVariantOldOgc)
Assign geometry from well known binary data.
Definition: ogrgeometry.cpp:1368
OGRGeometry::toSurface
OGRSurface * toSurface()
Down-cast to OGRSurface*.
Definition: ogr_geometry.h:621
OGRMultiSurface
A collection of non-overlapping OGRSurface.
Definition: ogr_geometry.h:2232
OGRCurve::get_Length
virtual double get_Length() const =0
Returns the length of the curve.
OGRLineString::getGeometryName
virtual const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition: ogrlinestring.cpp:2741
OGRGeometry::toSimpleCurve
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:551
OGRTriangulatedSurface::addGeometry
virtual OGRErr addGeometry(const OGRGeometry *) override
Add a new geometry to a collection.
Definition: ogrtriangulatedsurface.cpp:180
OGRCompoundCurve::end
ChildType ** end()
Return end of curve iterator.
Definition: ogr_geometry.h:1626
OGRCurvePolygon::getLinearGeometry
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:609
OGRMultiCurve::begin
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2697
OGRPolyhedralSurface::getGeometryType
virtual OGRwkbGeometryType getGeometryType() const override
Returns the WKB Type of PolyhedralSurface.
Definition: ogrpolyhedralsurface.cpp:109
OGRTriangulatedSurface::toUpperClass
const OGRPolyhedralSurface * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2561
OGRCurve::StartPoint
virtual void StartPoint(OGRPoint *) const =0
Return the curve start point.
OGRFromOGCGeomType
OGRwkbGeometryType OGRFromOGCGeomType(const char *pszGeomType)
Map OGCgeometry format type to corresponding OGR constants.
Definition: ogrgeometry.cpp:2288
OGRSimpleCurve::operator=
OGRSimpleCurve & operator=(const OGRSimpleCurve &other)
Assignment operator.
Definition: ogrlinestring.cpp:113
OGRDefaultGeometryVisitor::visit
void visit(OGRPoint *) override
Visit OGRPoint.
Definition: ogr_geometry.h:170
OGRMultiLineString::ChildType
OGRLineString ChildType
Type of child elements.
Definition: ogr_geometry.h:2761
OGRCurvePolygon::exportToWkb
virtual OGRErr exportToWkb(OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc) const override
Convert a geometry into well known binary format.
Definition: ogrcurvepolygon.cpp:495
OGRGeometry::importFromWkt
virtual OGRErr importFromWkt(const char **ppszInput)=0
Assign geometry from well known text data.
OGRSimpleCurve::importFromWkt
OGRErr importFromWkt(const char **) override
deprecated
Definition: ogrlinestring.cpp:1719
OGRTriangulatedSurface::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2549
OGRCurve::get_Area
virtual double get_Area() const =0
Get the area of the (closed) curve.
OGRPolyhedralSurface::addGeometryDirectly
OGRErr addGeometryDirectly(OGRGeometry *poNewGeom)
Add a geometry directly to the container.
Definition: ogrpolyhedralsurface.cpp:874
OGRCompoundCurve
Utility class to store a collection of curves.
Definition: ogr_geometry.h:1580
OGRRawPoint
Simple container for a position.
Definition: ogr_geometry.h:63
OGRTriangulatedSurface::toUpperClass
OGRPolyhedralSurface * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2559
OGRwkbGeometryType
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:317
OGRMultiSurface::hasCurveGeometry
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const override
Returns if this geometry is or has curve geometry.
Definition: ogrmultisurface.cpp:277
OGRTriangulatedSurface::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2564
OGRPolygon::toUpperClass
OGRCurvePolygon * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2003
OGRCurvePolygon::getGeometryName
virtual const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition: ogrcurvepolygon.cpp:175
OGRMultiCurve::hasCurveGeometry
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const override
Returns if this geometry is or has curve geometry.
Definition: ogrmulticurve.cpp:186
OGRMultiSurface::operator=
OGRMultiSurface & operator=(const OGRMultiSurface &other)
Assignment operator.
Definition: ogrmultisurface.cpp:86
OGRGeometry::assignSpatialReference
virtual void assignSpatialReference(OGRSpatialReference *poSR)
Assign spatial reference to this object.
Definition: ogrgeometry.cpp:416
OGRCurve::ContainsPoint
virtual int ContainsPoint(const OGRPoint *p) const
Returns if a point is contained in a (closed) curve.
Definition: ogrcurve.cpp:396
OGRGeometryCollection::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2203
OGRCompoundCurve::begin
ChildType ** begin()
Return begin of curve iterator.
Definition: ogr_geometry.h:1624
OGRGeometry::operator==
bool operator==(const OGRGeometry &other) const
Returns if two geometries are equal.
Definition: ogr_geometry.h:349
OGRMultiSurface::getGeometryType
virtual OGRwkbGeometryType getGeometryType() const override
Fetch geometry type.
Definition: ogrmultisurface.cpp:99
OGRMultiSurface::exportToWkt
virtual OGRErr exportToWkt(char **, OGRwkbVariant=wkbVariantOldOgc) const override
Convert a geometry into well known text format.
Definition: ogrmultisurface.cpp:266
OGRMultiCurve::exportToWkt
virtual OGRErr exportToWkt(char **, OGRwkbVariant=wkbVariantOldOgc) const override
Convert a geometry into well known text format.
Definition: ogrmulticurve.cpp:175
OGRPointIterator
Interface for a point iterator.
Definition: ogr_geometry.h:907
OGRTriangulatedSurface
TriangulatedSurface class.
Definition: ogr_geometry.h:2515
OGRMultiPoint::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2638
OGRMultiCurve
A collection of OGRCurve.
Definition: ogr_geometry.h:2668
OGRCompoundCurve::get_AreaOfCurveSegments
virtual double get_AreaOfCurveSegments() const override
Return area of curve segments.
Definition: ogrcompoundcurve.cpp:903
OGRGeometryCollection::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2204
OGRSurface
Abstract base class for 2 dimensional objects like polygons or curve polygons.
Definition: ogr_geometry.h:1727
IOGRConstGeometryVisitor
OGRGeometry visitor interface.
Definition: ogr_geometry.h:191
OGRMultiLineString
A collection of OGRLineString.
Definition: ogr_geometry.h:2747
OGRGeometryCollection::getDimension
virtual int getDimension() const override
Get the dimension of this object.
Definition: ogrgeometrycollection.cpp:193
OGRGeometry::toCurvePolygon
OGRCurvePolygon * toCurvePolygon()
Down-cast to OGRCurvePolygon*.
Definition: ogr_geometry.h:663
OGRGeometry
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:286
OGRMultiSurface::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2286
OGRGeometry::empty
virtual void empty()=0
Clear geometry information.
OGRGeometry::segmentize
virtual void segmentize(double dfMaxLength)
Modify the geometry such it has no segment longer then the given distance.
Definition: ogrgeometry.cpp:784
OGRMultiLineString::toUpperClass
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2787
OGRPoint::getZ
double getZ() const
Return z.
Definition: ogr_geometry.h:856
OGRGeometry::toMultiCurve
OGRMultiCurve * toMultiCurve()
Down-cast to OGRMultiCurve*.
Definition: ogr_geometry.h:733
OGRGeometry::toPolyhedralSurface
OGRPolyhedralSurface * toPolyhedralSurface()
Down-cast to OGRPolyhedralSurface*.
Definition: ogr_geometry.h:761
OGRMultiPoint::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2639
OGRPoint::setX
void setX(double xIn)
Set x.
Definition: ogr_geometry.h:865
OGRGeometry::IsMeasured
OGRBoolean IsMeasured() const
Definition: ogr_geometry.h:364
sfcgal_geometry_t
void sfcgal_geometry_t
SFCGAL geometry type.
Definition: ogr_geometry.h:83
OGRTriangulatedSurface::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2541
OGRPolygon::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2007
OGRGeometry::IsValid
virtual OGRBoolean IsValid() const
Test if the geometry is valid.
Definition: ogrgeometry.cpp:2047
OGRCurve::CastToLinearRing
static OGRLinearRing * CastToLinearRing(OGRCurve *poCurve)
Cast to linear ring.
Definition: ogrcurve.cpp:375
OGRCurvePolygon::begin
const ChildType *const * begin() const
Return begin of curve iterator.
Definition: ogr_geometry.h:1810
OGRSurface::get_Area
virtual double get_Area() const =0
Get the area of the surface object.
OGRTriangle::operator=
OGRTriangle & operator=(const OGRTriangle &other)
Assignment operator.
Definition: ogrtriangle.cpp:138
OGRGeometry::Intersects
virtual OGRBoolean Intersects(const OGRGeometry *) const
Do these features intersect?
Definition: ogrgeometry.cpp:486
OGRGeometry::toLinearRing
const OGRLinearRing * toLinearRing() const
Down-cast to OGRLinearRing*.
Definition: ogr_geometry.h:586
OGRPolyhedralSurface::operator=
OGRPolyhedralSurface & operator=(const OGRPolyhedralSurface &other)
Assignment operator.
Definition: ogrpolyhedralsurface.cpp:80
OGRDestroyPreparedGeometry
void OGRDestroyPreparedGeometry(OGRPreparedGeometry *poPreparedGeom)
Destroys a prepared geometry.
Definition: ogrgeometry.cpp:5719
GEOSGeom
struct GEOSGeom_t * GEOSGeom
GEOS geometry type.
Definition: ogr_geometry.h:79
OGRDefaultGeometryVisitor
OGRGeometry visitor default implementation.
Definition: ogr_geometry.h:164
OGRSimpleCurve::getNumPoints
virtual int getNumPoints() const override
Fetch vertex count.
Definition: ogr_geometry.h:1158
OGRCurvePolygon::flattenTo2D
virtual void flattenTo2D() override
Convert geometry to strictly 2D.
Definition: ogrcurvepolygon.cpp:165
OGRLineString::operator=
OGRLineString & operator=(const OGRLineString &other)
Assignment operator.
Definition: ogrlinestring.cpp:2711
OGRMultiPolygon::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2343
OGRCurvePolygon::empty
virtual void empty() override
Clear geometry information.
Definition: ogrcurvepolygon.cpp:128
OGRGeometry::toTriangle
OGRTriangle * toTriangle()
Down-cast to OGRTriangle*.
Definition: ogr_geometry.h:649
OGRPoint::setZ
void setZ(double zIn)
Set z.
Definition: ogr_geometry.h:873
OGRPolyhedralSurface::removeGeometry
OGRErr removeGeometry(int iIndex, int bDelete=TRUE)
Remove a geometry from the container.
Definition: ogrpolyhedralsurface.cpp:1065
OGRCurve::ChildType
OGRPoint ChildType
Type of child elements.
Definition: ogr_geometry.h:968
OGRSurface::PointOnSurface
virtual OGRErr PointOnSurface(OGRPoint *poPoint) const
This method relates to the SFCOM ISurface::get_PointOnSurface() method.
Definition: ogr_geometry.h:1737
ogr_core.h
Core portability services for cross-platform OGR code.
OGRGeometryCollection::end
ChildType ** end()
Return end of sub-geometry iterator.
Definition: ogr_geometry.h:2132
OGRGeometry::getDimension
virtual int getDimension() const =0
Get the dimension of this object.
OGRLinearRing::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1363
OGRGeometry::toLineString
OGRLineString * toLineString()
Down-cast to OGRLineString*.
Definition: ogr_geometry.h:565
OGRPreparedGeometryIntersects
int OGRPreparedGeometryIntersects(const OGRPreparedGeometry *poPreparedGeom, const OGRGeometry *poOtherGeom)
Returns whether a prepared geometry intersects with a geometry.
Definition: ogrgeometry.cpp:5741
OGRCurvePolygon
Concrete class representing curve polygons.
Definition: ogr_geometry.h:1762
OGRGeometry::toLinearRing
OGRLinearRing * toLinearRing()
Down-cast to OGRLinearRing*.
Definition: ogr_geometry.h:579
OGRMultiPoint::begin
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2618
OGRMultiCurve::isCompatibleSubType
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:135
OGRSimpleCurve::getEnvelope
virtual void getEnvelope(OGREnvelope *psEnvelope) const override
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure...
Definition: ogrlinestring.cpp:2279
OGRTriangle::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2077
OGRPolyhedralSurface
PolyhedralSurface class.
Definition: ogr_geometry.h:2396
OGRCurvePolygon::WkbSize
virtual int WkbSize() const override
Returns size of related binary representation.
Definition: ogrcurvepolygon.cpp:440
OGRMultiCurve::toUpperClass
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2717
cpl_conv.h
Various convenience functions for CPL.
OGRPoint::setY
void setY(double yIn)
Set y.
Definition: ogr_geometry.h:869
IOGRGeometryVisitor::visit
virtual void visit(OGRPoint *)=0
Visit OGRPoint.
OGRSpatialReference
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:147
OGRCurve::get_AreaOfCurveSegments
virtual double get_AreaOfCurveSegments() const =0
Get the area of the purely curve portions of a (closed) curve.
OGRMultiPoint::toUpperClass
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2634
OGRGeometry::toCurve
const OGRCurve * toCurve() const
Down-cast to OGRCurve*.
Definition: ogr_geometry.h:544
OGRPolygon::getGeometryName
virtual const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition: ogrpolygon.cpp:121
OGRCompoundCurve::ChildType
OGRCurve ChildType
Type of child elements.
Definition: ogr_geometry.h:1619
OGRPreparedGeometry
struct _OGRPreparedGeometry OGRPreparedGeometry
Prepared geometry API (needs GEOS >= 3.1.0)
Definition: ogr_geometry.h:2910
wkbVariantOldOgc
Old-style 99-402 extended dimension (Z) WKB types.
Definition: ogr_core.h:425
OGRLineString::toUpperClass
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:1283
OGRMultiSurface::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2251
OGRCurvePolygon::OGRCurvePolygon
OGRCurvePolygon()
Create an empty curve polygon.
OGRPolygon::importFromWkb
virtual OGRErr importFromWkb(const unsigned char *, int, OGRwkbVariant, int &nBytesConsumedOut) override
Assign geometry from well known binary data.
Definition: ogrpolygon.cpp:318
OGRMultiSurface::toUpperClass
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2283
OGRMultiSurface::toUpperClass
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2281
OGRGeometryUniquePtr
std::unique_ptr< OGRGeometry, OGRGeometryUniquePtrDeleter > OGRGeometryUniquePtr
Unique pointer type for OGRGeometry.
Definition: ogr_geometry.h:797
cpl_json.h
Interface for read and write JSON documents.
OGRCurvePolygon::swapXY
virtual void swapXY() override
Swap x and y coordinates.
Definition: ogrcurvepolygon.cpp:740
OGRCreatePreparedGeometry
OGRPreparedGeometry * OGRCreatePreparedGeometry(const OGRGeometry *poGeom)
Creates a prepared geometry.
Definition: ogrgeometry.cpp:5683
OGRMultiPolygon::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2351
OGRPolygon::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2008
OGRPoint::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:892
OGRPolygon::exportToWkb
virtual OGRErr exportToWkb(OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc) const override
Convert a geometry into well known binary format.
Definition: ogrpolygon.cpp:372
OGRGeometry::toPoint
const OGRPoint * toPoint() const
Down-cast to OGRPoint*.
Definition: ogr_geometry.h:530
OGRPolyhedralSurface::addGeometry
virtual OGRErr addGeometry(const OGRGeometry *)
Add a new geometry to a collection.
Definition: ogrpolyhedralsurface.cpp:838
OGRCurvePolygon::addRingDirectly
virtual OGRErr addRingDirectly(OGRCurve *)
Add a ring to a polygon.
Definition: ogrcurvepolygon.cpp:419
OGRPoint
Point class.
Definition: ogr_geometry.h:809
OGRGeometryH
void * OGRGeometryH
Opaque type for a geometry.
Definition: ogr_api.h:60
OGRMultiSurface::getGeometryName
virtual const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition: ogrmultisurface.cpp:126
OGRMultiLineString::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2791
OGRTriangulatedSurface::begin
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2547
OGRwkbVariant
OGRwkbVariant
Output variants of WKB we support.
Definition: ogr_core.h:423
OGRPoint::IsEmpty
virtual OGRBoolean IsEmpty() const override
Returns TRUE (non-zero) if the object has no points.
Definition: ogr_geometry.h:847
OGRPolygon::ChildType
OGRLinearRing ChildType
Type of child elements.
Definition: ogr_geometry.h:1945
OGRGeometry::WkbSize
virtual int WkbSize() const =0
Returns size of related binary representation.
OGRGeometry::getEnvelope
virtual void getEnvelope(OGREnvelope *psEnvelope) const =0
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure...
OGRGeometryCollection::operator=
OGRGeometryCollection & operator=(const OGRGeometryCollection &other)
Assignment operator.
Definition: ogrgeometrycollection.cpp:110
OGRGeometry::Equals
virtual OGRBoolean Equals(const OGRGeometry *) const =0
Returns TRUE if two geometries are equivalent.
OGRGeometry::toMultiCurve
const OGRMultiCurve * toMultiCurve() const
Down-cast to OGRMultiCurve*.
Definition: ogr_geometry.h:740
OGRSimpleCurve::segmentize
virtual void segmentize(double dfMaxLength) override
Modify the geometry such it has no segment longer then the given distance.
Definition: ogrlinestring.cpp:2503
OGRMultiPolygon::toUpperClass
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2364
OGRMultiPolygon::toUpperClass
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2366
OGRCurve::toSimpleCurve
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:1001
OGRPoint::getX
double getX() const
Return x.
Definition: ogr_geometry.h:852
OGRGeometry::toPolygon
OGRPolygon * toPolygon()
Down-cast to OGRPolygon*.
Definition: ogr_geometry.h:635
OGRPolygon
Concrete class representing polygons.
Definition: ogr_geometry.h:1912
OGRSimpleCurve
Abstract curve base class for OGRLineString and OGRCircularString.
Definition: ogr_geometry.h:1034
OGRGeometry::exportToWkt
virtual OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const =0
Convert a geometry into well known text format.
GEOSContextHandle_t
struct GEOSContextHandle_HS * GEOSContextHandle_t
GEOS context handle type.
Definition: ogr_geometry.h:81
OGRCurve::getNumPoints
virtual int getNumPoints() const =0
Return the number of points of a curve geometry.
OGRGeometry::toGeometryCollection
OGRGeometryCollection * toGeometryCollection()
Down-cast to OGRGeometryCollection*.
Definition: ogr_geometry.h:677
OGRGeometryCollection::ChildType
OGRGeometry ChildType
Type of child elements.
Definition: ogr_geometry.h:2125
OGRGeometry::toCurvePolygon
const OGRCurvePolygon * toCurvePolygon() const
Down-cast to OGRCurvePolygon*.
Definition: ogr_geometry.h:670
OGRMultiSurface::isCompatibleSubType
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:137
OGRDefaultConstGeometryVisitor
OGRGeometry visitor default implementation.
Definition: ogr_geometry.h:238
OGRGeometry::Contains
virtual OGRBoolean Contains(const OGRGeometry *) const
Test for containment.
Definition: ogrgeometry.cpp:4789
OGRGeometryCollection::getGeometryType
virtual OGRwkbGeometryType getGeometryType() const override
Fetch geometry type.
Definition: ogrgeometrycollection.cpp:176
OGRGeometry::toMultiLineString
const OGRMultiLineString * toMultiLineString() const
Down-cast to OGRMultiLineString*.
Definition: ogr_geometry.h:712
OGRRawPoint::OGRRawPoint
OGRRawPoint(double xIn, double yIn)
Constructor.
Definition: ogr_geometry.h:70
OGRDefaultConstGeometryVisitor::visit
void visit(const OGRPoint *) override
Visit OGRPoint.
Definition: ogr_geometry.h:244
OGRSimpleCurve::getX
double getX(int i) const
Get X at vertex.
Definition: ogr_geometry.h:1160
OGRCoordinateTransformation
Interface for transforming between coordinate systems.
Definition: ogr_spatialref.h:675
OGRLineString::toUpperClass
OGRSimpleCurve * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:1281
OGRSimpleCurve::WkbSize
virtual int WkbSize() const override
Returns size of related binary representation.
Definition: ogrlinestring.cpp:207
OGRCurvePolygon::getGeometryType
virtual OGRwkbGeometryType getGeometryType() const override
Fetch geometry type.
Definition: ogrcurvepolygon.cpp:138
OGRMultiPolygon::ChildType
OGRPolygon ChildType
Type of child elements.
Definition: ogr_geometry.h:2338
OGRPolyhedralSurface::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2431
OGRPolyhedralSurface::CastToMultiPolygon
static OGRMultiPolygon * CastToMultiPolygon(OGRPolyhedralSurface *poPS)
Casts the OGRPolyhedralSurface to an OGRMultiPolygon.
Definition: ogrpolyhedralsurface.cpp:817
OGRMultiPolygon::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2345
OGRCircularString::toUpperClass
OGRSimpleCurve * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:1458
OGRPreparedGeometryUniquePtr
std::unique_ptr< OGRPreparedGeometry, OGRPreparedGeometryUniquePtrDeleter > OGRPreparedGeometryUniquePtr
Unique pointer type for OGRPreparedGeometry.
Definition: ogr_geometry.h:2929
OGRGeometryCollection::importFromWkt
OGRErr importFromWkt(const char **) override
deprecated
Definition: ogrgeometrycollection.cpp:792
OGRPolyhedralSurface::getNumGeometries
int getNumGeometries() const
Fetch number of geometries in PolyhedralSurface.
Definition: ogrpolyhedralsurface.cpp:906
OGRTriangle::toUpperClass
OGRPolygon * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2072
begin
OGRLayer::FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition: ogrsf_frmts.h:287
OGRCurvePolygon::IsEmpty
virtual OGRBoolean IsEmpty() const override
Returns TRUE (non-zero) if the object has no points.
Definition: ogrcurvepolygon.cpp:717
OGRPreparedGeometryContains
int OGRPreparedGeometryContains(const OGRPreparedGeometry *poPreparedGeom, const OGRGeometry *poOtherGeom)
Returns whether a prepared geometry contains a geometry.
Definition: ogrgeometry.cpp:5771
OGRPoint::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:891
OGRCurvePolygon::addRing
virtual OGRErr addRing(OGRCurve *)
Add a ring to a polygon.
Definition: ogrcurvepolygon.cpp:362
OGRCurve::getPointIterator
virtual OGRPointIterator * getPointIterator() const =0
Returns a point iterator over the curve.
OGRGeometry::toMultiPoint
const OGRMultiPoint * toMultiPoint() const
Down-cast to OGRMultiPoint*.
Definition: ogr_geometry.h:698
OGRCurvePolygon::operator=
OGRCurvePolygon & operator=(const OGRCurvePolygon &other)
Assignment operator.
Definition: ogrcurvepolygon.cpp:88
OGRCompoundCurve::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1700
OGRTriangle
Triangle class.
Definition: ogr_geometry.h:2035
OGRMultiCurve::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2699
OGRPolyhedralSurface::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2429
OGRPolygon::operator=
OGRPolygon & operator=(const OGRPolygon &other)
Assignment operator.
Definition: ogrpolygon.cpp:91
OGRCurve::CastToLineString
static OGRLineString * CastToLineString(OGRCurve *poCurve)
Cast to linestring.
Definition: ogrcurve.cpp:353
OGRGeometry::transform
virtual OGRErr transform(OGRCoordinateTransformation *poCT)=0
Apply arbitrary coordinate transformation to geometry.
OGRPolyhedralSurface::ChildType
OGRPolygon ChildType
Type of child elements.
Definition: ogr_geometry.h:2424
OGRMultiCurve::getGeometryName
virtual const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition: ogrmulticurve.cpp:125
OGRErr
int OGRErr
Simple container for a bounding region.
Definition: ogr_core.h:290
OGRPolygon::toUpperClass
const OGRCurvePolygon * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2005
OGRSimpleCurve::Value
virtual void Value(double, OGRPoint *) const override
Fetch point at given distance along curve.
Definition: ogrlinestring.cpp:1978
OGRMultiPoint::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2614
OGRGeometry::toSimpleCurve
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:558
OGRMultiLineString::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2792
OGRGeometry::toGeometryCollection
const OGRGeometryCollection * toGeometryCollection() const
Down-cast to OGRGeometryCollection*.
Definition: ogr_geometry.h:684
OGRToOGCGeomType
const char * OGRToOGCGeomType(OGRwkbGeometryType eGeomType)
Map OGR geometry format constants to corresponding OGC geometry type.
Definition: ogrgeometry.cpp:2361
OGRGeometry::toPolyhedralSurface
const OGRPolyhedralSurface * toPolyhedralSurface() const
Down-cast to OGRPolyhedralSurface*.
Definition: ogr_geometry.h:768
end
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition: ogrsf_frmts.h:292
OGRMultiSurface::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2259
OGRMultiPoint
A collection of OGRPoint.
Definition: ogr_geometry.h:2590
OGRGeometry::toCompoundCurve
const OGRCompoundCurve * toCompoundCurve() const
Down-cast to OGRCompoundCurve*.
Definition: ogr_geometry.h:614
OGRCurvePolygon::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1881
OGRGeometryCollection::getGeometryName
virtual const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition: ogrgeometrycollection.cpp:232
OGRCompoundCurve::end
const ChildType *const * end() const
Return end of curve iterator.
Definition: ogr_geometry.h:1632
OGRMultiPolygon::begin
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2349
OGRMultiPolygon::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2369
OGRCurvePolygon::getInteriorRingCurve
OGRCurve * getInteriorRingCurve(int)
Fetch reference to indicated internal ring.
Definition: ogrcurvepolygon.cpp:266
OGRGeometryCollection::begin
ChildType ** begin()
Return begin of sub-geometry iterator.
Definition: ogr_geometry.h:2130
OGRGeometry::IsEmpty
virtual OGRBoolean IsEmpty() const =0
Returns TRUE (non-zero) if the object has no points.
OGRGeometry::toCircularString
const OGRCircularString * toCircularString() const
Down-cast to OGRCircularString*.
Definition: ogr_geometry.h:600
OGRCompoundCurve::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1701
OGRTriangulatedSurface::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2543
OGRSimpleCurve::importFromWkb
virtual OGRErr importFromWkb(const unsigned char *, int, OGRwkbVariant, int &nBytesConsumedOut) override
Assign geometry from well known binary data.
Definition: ogrlinestring.cpp:1505
OGRPolygon::CurvePolyToPoly
virtual OGRPolygon * CurvePolyToPoly(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const override
Return a polygon from a curve polygon.
Definition: ogrpolygon.cpp:818
OGRGeometryCollection::exportToWkt
virtual OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const override
Convert a geometry into well known text format.
Definition: ogrgeometrycollection.cpp:805
OGRMultiCurve::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2721
OGRMultiPoint::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2620
CPL_WARN_UNUSED_RESULT
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition: cpl_port.h:931
OGRPolyhedralSurface::getGeometryRef
OGRGeometry * getGeometryRef(int i)
Fetch geometry from container.
Definition: ogrpolyhedralsurface.cpp:928
OGRTriangle::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2076
OGRSimpleCurve::getY
double getY(int i) const
Get Y at vertex.
Definition: ogr_geometry.h:1161
OGRCurvePolygon::Equals
virtual OGRBoolean Equals(const OGRGeometry *) const override
Returns TRUE if two geometries are equivalent.
Definition: ogrcurvepolygon.cpp:639

Generated for GDAL by 1.8.8.