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 OGRGeometry* MakeValid() const;
361 virtual OGRBoolean IsSimple() const;
363 OGRBoolean Is3D() const { return flags & OGR_G_3D; }
365 OGRBoolean IsMeasured() const { return flags & OGR_G_MEASURED; }
366 virtual OGRBoolean IsRing() const;
367 virtual void empty() = 0;
368 virtual OGRGeometry *clone() const CPL_WARN_UNUSED_RESULT = 0;
369 virtual void getEnvelope( OGREnvelope * psEnvelope ) const = 0;
370 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const = 0;
371
372 // IWks Interface.
373 virtual int WkbSize() const = 0;
374 OGRErr importFromWkb( const GByte*, int=-1,
375 OGRwkbVariant=wkbVariantOldOgc );
376 virtual OGRErr importFromWkb( const unsigned char *,
377 int,
378 OGRwkbVariant,
379 int& nBytesConsumedOut ) = 0;
380 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
381 OGRwkbVariant=wkbVariantOldOgc ) const = 0;
382 virtual OGRErr importFromWkt( const char ** ppszInput ) = 0;
383
387 OGRErr importFromWkt( char ** ppszInput ) CPL_WARN_DEPRECATED("Use importFromWkt(const char**) instead")
388 {
389 return importFromWkt( const_cast<const char**>(ppszInput) );
390 }
391
392 virtual OGRErr exportToWkt( char ** ppszDstText,
393 OGRwkbVariant=wkbVariantOldOgc ) const = 0;
394
395 // Non-standard.
396 virtual OGRwkbGeometryType getGeometryType() const = 0;
397 OGRwkbGeometryType getIsoGeometryType() const;
398 virtual const char *getGeometryName() const = 0;
399 virtual void dumpReadable( FILE *, const char * = nullptr
400 , char** papszOptions = nullptr ) const;
401 virtual void flattenTo2D() = 0;
402 virtual char * exportToGML( const char* const * papszOptions = nullptr ) const;
403 virtual char * exportToKML() const;
404 virtual char * exportToJson() const;
405
407 virtual void accept(IOGRGeometryVisitor* visitor) = 0;
408
410 virtual void accept(IOGRConstGeometryVisitor* visitor) const = 0;
411
412 static GEOSContextHandle_t createGEOSContext();
413 static void freeGEOSContext( GEOSContextHandle_t hGEOSCtxt );
414 virtual GEOSGeom exportToGEOS( GEOSContextHandle_t hGEOSCtxt )
415 const CPL_WARN_UNUSED_RESULT;
416 virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear = FALSE) const;
417 virtual OGRGeometry* getCurveGeometry(
418 const char* const* papszOptions = nullptr ) const CPL_WARN_UNUSED_RESULT;
419 virtual OGRGeometry* getLinearGeometry(
420 double dfMaxAngleStepSizeDegrees = 0,
421 const char* const* papszOptions = nullptr ) const CPL_WARN_UNUSED_RESULT;
422
423 // SFCGAL interfacing methods.
425 static sfcgal_geometry_t* OGRexportToSFCGAL( const OGRGeometry *poGeom );
426 static OGRGeometry* SFCGALexportToOGR( const sfcgal_geometry_t* _geometry );
428 virtual void closeRings();
429
430 virtual void setCoordinateDimension( int nDimension );
431 virtual void set3D( OGRBoolean bIs3D );
432 virtual void setMeasured( OGRBoolean bIsMeasured );
433
434 virtual void assignSpatialReference( OGRSpatialReference * poSR );
435 OGRSpatialReference *getSpatialReference( void ) const { return poSRS; }
436
437 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) = 0;
438 OGRErr transformTo( OGRSpatialReference *poSR );
439
440 virtual void segmentize(double dfMaxLength);
441
442 // ISpatialRelation
443 virtual OGRBoolean Intersects( const OGRGeometry * ) const;
444 virtual OGRBoolean Equals( const OGRGeometry * ) const = 0;
445 virtual OGRBoolean Disjoint( const OGRGeometry * ) const;
446 virtual OGRBoolean Touches( const OGRGeometry * ) const;
447 virtual OGRBoolean Crosses( const OGRGeometry * ) const;
448 virtual OGRBoolean Within( const OGRGeometry * ) const;
449 virtual OGRBoolean Contains( const OGRGeometry * ) const;
450 virtual OGRBoolean Overlaps( const OGRGeometry * ) const;
451 // virtual OGRBoolean Relate( const OGRGeometry *, const char * ) const;
452 // virtual OGRGeometry *LocateAlong( double mValue ) const;
453 // virtual OGRGeometry *LocateBetween( double mStart, double mEnd ) const;
454
455 virtual OGRGeometry *Boundary() const CPL_WARN_UNUSED_RESULT;
456 virtual double Distance( const OGRGeometry * ) const ;
457 virtual OGRGeometry *ConvexHull() const CPL_WARN_UNUSED_RESULT;
458 virtual OGRGeometry *Buffer( double dfDist, int nQuadSegs = 30 )
459 const CPL_WARN_UNUSED_RESULT;
460 virtual OGRGeometry *Intersection( const OGRGeometry *)
461 const CPL_WARN_UNUSED_RESULT;
462 virtual OGRGeometry *Union( const OGRGeometry * )
463 const CPL_WARN_UNUSED_RESULT;
464 virtual OGRGeometry *UnionCascaded() const CPL_WARN_UNUSED_RESULT;
465 virtual OGRGeometry *Difference( const OGRGeometry * )
466 const CPL_WARN_UNUSED_RESULT;
467 virtual OGRGeometry *SymDifference( const OGRGeometry * )
468 const CPL_WARN_UNUSED_RESULT;
469 virtual OGRErr Centroid( OGRPoint * poPoint ) const;
470 virtual OGRGeometry *Simplify(double dTolerance)
471 const CPL_WARN_UNUSED_RESULT;
472 OGRGeometry *SimplifyPreserveTopology(double dTolerance)
473 const CPL_WARN_UNUSED_RESULT;
474 virtual OGRGeometry *DelaunayTriangulation(
475 double dfTolerance, int bOnlyEdges ) const CPL_WARN_UNUSED_RESULT;
476
477 virtual OGRGeometry *Polygonize() const CPL_WARN_UNUSED_RESULT;
478
479 virtual double Distance3D( const OGRGeometry *poOtherGeom ) const;
480
482 // backward compatibility to non-standard method names.
483 OGRBoolean Intersect( OGRGeometry * )
484 const CPL_WARN_DEPRECATED("Non standard method. "
485 "Use Intersects() instead");
486 OGRBoolean Equal( OGRGeometry * )
487 const CPL_WARN_DEPRECATED("Non standard method. "
488 "Use Equals() instead");
489 OGRGeometry *SymmetricDifference( const OGRGeometry * )
490 const CPL_WARN_DEPRECATED("Non standard method. "
491 "Use SymDifference() instead");
492 OGRGeometry *getBoundary()
493 const CPL_WARN_DEPRECATED("Non standard method. "
494 "Use Boundary() instead");
496
498 // Special HACK for DB2 7.2 support
499 static int bGenerate_DB2_V72_BYTE_ORDER;
501
502 virtual void swapXY();
504 static OGRGeometry* CastToIdentity( OGRGeometry* poGeom ) { return poGeom; }
505 static OGRGeometry* CastToError( OGRGeometry* poGeom );
507
511 static inline OGRGeometryH ToHandle(OGRGeometry* poGeom)
512 { return reinterpret_cast<OGRGeometryH>(poGeom); }
513
517 static inline OGRGeometry* FromHandle(OGRGeometryH hGeom)
518 { return reinterpret_cast<OGRGeometry*>(hGeom); }
519
524 inline OGRPoint* toPoint()
525 { return cpl::down_cast<OGRPoint*>(this); }
526
531 inline const OGRPoint* toPoint() const
532 { return cpl::down_cast<const OGRPoint*>(this); }
533
538 inline OGRCurve* toCurve()
539 { return cpl::down_cast<OGRCurve*>(this); }
540
545 inline const OGRCurve* toCurve() const
546 { return cpl::down_cast<const OGRCurve*>(this); }
547
552 inline OGRSimpleCurve* toSimpleCurve()
553 { return cpl::down_cast<OGRSimpleCurve*>(this); }
554
559 inline const OGRSimpleCurve* toSimpleCurve() const
560 { return cpl::down_cast<const OGRSimpleCurve*>(this); }
561
566 inline OGRLineString* toLineString()
567 { return cpl::down_cast<OGRLineString*>(this); }
568
573 inline const OGRLineString* toLineString() const
574 { return cpl::down_cast<const OGRLineString*>(this); }
575
580 inline OGRLinearRing* toLinearRing()
581 { return cpl::down_cast<OGRLinearRing*>(this); }
582
587 inline const OGRLinearRing* toLinearRing() const
588 { return cpl::down_cast<const OGRLinearRing*>(this); }
589
594 inline OGRCircularString* toCircularString()
595 { return cpl::down_cast<OGRCircularString*>(this); }
596
601 inline const OGRCircularString* toCircularString() const
602 { return cpl::down_cast<const OGRCircularString*>(this); }
603
608 inline OGRCompoundCurve* toCompoundCurve()
609 { return cpl::down_cast<OGRCompoundCurve*>(this); }
610
615 inline const OGRCompoundCurve* toCompoundCurve() const
616 { return cpl::down_cast<const OGRCompoundCurve*>(this); }
617
622 inline OGRSurface* toSurface()
623 { return cpl::down_cast<OGRSurface*>(this); }
624
629 inline const OGRSurface* toSurface() const
630 { return cpl::down_cast<const OGRSurface*>(this); }
631
636 inline OGRPolygon* toPolygon()
637 { return cpl::down_cast<OGRPolygon*>(this); }
638
643 inline const OGRPolygon* toPolygon() const
644 { return cpl::down_cast<const OGRPolygon*>(this); }
645
650 inline OGRTriangle* toTriangle()
651 { return cpl::down_cast<OGRTriangle*>(this); }
652
657 inline const OGRTriangle* toTriangle() const
658 { return cpl::down_cast<const OGRTriangle*>(this); }
659
664 inline OGRCurvePolygon* toCurvePolygon()
665 { return cpl::down_cast<OGRCurvePolygon*>(this); }
666
671 inline const OGRCurvePolygon* toCurvePolygon() const
672 { return cpl::down_cast<const OGRCurvePolygon*>(this); }
673
678 inline OGRGeometryCollection* toGeometryCollection()
679 { return cpl::down_cast<OGRGeometryCollection*>(this); }
680
685 inline const OGRGeometryCollection* toGeometryCollection() const
686 { return cpl::down_cast<const OGRGeometryCollection*>(this); }
687
692 inline OGRMultiPoint* toMultiPoint()
693 { return cpl::down_cast<OGRMultiPoint*>(this); }
694
699 inline const OGRMultiPoint* toMultiPoint() const
700 { return cpl::down_cast<const OGRMultiPoint*>(this); }
701
706 inline OGRMultiLineString* toMultiLineString()
707 { return cpl::down_cast<OGRMultiLineString*>(this); }
708
713 inline const OGRMultiLineString* toMultiLineString() const
714 { return cpl::down_cast<const OGRMultiLineString*>(this); }
715
720 inline OGRMultiPolygon* toMultiPolygon()
721 { return cpl::down_cast<OGRMultiPolygon*>(this); }
722
727 inline const OGRMultiPolygon* toMultiPolygon() const
728 { return cpl::down_cast<const OGRMultiPolygon*>(this); }
729
734 inline OGRMultiCurve* toMultiCurve()
735 { return cpl::down_cast<OGRMultiCurve*>(this); }
736
741 inline const OGRMultiCurve* toMultiCurve() const
742 { return cpl::down_cast<const OGRMultiCurve*>(this); }
743
748 inline OGRMultiSurface* toMultiSurface()
749 { return cpl::down_cast<OGRMultiSurface*>(this); }
750
755 inline const OGRMultiSurface* toMultiSurface() const
756 { return cpl::down_cast<const OGRMultiSurface*>(this); }
757
762 inline OGRPolyhedralSurface* toPolyhedralSurface()
763 { return cpl::down_cast<OGRPolyhedralSurface*>(this); }
764
769 inline const OGRPolyhedralSurface* toPolyhedralSurface() const
770 { return cpl::down_cast<const OGRPolyhedralSurface*>(this); }
771
776 inline OGRTriangulatedSurface* toTriangulatedSurface()
777 { return cpl::down_cast<OGRTriangulatedSurface*>(this); }
778
783 inline const OGRTriangulatedSurface* toTriangulatedSurface() const
784 { return cpl::down_cast<const OGRTriangulatedSurface*>(this); }
785
786 };
787
789 struct CPL_DLL OGRGeometryUniquePtrDeleter
790 {
791 void operator()(OGRGeometry*) const;
792 };
794
798 typedef std::unique_ptr<OGRGeometry, OGRGeometryUniquePtrDeleter> OGRGeometryUniquePtr;
799
800 /************************************************************************/
801 /* OGRPoint */
802 /************************************************************************/
803
810 class CPL_DLL OGRPoint : public OGRGeometry
811 {
812 double x;
813 double y;
814 double z;
815 double m;
816
817 public:
818 OGRPoint();
819 OGRPoint( double x, double y );
820 OGRPoint( double x, double y, double z );
821 OGRPoint( double x, double y, double z, double m );
822 OGRPoint( const OGRPoint& other );
823 ~OGRPoint() override;
824
825 OGRPoint& operator=( const OGRPoint& other );
826
827 // IWks Interface
828 int WkbSize() const override;
829 OGRErr importFromWkb( const unsigned char *,
830 int,
831 OGRwkbVariant,
832 int& nBytesConsumedOut ) override;
833 OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
834 OGRwkbVariant=wkbVariantOldOgc )
835 const override;
836 using OGRGeometry::importFromWkt;
837 OGRErr importFromWkt( const char ** ) override;
838 OGRErr exportToWkt( char ** ppszDstText,
839 OGRwkbVariant=wkbVariantOldOgc )
840 const override;
841
842 // IGeometry
843 virtual int getDimension() const override;
844 virtual OGRGeometry *clone() const override;
845 virtual void empty() override;
846 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
847 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
848 virtual OGRBoolean IsEmpty() const override
849 { return !(flags & OGR_G_NOT_EMPTY_POINT); }
850
851 // IPoint
853 double getX() const { return x; }
855 double getY() const { return y; }
857 double getZ() const { return z; }
859 double getM() const { return m; }
860
861 // Non standard
862 virtual void setCoordinateDimension( int nDimension ) override;
866 void setX( double xIn ) { x = xIn; flags |= OGR_G_NOT_EMPTY_POINT; }
870 void setY( double yIn ) { y = yIn; flags |= OGR_G_NOT_EMPTY_POINT; }
874 void setZ( double zIn )
875 { z = zIn; flags |= (OGR_G_NOT_EMPTY_POINT | OGR_G_3D); }
879 void setM( double mIn )
880 { m = mIn; flags |= (OGR_G_NOT_EMPTY_POINT | OGR_G_MEASURED); }
881
882 // ISpatialRelation
883 virtual OGRBoolean Equals( const OGRGeometry * ) const override;
884 virtual OGRBoolean Intersects( const OGRGeometry * ) const override;
885 virtual OGRBoolean Within( const OGRGeometry * ) const override;
886
887 // Non standard from OGRGeometry
888 virtual const char *getGeometryName() const override;
889 virtual OGRwkbGeometryType getGeometryType() const override;
890 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) override;
891 virtual void flattenTo2D() override;
892 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
893 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
894
895 virtual void swapXY() override;
896 };
897
898 /************************************************************************/
899 /* OGRPointIterator */
900 /************************************************************************/
901
908 class CPL_DLL OGRPointIterator
909 {
910 public:
911 virtual ~OGRPointIterator();
912 virtual OGRBoolean getNextPoint( OGRPoint* p ) = 0;
913
914 static void destroy( OGRPointIterator* );
915 };
916
917 /************************************************************************/
918 /* OGRCurve */
919 /************************************************************************/
920
926 class CPL_DLL OGRCurve : public OGRGeometry
927 {
928 protected:
930 OGRCurve();
931 OGRCurve( const OGRCurve& other );
932
933 virtual OGRCurveCasterToLineString GetCasterToLineString() const = 0;
934 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing() const = 0;
935
936 friend class OGRCurvePolygon;
937 friend class OGRCompoundCurve;
939 virtual int ContainsPoint( const OGRPoint* p ) const;
940 virtual int IntersectsPoint( const OGRPoint* p ) const;
941 virtual double get_AreaOfCurveSegments() const = 0;
942
943 private:
944
945 class CPL_DLL ConstIterator
946 {
947 struct Private;
948 std::unique_ptr<Private> m_poPrivate;
949 public:
950 ConstIterator(const OGRCurve* poSelf, bool bStart);
951 ConstIterator(ConstIterator&& oOther) noexcept; // declared but not defined. Needed for gcc 5.4 at least
952 ~ConstIterator();
953 const OGRPoint& operator*() const;
954 ConstIterator& operator++();
955 bool operator!=(const ConstIterator& it) const;
956 };
957
958 friend inline ConstIterator begin(const OGRCurve*);
959 friend inline ConstIterator end(const OGRCurve*);
960
961 public:
962 ~OGRCurve() override;
963
965 OGRCurve& operator=( const OGRCurve& other );
967
969 typedef OGRPoint ChildType;
970
979 ConstIterator begin() const;
981 ConstIterator end() const;
982
983 // ICurve methods
984 virtual double get_Length() const = 0;
985 virtual void StartPoint( OGRPoint * ) const = 0;
986 virtual void EndPoint( OGRPoint * ) const = 0;
987 virtual int get_IsClosed() const;
988 virtual void Value( double, OGRPoint * ) const = 0;
989 virtual OGRLineString* CurveToLine( double dfMaxAngleStepSizeDegrees = 0,
990 const char* const* papszOptions = nullptr)
991 const = 0;
992 virtual int getDimension() const override;
993
994 // non standard
995 virtual int getNumPoints() const = 0;
996 virtual OGRPointIterator* getPointIterator() const = 0;
997 virtual OGRBoolean IsConvex() const;
998 virtual double get_Area() const = 0;
999
1002 inline OGRSimpleCurve* toSimpleCurve()
1003 { return cpl::down_cast<OGRSimpleCurve*>(this); }
1004
1007 inline const OGRSimpleCurve* toSimpleCurve() const
1008 { return cpl::down_cast<const OGRSimpleCurve*>(this); }
1009
1010 static OGRCompoundCurve* CastToCompoundCurve( OGRCurve* puCurve );
1011 static OGRLineString* CastToLineString( OGRCurve* poCurve );
1012 static OGRLinearRing* CastToLinearRing( OGRCurve* poCurve );
1013 };
1014
1016
1017 inline OGRCurve::ConstIterator begin(const OGRCurve* poCurve) { return poCurve->begin(); }
1019 inline OGRCurve::ConstIterator end(const OGRCurve* poCurve) { return poCurve->end(); }
1021
1022 /************************************************************************/
1023 /* OGRSimpleCurve */
1024 /************************************************************************/
1025
1035 class CPL_DLL OGRSimpleCurve: public OGRCurve
1036 {
1037 protected:
1039 friend class OGRGeometry;
1040
1041 int nPointCount;
1042 OGRRawPoint *paoPoints;
1043 double *padfZ;
1044 double *padfM;
1045
1046 void Make3D();
1047 void Make2D();
1048 void RemoveM();
1049 void AddM();
1050
1051 OGRErr importFromWKTListOnly( const char ** ppszInput, int bHasZ, int bHasM,
1052 OGRRawPoint*& paoPointsIn,
1053 int& nMaxPoints,
1054 double*& padfZIn );
1055
1057
1058 virtual double get_LinearArea() const;
1059
1060 OGRSimpleCurve();
1061 OGRSimpleCurve( const OGRSimpleCurve& other );
1062
1063 private:
1064 class CPL_DLL Iterator
1065 {
1066 struct Private;
1067 std::unique_ptr<Private> m_poPrivate;
1068 void update();
1069 public:
1070 Iterator(OGRSimpleCurve* poSelf, int nPos);
1071 Iterator(Iterator&& oOther) noexcept; // declared but not defined. Needed for gcc 5.4 at least
1072 ~Iterator();
1073 OGRPoint& operator*();
1074 Iterator& operator++();
1075 bool operator!=(const Iterator& it) const;
1076 };
1077
1078 friend inline Iterator begin(OGRSimpleCurve*);
1079 friend inline Iterator end(OGRSimpleCurve*);
1080
1081 class CPL_DLL ConstIterator
1082 {
1083 struct Private;
1084 std::unique_ptr<Private> m_poPrivate;
1085 public:
1086 ConstIterator(const OGRSimpleCurve* poSelf, int nPos);
1087 ConstIterator(ConstIterator&& oOther) noexcept; // declared but not defined. Needed for gcc 5.4 at least
1088 ~ConstIterator();
1089 const OGRPoint& operator*() const;
1090 ConstIterator& operator++();
1091 bool operator!=(const ConstIterator& it) const;
1092 };
1093
1094 friend inline ConstIterator begin(const OGRSimpleCurve*);
1095 friend inline ConstIterator end(const OGRSimpleCurve*);
1096
1097 public:
1098 ~OGRSimpleCurve() override;
1099
1100 OGRSimpleCurve& operator=( const OGRSimpleCurve& other );
1101
1103 typedef OGRPoint ChildType;
1104
1113 Iterator begin();
1115 Iterator end();
1124 ConstIterator begin() const;
1126 ConstIterator end() const;
1127
1128 // IWks Interface.
1129 virtual int WkbSize() const override;
1130 virtual OGRErr importFromWkb( const unsigned char *,
1131 int,
1132 OGRwkbVariant,
1133 int& nBytesConsumedOut ) override;
1134 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1135 OGRwkbVariant=wkbVariantOldOgc )
1136 const override;
1137 using OGRGeometry::importFromWkt;
1138 OGRErr importFromWkt( const char ** ) override;
1139 virtual OGRErr exportToWkt( char ** ppszDstText,
1140 OGRwkbVariant=wkbVariantOldOgc )
1141 const override;
1142
1143 // IGeometry interface.
1144 virtual OGRGeometry *clone() const override;
1145 virtual void empty() override;
1146 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
1147 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
1148 virtual OGRBoolean IsEmpty() const override;
1149
1150 // ICurve methods.
1151 virtual double get_Length() const override;
1152 virtual void StartPoint( OGRPoint * ) const override;
1153 virtual void EndPoint( OGRPoint * ) const override;
1154 virtual void Value( double, OGRPoint * ) const override;
1155 virtual double Project( const OGRPoint * ) const;
1156 virtual OGRLineString* getSubLine( double, double, int ) const;
1157
1158 // ILineString methods.
1159 virtual int getNumPoints() const override { return nPointCount; }
1160 void getPoint( int, OGRPoint * ) const;
1161 double getX( int i ) const { return paoPoints[i].x; }
1162 double getY( int i ) const { return paoPoints[i].y; }
1163 double getZ( int i ) const;
1164 double getM( int i ) const;
1165
1166 // ISpatialRelation
1167 virtual OGRBoolean Equals( const OGRGeometry * ) const override;
1168
1169 // non standard.
1170 virtual void setCoordinateDimension( int nDimension ) override;
1171 virtual void set3D( OGRBoolean bIs3D ) override;
1172 virtual void setMeasured( OGRBoolean bIsMeasured ) override;
1173 void setNumPoints( int nNewPointCount,
1174 int bZeroizeNewContent = TRUE );
1175 void setPoint( int, OGRPoint * );
1176 void setPoint( int, double, double );
1177 void setZ( int, double );
1178 void setM( int, double );
1179 void setPoint( int, double, double, double );
1180 void setPointM( int, double, double, double );
1181 void setPoint( int, double, double, double, double );
1182 void setPoints( int, const OGRRawPoint *, const double * = nullptr );
1183 void setPointsM( int, const OGRRawPoint *, const double * );
1184 void setPoints( int, const OGRRawPoint *, const double *, const double * );
1185 void setPoints( int, const double * padfX, const double * padfY,
1186 const double *padfZIn = nullptr );
1187 void setPointsM( int, const double * padfX, const double * padfY,
1188 const double *padfMIn = nullptr );
1189 void setPoints( int, const double * padfX, const double * padfY,
1190 const double *padfZIn, const double *padfMIn );
1191 void addPoint( const OGRPoint * );
1192 void addPoint( double, double );
1193 void addPoint( double, double, double );
1194 void addPointM( double, double, double );
1195 void addPoint( double, double, double, double );
1196
1197 void getPoints( OGRRawPoint *, double * = nullptr ) const;
1198 void getPoints( void* pabyX, int nXStride,
1199 void* pabyY, int nYStride,
1200 void* pabyZ = nullptr, int nZStride = 0 ) const;
1201 void getPoints( void* pabyX, int nXStride,
1202 void* pabyY, int nYStride,
1203 void* pabyZ, int nZStride,
1204 void* pabyM, int nMStride ) const;
1205
1206 void addSubLineString( const OGRLineString *,
1207 int nStartVertex = 0, int nEndVertex = -1 );
1208 void reversePoints( void );
1209 virtual OGRPointIterator* getPointIterator() const override;
1210
1211 // non-standard from OGRGeometry
1212 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) override;
1213 virtual void flattenTo2D() override;
1214 virtual void segmentize(double dfMaxLength) override;
1215
1216 virtual void swapXY() override;
1217 };
1218
1220
1221 inline OGRSimpleCurve::Iterator begin(OGRSimpleCurve* poCurve) { return poCurve->begin(); }
1223 inline OGRSimpleCurve::Iterator end(OGRSimpleCurve* poCurve) { return poCurve->end(); }
1224
1226 inline OGRSimpleCurve::ConstIterator begin(const OGRSimpleCurve* poCurve) { return poCurve->begin(); }
1228 inline OGRSimpleCurve::ConstIterator end(const OGRSimpleCurve* poCurve) { return poCurve->end(); }
1230
1231 /************************************************************************/
1232 /* OGRLineString */
1233 /************************************************************************/
1234
1242 class CPL_DLL OGRLineString : public OGRSimpleCurve
1243 {
1244 // cppcheck-suppress unusedPrivateFunction
1245 static OGRLinearRing* CasterToLinearRing(OGRCurve* poCurve);
1246
1247 protected:
1249 static OGRLineString* TransferMembersAndDestroy(
1250 OGRLineString* poSrc,
1251 OGRLineString* poDst);
1252
1253 virtual OGRCurveCasterToLineString GetCasterToLineString()
1254 const override;
1255 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
1256 const override;
1257
1258 virtual double get_AreaOfCurveSegments() const override;
1260
1261 static OGRLinearRing* CastToLinearRing( OGRLineString* poLS );
1262
1263 public:
1264 OGRLineString();
1265 OGRLineString( const OGRLineString& other );
1266 ~OGRLineString() override;
1267
1268 OGRLineString& operator=(const OGRLineString& other);
1269
1270 virtual OGRLineString* CurveToLine( double dfMaxAngleStepSizeDegrees = 0,
1271 const char* const* papszOptions = nullptr )
1272 const override;
1273 virtual OGRGeometry* getCurveGeometry(
1274 const char* const* papszOptions = nullptr ) const override;
1275 virtual double get_Area() const override;
1276
1277 // Non-standard from OGRGeometry.
1278 virtual OGRwkbGeometryType getGeometryType() const override;
1279 virtual const char *getGeometryName() const override;
1280
1282 inline OGRSimpleCurve* toUpperClass() { return this; }
1284 inline const OGRSimpleCurve* toUpperClass() const { return this; }
1285
1286 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
1287 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
1288 };
1289
1290 /************************************************************************/
1291 /* OGRLinearRing */
1292 /************************************************************************/
1293
1314 class CPL_DLL OGRLinearRing : public OGRLineString
1315 {
1316 static OGRLineString* CasterToLineString( OGRCurve* poCurve );
1317
1318 protected:
1320 friend class OGRPolygon;
1321 friend class OGRTriangle;
1322
1323 // These are not IWks compatible ... just a convenience for OGRPolygon.
1324 virtual int _WkbSize( int _flags ) const;
1325 virtual OGRErr _importFromWkb( OGRwkbByteOrder, int _flags,
1326 const unsigned char *, int,
1327 int& nBytesConsumedOut );
1328 virtual OGRErr _exportToWkb( OGRwkbByteOrder, int _flags,
1329 unsigned char * ) const;
1330
1331 virtual OGRCurveCasterToLineString GetCasterToLineString()
1332 const override;
1333 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
1334 const override;
1336
1337 static OGRLineString* CastToLineString( OGRLinearRing* poLR );
1338
1339 public:
1340 OGRLinearRing();
1341 OGRLinearRing( const OGRLinearRing& other );
1342 explicit OGRLinearRing( OGRLinearRing * );
1343 ~OGRLinearRing() override;
1344
1345 OGRLinearRing& operator=( const OGRLinearRing& other );
1346
1347 // Non standard.
1348 virtual const char *getGeometryName() const override;
1349 virtual OGRGeometry *clone() const override;
1350 virtual int isClockwise() const;
1351 virtual void reverseWindingOrder();
1352 virtual void closeRings() override;
1353 OGRBoolean isPointInRing( const OGRPoint* pt,
1354 int bTestEnvelope = TRUE ) const;
1355 OGRBoolean isPointOnRingBoundary( const OGRPoint* pt,
1356 int bTestEnvelope = TRUE ) const;
1357 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) override;
1358
1360 inline OGRLineString* toUpperClass() { return this; }
1362 inline const OGRLineString* toUpperClass() const { return this; }
1363
1364 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
1365 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
1366
1367 // IWks Interface - Note this isn't really a first class object
1368 // for the purposes of WKB form. These methods always fail since this
1369 // object can't be serialized on its own.
1370 virtual int WkbSize() const override;
1371 virtual OGRErr importFromWkb( const unsigned char *,
1372 int,
1373 OGRwkbVariant,
1374 int& nBytesConsumedOut ) override;
1375 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1376 OGRwkbVariant=wkbVariantOldOgc )
1377 const override;
1378 };
1379
1380 /************************************************************************/
1381 /* OGRCircularString */
1382 /************************************************************************/
1383
1396 class CPL_DLL OGRCircularString : public OGRSimpleCurve
1397 {
1398 private:
1399 void ExtendEnvelopeWithCircular( OGREnvelope * psEnvelope ) const;
1400 OGRBoolean IsValidFast() const;
1401 int IsFullCircle( double& cx, double& cy, double& square_R ) const;
1402
1403 protected:
1405 virtual OGRCurveCasterToLineString GetCasterToLineString()
1406 const override;
1407 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
1408 const override;
1409 virtual int IntersectsPoint( const OGRPoint* p ) const override;
1410 virtual int ContainsPoint( const OGRPoint* p ) const override;
1411 virtual double get_AreaOfCurveSegments() const override;
1413
1414 public:
1415 OGRCircularString();
1416 OGRCircularString( const OGRCircularString& other );
1417 ~OGRCircularString() override;
1418
1419 OGRCircularString& operator=(const OGRCircularString& other);
1420
1421 // IWks Interface.
1422 virtual OGRErr importFromWkb( const unsigned char *,
1423 int,
1424 OGRwkbVariant,
1425 int& nBytesConsumedOut ) override;
1426 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1427 OGRwkbVariant=wkbVariantOldOgc )
1428 const override;
1429 using OGRGeometry::importFromWkt;
1430 OGRErr importFromWkt( const char ** ) override;
1431 virtual OGRErr exportToWkt( char ** ppszDstText,
1432 OGRwkbVariant=wkbVariantOldOgc )
1433 const override;
1434
1435 // IGeometry interface.
1436 virtual OGRBoolean IsValid() const override;
1437 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
1438 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
1439
1440 // ICurve methods.
1441 virtual double get_Length() const override;
1442 virtual OGRLineString* CurveToLine( double dfMaxAngleStepSizeDegrees = 0,
1443 const char* const* papszOptions = nullptr )
1444 const override;
1445 virtual void Value( double, OGRPoint * ) const override;
1446 virtual double get_Area() const override;
1447
1448 // Non-standard from OGRGeometry.
1449 virtual OGRwkbGeometryType getGeometryType() const override;
1450 virtual const char *getGeometryName() const override;
1451 virtual void segmentize( double dfMaxLength ) override;
1452 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
1453 const override;
1454 virtual OGRGeometry* getLinearGeometry(
1455 double dfMaxAngleStepSizeDegrees = 0,
1456 const char* const* papszOptions = nullptr) const override;
1457
1459 inline OGRSimpleCurve* toUpperClass() { return this; }
1461 inline const OGRSimpleCurve* toUpperClass() const { return this; }
1462
1463 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
1464 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
1465 };
1466
1467 /************************************************************************/
1468 /* OGRCurveCollection */
1469 /************************************************************************/
1470
1481 class CPL_DLL OGRCurveCollection
1483 {
1484 protected:
1485 friend class OGRCompoundCurve;
1486 friend class OGRCurvePolygon;
1487 friend class OGRPolygon;
1488 friend class OGRTriangle;
1489
1490 int nCurveCount = 0;
1491 OGRCurve **papoCurves = nullptr;
1492
1493 public:
1494 OGRCurveCollection();
1495 OGRCurveCollection(const OGRCurveCollection& other);
1496 ~OGRCurveCollection();
1497
1498 OGRCurveCollection& operator=(const OGRCurveCollection& other);
1499
1501 typedef OGRCurve ChildType;
1502
1506 OGRCurve** begin() { return papoCurves; }
1508 OGRCurve** end() { return papoCurves + nCurveCount; }
1512 const OGRCurve* const* begin() const { return papoCurves; }
1514 const OGRCurve* const* end() const { return papoCurves + nCurveCount; }
1515
1516 void empty(OGRGeometry* poGeom);
1517 OGRBoolean IsEmpty() const;
1518 void getEnvelope( OGREnvelope * psEnvelope ) const;
1519 void getEnvelope( OGREnvelope3D * psEnvelope ) const;
1520
1521 OGRErr addCurveDirectly( OGRGeometry* poGeom, OGRCurve* poCurve,
1522 int bNeedRealloc );
1523 int WkbSize() const;
1524 OGRErr importPreambleFromWkb( OGRGeometry* poGeom,
1525 const unsigned char * pabyData,
1526 int& nSize,
1527 int& nDataOffset,
1528 OGRwkbByteOrder& eByteOrder,
1529 int nMinSubGeomSize,
1530 OGRwkbVariant eWkbVariant );
1531 OGRErr importBodyFromWkb(
1532 OGRGeometry* poGeom,
1533 const unsigned char * pabyData,
1534 int nSize,
1535 int bAcceptCompoundCurve,
1536 OGRErr (*pfnAddCurveDirectlyFromWkb)( OGRGeometry* poGeom,
1537 OGRCurve* poCurve ),
1538 OGRwkbVariant eWkbVariant,
1539 int& nBytesConsumedOut );
1540 OGRErr exportToWkt( const OGRGeometry* poGeom,
1541 char ** ppszDstText ) const;
1542 OGRErr exportToWkb( const OGRGeometry* poGeom, OGRwkbByteOrder,
1543 unsigned char *,
1544 OGRwkbVariant eWkbVariant ) const;
1545 OGRBoolean Equals(const OGRCurveCollection *poOCC) const;
1546 void setCoordinateDimension( OGRGeometry* poGeom,
1547 int nNewDimension );
1548 void set3D( OGRGeometry* poGeom, OGRBoolean bIs3D );
1549 void setMeasured( OGRGeometry* poGeom, OGRBoolean bIsMeasured );
1550 void assignSpatialReference( OGRGeometry* poGeom, OGRSpatialReference * poSR );
1551 int getNumCurves() const;
1552 OGRCurve *getCurve( int );
1553 const OGRCurve *getCurve( int ) const;
1554 OGRCurve *stealCurve( int );
1555
1556 OGRErr removeCurve( int iIndex, bool bDelete = true );
1557
1558 OGRErr transform( OGRGeometry* poGeom,
1559 OGRCoordinateTransformation *poCT );
1560 void flattenTo2D( OGRGeometry* poGeom );
1561 void segmentize( double dfMaxLength );
1562 void swapXY();
1563 OGRBoolean hasCurveGeometry(int bLookForNonLinear) const;
1564 };
1566
1567 /************************************************************************/
1568 /* OGRCompoundCurve */
1569 /************************************************************************/
1570
1581 class CPL_DLL OGRCompoundCurve : public OGRCurve
1582 {
1583 private:
1584 OGRCurveCollection oCC{};
1585
1586 OGRErr addCurveDirectlyInternal( OGRCurve* poCurve,
1587 double dfToleranceEps,
1588 int bNeedRealloc );
1589 static OGRErr addCurveDirectlyFromWkt( OGRGeometry* poSelf,
1590 OGRCurve* poCurve );
1591 static OGRErr addCurveDirectlyFromWkb( OGRGeometry* poSelf,
1592 OGRCurve* poCurve );
1593 OGRLineString* CurveToLineInternal( double dfMaxAngleStepSizeDegrees,
1594 const char* const* papszOptions,
1595 int bIsLinearRing ) const;
1596 // cppcheck-suppress unusedPrivateFunction
1597 static OGRLineString* CasterToLineString( OGRCurve* poCurve );
1598 // cppcheck-suppress unusedPrivateFunction
1599 static OGRLinearRing* CasterToLinearRing( OGRCurve* poCurve );
1600
1601 protected:
1603 static OGRLineString* CastToLineString( OGRCompoundCurve* poCC );
1604 static OGRLinearRing* CastToLinearRing( OGRCompoundCurve* poCC );
1605
1606 virtual OGRCurveCasterToLineString GetCasterToLineString()
1607 const override;
1608 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
1609 const override;
1611
1612 public:
1613 OGRCompoundCurve();
1614 OGRCompoundCurve( const OGRCompoundCurve& other );
1615 ~OGRCompoundCurve() override;
1616
1617 OGRCompoundCurve& operator=( const OGRCompoundCurve& other );
1618
1620 typedef OGRCurve ChildType;
1621
1625 ChildType** begin() { return oCC.begin(); }
1627 ChildType** end() { return oCC.end(); }
1631 const ChildType* const * begin() const { return oCC.begin(); }
1633 const ChildType* const * end() const { return oCC.end(); }
1634
1635 // IWks Interface
1636 virtual int WkbSize() const override;
1637 virtual OGRErr importFromWkb( const unsigned char *,
1638 int,
1639 OGRwkbVariant,
1640 int& nBytesConsumedOut ) override;
1641 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1642 OGRwkbVariant=wkbVariantOldOgc )
1643 const override;
1644 using OGRGeometry::importFromWkt;
1645 OGRErr importFromWkt( const char ** ) override;
1646 virtual OGRErr exportToWkt( char ** ppszDstText,
1647 OGRwkbVariant=wkbVariantOldOgc )
1648 const override;
1649
1650 // IGeometry interface.
1651 virtual OGRGeometry *clone() const override;
1652 virtual void empty() override;
1653 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
1654 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
1655 virtual OGRBoolean IsEmpty() const override;
1656
1657 // ICurve methods.
1658 virtual double get_Length() const override;
1659 virtual void StartPoint( OGRPoint * ) const override;
1660 virtual void EndPoint( OGRPoint * ) const override;
1661 virtual void Value( double, OGRPoint * ) const override;
1662 virtual OGRLineString* CurveToLine( double dfMaxAngleStepSizeDegrees = 0,
1663 const char* const* papszOptions = nullptr )
1664 const override;
1665
1666 virtual int getNumPoints() const override;
1667 virtual double get_AreaOfCurveSegments() const override;
1668 virtual double get_Area() const override;
1669
1670 // ISpatialRelation.
1671 virtual OGRBoolean Equals( const OGRGeometry * ) const override;
1672
1673 // ICompoundCurve method.
1674 int getNumCurves() const;
1675 OGRCurve *getCurve( int );
1676 const OGRCurve *getCurve( int ) const;
1677
1678 // Non-standard.
1679 virtual void setCoordinateDimension( int nDimension ) override;
1680 virtual void set3D( OGRBoolean bIs3D ) override;
1681 virtual void setMeasured( OGRBoolean bIsMeasured ) override;
1682
1683 virtual void assignSpatialReference( OGRSpatialReference * poSR ) override;
1684
1685 OGRErr addCurve( OGRCurve*, double dfToleranceEps = 1e-14 );
1686 OGRErr addCurveDirectly( OGRCurve*, double dfToleranceEps = 1e-14 );
1687 OGRCurve *stealCurve( int );
1688 virtual OGRPointIterator* getPointIterator() const override;
1689
1690 // Non-standard from OGRGeometry.
1691 virtual OGRwkbGeometryType getGeometryType() const override;
1692 virtual const char *getGeometryName() const override;
1693 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) override;
1694 virtual void flattenTo2D() override;
1695 virtual void segmentize(double dfMaxLength) override;
1696 virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear = FALSE)
1697 const override;
1698 virtual OGRGeometry* getLinearGeometry(
1699 double dfMaxAngleStepSizeDegrees = 0,
1700 const char* const* papszOptions = nullptr) const override;
1701 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
1702 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
1703
1704 virtual void swapXY() override;
1705 };
1706
1708
1709 inline const OGRCompoundCurve::ChildType* const * begin(const OGRCompoundCurve* poCurve) { return poCurve->begin(); }
1711 inline const OGRCompoundCurve::ChildType* const * end(const OGRCompoundCurve* poCurve) { return poCurve->end(); }
1712
1714 inline OGRCompoundCurve::ChildType** begin(OGRCompoundCurve* poCurve) { return poCurve->begin(); }
1716 inline OGRCompoundCurve::ChildType** end(OGRCompoundCurve* poCurve) { return poCurve->end(); }
1718
1719 /************************************************************************/
1720 /* OGRSurface */
1721 /************************************************************************/
1722
1728 class CPL_DLL OGRSurface : public OGRGeometry
1729 {
1730 protected:
1732 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon() const = 0;
1733 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon() const = 0;
1735
1736 public:
1737 virtual double get_Area() const = 0;
1738 virtual OGRErr PointOnSurface( OGRPoint * poPoint ) const
1739 { return PointOnSurfaceInternal(poPoint); }
1741 static OGRPolygon* CastToPolygon(OGRSurface* poSurface);
1742 static OGRCurvePolygon* CastToCurvePolygon(OGRSurface* poSurface);
1744 };
1745
1746 /************************************************************************/
1747 /* OGRCurvePolygon */
1748 /************************************************************************/
1749
1763 class CPL_DLL OGRCurvePolygon : public OGRSurface
1764 {
1765 static OGRPolygon* CasterToPolygon(OGRSurface* poSurface);
1766
1767 private:
1768 OGRBoolean IntersectsPoint( const OGRPoint* p ) const;
1769 OGRBoolean ContainsPoint( const OGRPoint* p ) const;
1770 virtual int checkRing( OGRCurve * poNewRing ) const;
1771 OGRErr addRingDirectlyInternal( OGRCurve* poCurve,
1772 int bNeedRealloc );
1773 static OGRErr addCurveDirectlyFromWkt( OGRGeometry* poSelf,
1774 OGRCurve* poCurve );
1775 static OGRErr addCurveDirectlyFromWkb( OGRGeometry* poSelf,
1776 OGRCurve* poCurve );
1777
1778 protected:
1780 friend class OGRPolygon;
1781 friend class OGRTriangle;
1782 OGRCurveCollection oCC{};
1783
1784 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
1785 const override;
1786 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
1787 const override;
1789
1790 static OGRPolygon* CastToPolygon( OGRCurvePolygon* poCP );
1791
1792 public:
1793 OGRCurvePolygon();
1794 OGRCurvePolygon( const OGRCurvePolygon& );
1795 ~OGRCurvePolygon() override;
1796
1797 OGRCurvePolygon& operator=( const OGRCurvePolygon& other );
1798
1800 typedef OGRCurve ChildType;
1801
1805 ChildType** begin() { return oCC.begin(); }
1807 ChildType** end() { return oCC.end(); }
1811 const ChildType* const * begin() const { return oCC.begin(); }
1813 const ChildType* const * end() const { return oCC.end(); }
1814
1815 // Non standard (OGRGeometry).
1816 virtual const char *getGeometryName() const override;
1817 virtual OGRwkbGeometryType getGeometryType() const override;
1818 virtual OGRGeometry *clone() const override;
1819 virtual void empty() override;
1820 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) override;
1821 virtual void flattenTo2D() override;
1822 virtual OGRBoolean IsEmpty() const override;
1823 virtual void segmentize( double dfMaxLength ) override;
1824 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
1825 const override;
1826 virtual OGRGeometry* getLinearGeometry(
1827 double dfMaxAngleStepSizeDegrees = 0,
1828 const char* const* papszOptions = nullptr ) const override;
1829
1830 // ISurface Interface
1831 virtual double get_Area() const override;
1832
1833 // IWks Interface
1834 virtual int WkbSize() const override;
1835 virtual OGRErr importFromWkb( const unsigned char *,
1836 int,
1837 OGRwkbVariant,
1838 int& nBytesConsumedOut ) override;
1839 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1840 OGRwkbVariant=wkbVariantOldOgc )
1841 const override;
1842 using OGRGeometry::importFromWkt;
1843 OGRErr importFromWkt( const char ** ) override;
1844 virtual OGRErr exportToWkt( char ** ppszDstText,
1845 OGRwkbVariant eWkbVariant = wkbVariantOldOgc )
1846 const override;
1847
1848 // IGeometry
1849 virtual int getDimension() const override;
1850 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
1851 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
1852
1853 // ICurvePolygon
1854 virtual OGRPolygon* CurvePolyToPoly(
1855 double dfMaxAngleStepSizeDegrees = 0,
1856 const char* const* papszOptions = nullptr ) const;
1857
1858 // ISpatialRelation
1859 virtual OGRBoolean Equals( const OGRGeometry * ) const override;
1860 virtual OGRBoolean Intersects( const OGRGeometry * ) const override;
1861 virtual OGRBoolean Contains( const OGRGeometry * ) const override;
1862
1863 // Non standard
1864 virtual void setCoordinateDimension( int nDimension ) override;
1865 virtual void set3D( OGRBoolean bIs3D ) override;
1866 virtual void setMeasured( OGRBoolean bIsMeasured ) override;
1867
1868 virtual void assignSpatialReference( OGRSpatialReference * poSR ) override;
1869
1870 virtual OGRErr addRing( OGRCurve * );
1871 virtual OGRErr addRingDirectly( OGRCurve * );
1872
1873 OGRCurve *getExteriorRingCurve();
1874 const OGRCurve *getExteriorRingCurve() const;
1875 int getNumInteriorRings() const;
1876 OGRCurve *getInteriorRingCurve( int );
1877 const OGRCurve *getInteriorRingCurve( int ) const;
1878
1879 OGRCurve *stealExteriorRingCurve();
1880
1881 OGRErr removeRing( int iIndex, bool bDelete = true );
1882 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
1883 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
1884
1885 virtual void swapXY() override;
1886 };
1887
1889
1890 inline const OGRCurvePolygon::ChildType* const * begin(const OGRCurvePolygon* poGeom) { return poGeom->begin(); }
1892 inline const OGRCurvePolygon::ChildType* const * end(const OGRCurvePolygon* poGeom) { return poGeom->end(); }
1893
1895 inline OGRCurvePolygon::ChildType** begin(OGRCurvePolygon* poGeom) { return poGeom->begin(); }
1897 inline OGRCurvePolygon::ChildType** end(OGRCurvePolygon* poGeom) { return poGeom->end(); }
1899
1900 /************************************************************************/
1901 /* OGRPolygon */
1902 /************************************************************************/
1903
1913 class CPL_DLL OGRPolygon : public OGRCurvePolygon
1914 {
1915 static OGRCurvePolygon* CasterToCurvePolygon(OGRSurface* poSurface);
1916
1917 protected:
1919 friend class OGRMultiSurface;
1920 friend class OGRPolyhedralSurface;
1921 friend class OGRTriangulatedSurface;
1922
1923 virtual int checkRing( OGRCurve * poNewRing ) const override;
1924 virtual OGRErr importFromWKTListOnly( const char ** ppszInput,
1925 int bHasZ, int bHasM,
1926 OGRRawPoint*& paoPoints,
1927 int& nMaxPoints,
1928 double*& padfZ );
1929
1930 static OGRCurvePolygon* CastToCurvePolygon(OGRPolygon* poPoly);
1931
1932 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
1933 const override;
1934 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
1935 const override;
1937
1938 public:
1939 OGRPolygon();
1940 OGRPolygon(const OGRPolygon& other);
1941 ~OGRPolygon() override;
1942
1943 OGRPolygon& operator=(const OGRPolygon& other);
1944
1946 typedef OGRLinearRing ChildType;
1947
1951 ChildType** begin() { return reinterpret_cast<ChildType**>(oCC.begin()); }
1953 ChildType** end() { return reinterpret_cast<ChildType**>(oCC.end()); }
1957 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(oCC.begin()); }
1959 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(oCC.end()); }
1960
1961 // Non-standard (OGRGeometry).
1962 virtual const char *getGeometryName() const override;
1963 virtual OGRwkbGeometryType getGeometryType() const override;
1964 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
1965 const override;
1966 virtual OGRGeometry* getCurveGeometry(
1967 const char* const* papszOptions = nullptr ) const override;
1968 virtual OGRGeometry* getLinearGeometry(
1969 double dfMaxAngleStepSizeDegrees = 0,
1970 const char* const* papszOptions = nullptr) const override;
1971
1972 // IWks Interface.
1973 virtual int WkbSize() const override;
1974 virtual OGRErr importFromWkb( const unsigned char *,
1975 int,
1976 OGRwkbVariant,
1977 int& nBytesConsumedOut ) override;
1978 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1979 OGRwkbVariant=wkbVariantOldOgc )
1980 const override;
1981 using OGRGeometry::importFromWkt;
1982 OGRErr importFromWkt( const char ** ) override;
1983
1984 virtual OGRErr exportToWkt( char ** ppszDstText,
1985 OGRwkbVariant=wkbVariantOldOgc )
1986 const override;
1987
1988 // ICurvePolygon.
1989 virtual OGRPolygon* CurvePolyToPoly(
1990 double dfMaxAngleStepSizeDegrees = 0,
1991 const char* const* papszOptions = nullptr ) const override;
1992
1993 OGRLinearRing *getExteriorRing();
1994 const OGRLinearRing *getExteriorRing() const;
1995 virtual OGRLinearRing *getInteriorRing( int );
1996 virtual const OGRLinearRing *getInteriorRing( int ) const;
1997
1998 OGRLinearRing *stealExteriorRing();
1999 virtual OGRLinearRing *stealInteriorRing(int);
2000
2001 OGRBoolean IsPointOnSurface( const OGRPoint * ) const;
2002
2004 inline OGRCurvePolygon* toUpperClass() { return this; }
2006 inline const OGRCurvePolygon* toUpperClass() const { return this; }
2007
2008 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2009 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2010
2011 virtual void closeRings() override;
2012 };
2013
2015
2016 inline const OGRPolygon::ChildType* const * begin(const OGRPolygon* poGeom) { return poGeom->begin(); }
2018 inline const OGRPolygon::ChildType* const * end(const OGRPolygon* poGeom) { return poGeom->end(); }
2019
2021 inline OGRPolygon::ChildType** begin(OGRPolygon* poGeom) { return poGeom->begin(); }
2023 inline OGRPolygon::ChildType** end(OGRPolygon* poGeom) { return poGeom->end(); }
2025
2026 /************************************************************************/
2027 /* OGRTriangle */
2028 /************************************************************************/
2029
2036 class CPL_DLL OGRTriangle : public OGRPolygon
2037 {
2038 private:
2039 // cppcheck-suppress unusedPrivateFunction
2040 static OGRPolygon* CasterToPolygon(OGRSurface* poSurface);
2041 bool quickValidityCheck() const;
2042
2043 protected:
2045 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon() const override;
2046 virtual OGRErr importFromWKTListOnly( const char ** ppszInput,
2047 int bHasZ, int bHasM,
2048 OGRRawPoint*& paoPoints,
2049 int& nMaxPoints,
2050 double*& padfZ ) override;
2052
2053 public:
2054 OGRTriangle();
2055 OGRTriangle( const OGRPoint &p, const OGRPoint &q, const OGRPoint &r );
2056 OGRTriangle( const OGRTriangle &other );
2057 OGRTriangle( const OGRPolygon &other, OGRErr &eErr );
2058 OGRTriangle& operator=( const OGRTriangle& other );
2059 ~OGRTriangle() override;
2060 virtual const char *getGeometryName() const override;
2061 virtual OGRwkbGeometryType getGeometryType() const override;
2062
2063 // IWks Interface.
2064 virtual OGRErr importFromWkb( const unsigned char *,
2065 int,
2066 OGRwkbVariant,
2067 int& nBytesConsumedOut ) override;
2068
2069 // New methods rewritten from OGRPolygon/OGRCurvePolygon/OGRGeometry.
2070 virtual OGRErr addRingDirectly( OGRCurve * poNewRing ) override;
2071
2073 inline OGRPolygon* toUpperClass() { return this; }
2075 inline const OGRPolygon* toUpperClass() const { return this; }
2076
2077 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2078 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2079
2081 static OGRGeometry* CastToPolygon( OGRGeometry* poGeom );
2083 };
2084
2085 /************************************************************************/
2086 /* OGRGeometryCollection */
2087 /************************************************************************/
2088
2096 class CPL_DLL OGRGeometryCollection : public OGRGeometry
2097 {
2098 OGRErr importFromWkbInternal( const unsigned char * pabyData,
2099 int nSize,
2100 int nRecLevel,
2101 OGRwkbVariant, int& nBytesConsumedOut );
2102 OGRErr importFromWktInternal( const char **ppszInput, int nRecLevel );
2103
2104 protected:
2106 int nGeomCount = 0;
2107 OGRGeometry **papoGeoms = nullptr;
2108
2109 OGRErr exportToWktInternal( char ** ppszDstText,
2110 OGRwkbVariant eWkbVariant,
2111 const char* pszSkipPrefix ) const;
2112 static OGRGeometryCollection* TransferMembersAndDestroy(
2113 OGRGeometryCollection* poSrc,
2114 OGRGeometryCollection* poDst );
2116 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType ) const;
2117
2118 public:
2119 OGRGeometryCollection();
2120 OGRGeometryCollection( const OGRGeometryCollection& other );
2121 ~OGRGeometryCollection() override;
2122
2123 OGRGeometryCollection& operator=( const OGRGeometryCollection& other );
2124
2126 typedef OGRGeometry ChildType;
2127
2131 ChildType** begin() { return papoGeoms; }
2133 ChildType** end() { return papoGeoms + nGeomCount; }
2137 const ChildType* const* begin() const { return papoGeoms; }
2139 const ChildType* const* end() const { return papoGeoms + nGeomCount; }
2140
2141 // Non standard (OGRGeometry).
2142 virtual const char *getGeometryName() const override;
2143 virtual OGRwkbGeometryType getGeometryType() const override;
2144 virtual OGRGeometry *clone() const override;
2145 virtual void empty() override;
2146 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) override;
2147 virtual void flattenTo2D() override;
2148 virtual OGRBoolean IsEmpty() const override;
2149 virtual void segmentize(double dfMaxLength) override;
2150 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2151 const override;
2152 virtual OGRGeometry* getCurveGeometry(
2153 const char* const* papszOptions = nullptr ) const override;
2154 virtual OGRGeometry* getLinearGeometry(
2155 double dfMaxAngleStepSizeDegrees = 0,
2156 const char* const* papszOptions = nullptr ) const override;
2157
2158 // IWks Interface
2159 virtual int WkbSize() const override;
2160 virtual OGRErr importFromWkb( const unsigned char *,
2161 int,
2162 OGRwkbVariant,
2163 int& nBytesConsumedOut ) override;
2164 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
2165 OGRwkbVariant=wkbVariantOldOgc )
2166 const override;
2167 using OGRGeometry::importFromWkt;
2168 OGRErr importFromWkt( const char ** ) override;
2169
2170 virtual OGRErr exportToWkt( char ** ppszDstText,
2171 OGRwkbVariant=wkbVariantOldOgc )
2172 const override;
2173
2174 virtual double get_Length() const;
2175 virtual double get_Area() const;
2176
2177 // IGeometry methods
2178 virtual int getDimension() const override;
2179 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
2180 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
2181
2182 // IGeometryCollection
2183 int getNumGeometries() const;
2184 OGRGeometry *getGeometryRef( int );
2185 const OGRGeometry *getGeometryRef( int ) const;
2186
2187 // ISpatialRelation
2188 virtual OGRBoolean Equals( const OGRGeometry * ) const override;
2189
2190 // Non standard
2191 virtual void setCoordinateDimension( int nDimension ) override;
2192 virtual void set3D( OGRBoolean bIs3D ) override;
2193 virtual void setMeasured( OGRBoolean bIsMeasured ) override;
2194 virtual OGRErr addGeometry( const OGRGeometry * );
2195 virtual OGRErr addGeometryDirectly( OGRGeometry * );
2196 virtual OGRErr removeGeometry( int iIndex, int bDelete = TRUE );
2197
2198 virtual void assignSpatialReference( OGRSpatialReference * poSR ) override;
2199
2200 void closeRings() override;
2201
2202 virtual void swapXY() override;
2203
2204 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2205 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2206
2207 static OGRGeometryCollection* CastToGeometryCollection(
2208 OGRGeometryCollection* poSrc );
2209 };
2210
2212
2213 inline const OGRGeometryCollection::ChildType* const * begin(const OGRGeometryCollection* poGeom) { return poGeom->begin(); }
2215 inline const OGRGeometryCollection::ChildType* const * end(const OGRGeometryCollection* poGeom) { return poGeom->end(); }
2216
2218 inline OGRGeometryCollection::ChildType** begin(OGRGeometryCollection* poGeom) { return poGeom->begin(); }
2220 inline OGRGeometryCollection::ChildType** end(OGRGeometryCollection* poGeom) { return poGeom->end(); }
2222
2223 /************************************************************************/
2224 /* OGRMultiSurface */
2225 /************************************************************************/
2226
2233 class CPL_DLL OGRMultiSurface : public OGRGeometryCollection
2234 {
2235 protected:
2236 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
2237 const override;
2238
2239 public:
2240 OGRMultiSurface();
2241 OGRMultiSurface( const OGRMultiSurface& other );
2242 ~OGRMultiSurface() override;
2243
2244 OGRMultiSurface& operator=( const OGRMultiSurface& other );
2245
2247 typedef OGRSurface ChildType;
2248
2252 ChildType** begin() { return reinterpret_cast<ChildType**>(papoGeoms); }
2254 ChildType** end() { return reinterpret_cast<ChildType**>(papoGeoms + nGeomCount); }
2258 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(papoGeoms); }
2260 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(papoGeoms + nGeomCount); }
2261
2262 // Non standard (OGRGeometry).
2263 virtual const char *getGeometryName() const override;
2264 virtual OGRwkbGeometryType getGeometryType() const override;
2265 using OGRGeometry::importFromWkt;
2266 OGRErr importFromWkt( const char ** ) override;
2267
2268 virtual OGRErr exportToWkt( char **, OGRwkbVariant=wkbVariantOldOgc )
2269 const override;
2270
2271 // IMultiSurface methods
2272 virtual OGRErr PointOnSurface( OGRPoint * poPoint ) const;
2273
2274 // IGeometry methods
2275 virtual int getDimension() const override;
2276
2277 // Non standard
2278 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2279 const override;
2280
2282 inline OGRGeometryCollection* toUpperClass() { return this; }
2284 inline const OGRGeometryCollection* toUpperClass() const { return this; }
2285
2286 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2287 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2288
2289 static OGRMultiPolygon* CastToMultiPolygon( OGRMultiSurface* poMS );
2290 };
2291
2293
2294 inline const OGRMultiSurface::ChildType* const * begin(const OGRMultiSurface* poGeom) { return poGeom->begin(); }
2296 inline const OGRMultiSurface::ChildType* const * end(const OGRMultiSurface* poGeom) { return poGeom->end(); }
2297
2299 inline OGRMultiSurface::ChildType** begin(OGRMultiSurface* poGeom) { return poGeom->begin(); }
2301 inline OGRMultiSurface::ChildType** end(OGRMultiSurface* poGeom) { return poGeom->end(); }
2303
2304 /************************************************************************/
2305 /* OGRMultiPolygon */
2306 /************************************************************************/
2307
2312 class CPL_DLL OGRMultiPolygon : public OGRMultiSurface
2313 {
2314 protected:
2315 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
2316 const override;
2317 friend class OGRPolyhedralSurface;
2318 friend class OGRTriangulatedSurface;
2319
2320 private:
2322 OGRErr _addGeometryWithExpectedSubGeometryType(
2323 const OGRGeometry * poNewGeom,
2324 OGRwkbGeometryType eSubGeometryType );
2325 OGRErr _addGeometryDirectlyWithExpectedSubGeometryType(
2326 OGRGeometry * poNewGeom,
2327 OGRwkbGeometryType eSubGeometryType );
2329
2330
2331 public:
2332 OGRMultiPolygon();
2333 OGRMultiPolygon( const OGRMultiPolygon& other );
2334 ~OGRMultiPolygon() override;
2335
2336 OGRMultiPolygon& operator=(const OGRMultiPolygon& other);
2337
2339 typedef OGRPolygon ChildType;
2340
2344 ChildType** begin() { return reinterpret_cast<ChildType**>(papoGeoms); }
2346 ChildType** end() { return reinterpret_cast<ChildType**>(papoGeoms + nGeomCount); }
2350 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(papoGeoms); }
2352 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(papoGeoms + nGeomCount); }
2353
2354 // Non-standard (OGRGeometry).
2355 virtual const char *getGeometryName() const override;
2356 virtual OGRwkbGeometryType getGeometryType() const override;
2357 virtual OGRErr exportToWkt( char **, OGRwkbVariant=wkbVariantOldOgc )
2358 const override;
2359
2360 // Non standard
2361 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2362 const override;
2363
2365 inline OGRGeometryCollection* toUpperClass() { return this; }
2367 inline const OGRGeometryCollection* toUpperClass() const { return this; }
2368
2369 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2370 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2371
2372 static OGRMultiSurface* CastToMultiSurface( OGRMultiPolygon* poMP );
2373 };
2374
2376
2377 inline const OGRMultiPolygon::ChildType* const * begin(const OGRMultiPolygon* poGeom) { return poGeom->begin(); }
2379 inline const OGRMultiPolygon::ChildType* const * end(const OGRMultiPolygon* poGeom) { return poGeom->end(); }
2380
2382 inline OGRMultiPolygon::ChildType** begin(OGRMultiPolygon* poGeom) { return poGeom->begin(); }
2384 inline OGRMultiPolygon::ChildType** end(OGRMultiPolygon* poGeom) { return poGeom->end(); }
2386
2387 /************************************************************************/
2388 /* OGRPolyhedralSurface */
2389 /************************************************************************/
2390
2397 class CPL_DLL OGRPolyhedralSurface : public OGRSurface
2398 {
2399 protected:
2401 friend class OGRTriangulatedSurface;
2402 OGRMultiPolygon oMP{};
2403 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
2404 const override;
2405 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
2406 const override;
2407 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType ) const;
2408 virtual const char* getSubGeometryName() const;
2409 virtual OGRwkbGeometryType getSubGeometryType() const;
2410 OGRErr exportToWktInternal (char ** ppszDstText, OGRwkbVariant eWkbVariant,
2411 const char* pszSkipPrefix ) const;
2412
2413 virtual OGRPolyhedralSurfaceCastToMultiPolygon GetCasterToMultiPolygon()
2414 const;
2415 static OGRMultiPolygon* CastToMultiPolygonImpl(OGRPolyhedralSurface* poPS);
2417
2418 public:
2419 OGRPolyhedralSurface();
2420 OGRPolyhedralSurface( const OGRPolyhedralSurface &poGeom );
2421 ~OGRPolyhedralSurface() override;
2422 OGRPolyhedralSurface& operator=(const OGRPolyhedralSurface& other);
2423
2425 typedef OGRPolygon ChildType;
2426
2430 ChildType** begin() { return oMP.begin(); }
2432 ChildType** end() { return oMP.end(); }
2436 const ChildType* const* begin() const { return oMP.begin(); }
2438 const ChildType* const* end() const { return oMP.end(); }
2439
2440 // IWks Interface.
2441 virtual int WkbSize() const override;
2442 virtual const char *getGeometryName() const override;
2443 virtual OGRwkbGeometryType getGeometryType() const override;
2444 virtual OGRErr importFromWkb( const unsigned char *,
2445 int,
2446 OGRwkbVariant,
2447 int& nBytesConsumedOut ) override;
2448 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
2449 OGRwkbVariant=wkbVariantOldOgc )
2450 const override;
2451 using OGRGeometry::importFromWkt;
2452 OGRErr importFromWkt( const char ** ) override;
2453 virtual OGRErr exportToWkt( char ** ppszDstText,
2454 OGRwkbVariant=wkbVariantOldOgc )
2455 const override;
2456
2457 // IGeometry methods.
2458 virtual int getDimension() const override;
2459
2460 virtual void empty() override;
2461
2462 virtual OGRGeometry *clone() const override;
2463 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
2464 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
2465
2466 virtual void flattenTo2D() override;
2467 virtual OGRErr transform( OGRCoordinateTransformation* ) override;
2468 virtual OGRBoolean Equals( const OGRGeometry* ) const override;
2469 virtual double get_Area() const override;
2470 virtual OGRErr PointOnSurface( OGRPoint* ) const override;
2471
2472 static OGRMultiPolygon* CastToMultiPolygon( OGRPolyhedralSurface* poPS );
2473 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2474 const override;
2475 virtual OGRErr addGeometry( const OGRGeometry * );
2476 OGRErr addGeometryDirectly( OGRGeometry *poNewGeom );
2477 int getNumGeometries() const;
2478 OGRGeometry* getGeometryRef(int i);
2479 const OGRGeometry* getGeometryRef(int i) const;
2480
2481 virtual OGRBoolean IsEmpty() const override;
2482 virtual void setCoordinateDimension( int nDimension ) override;
2483 virtual void set3D( OGRBoolean bIs3D ) override;
2484 virtual void setMeasured( OGRBoolean bIsMeasured ) override;
2485 virtual void swapXY() override;
2486 OGRErr removeGeometry( int iIndex, int bDelete = TRUE );
2487
2488 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2489 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2490
2491 virtual void assignSpatialReference( OGRSpatialReference * poSR ) override;
2492 };
2493
2495
2496 inline const OGRPolyhedralSurface::ChildType* const * begin(const OGRPolyhedralSurface* poGeom) { return poGeom->begin(); }
2498 inline const OGRPolyhedralSurface::ChildType* const * end(const OGRPolyhedralSurface* poGeom) { return poGeom->end(); }
2499
2501 inline OGRPolyhedralSurface::ChildType** begin(OGRPolyhedralSurface* poGeom) { return poGeom->begin(); }
2503 inline OGRPolyhedralSurface::ChildType** end(OGRPolyhedralSurface* poGeom) { return poGeom->end(); }
2505
2506 /************************************************************************/
2507 /* OGRTriangulatedSurface */
2508 /************************************************************************/
2509
2516 class CPL_DLL OGRTriangulatedSurface : public OGRPolyhedralSurface
2517 {
2518 protected:
2520 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
2521 const override;
2522 virtual const char* getSubGeometryName() const override;
2523 virtual OGRwkbGeometryType getSubGeometryType() const override;
2524
2525 virtual OGRPolyhedralSurfaceCastToMultiPolygon GetCasterToMultiPolygon()
2526 const override;
2527 static OGRMultiPolygon *
2528 CastToMultiPolygonImpl( OGRPolyhedralSurface* poPS );
2530
2531 public:
2532 OGRTriangulatedSurface();
2533 OGRTriangulatedSurface( const OGRTriangulatedSurface &other );
2534 ~OGRTriangulatedSurface();
2535
2537 typedef OGRTriangle ChildType;
2538
2542 ChildType** begin() { return reinterpret_cast<ChildType**>(oMP.begin()); }
2544 ChildType** end() { return reinterpret_cast<ChildType**>(oMP.end()); }
2548 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(oMP.begin()); }
2550 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(oMP.end()); }
2551
2552 OGRTriangulatedSurface& operator=( const OGRTriangulatedSurface& other );
2553 virtual const char *getGeometryName() const override;
2554 virtual OGRwkbGeometryType getGeometryType() const override;
2555
2556 // IWks Interface.
2557 virtual OGRErr addGeometry( const OGRGeometry * ) override;
2558
2560 inline OGRPolyhedralSurface* toUpperClass() { return this; }
2562 inline const OGRPolyhedralSurface* toUpperClass() const { return this; }
2563
2564 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2565 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2566
2567 static OGRPolyhedralSurface *
2568 CastToPolyhedralSurface( OGRTriangulatedSurface* poTS );
2569 };
2570
2572
2573 inline const OGRTriangulatedSurface::ChildType* const * begin(const OGRTriangulatedSurface* poGeom) { return poGeom->begin(); }
2575 inline const OGRTriangulatedSurface::ChildType* const * end(const OGRTriangulatedSurface* poGeom) { return poGeom->end(); }
2576
2578 inline OGRTriangulatedSurface::ChildType** begin(OGRTriangulatedSurface* poGeom) { return poGeom->begin(); }
2580 inline OGRTriangulatedSurface::ChildType** end(OGRTriangulatedSurface* poGeom) { return poGeom->end(); }
2582
2583 /************************************************************************/
2584 /* OGRMultiPoint */
2585 /************************************************************************/
2586
2591 class CPL_DLL OGRMultiPoint : public OGRGeometryCollection
2592 {
2593 private:
2594 OGRErr importFromWkt_Bracketed( const char **, int bHasM, int bHasZ );
2595
2596 protected:
2597 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
2598 const override;
2599
2600 public:
2601 OGRMultiPoint();
2602 OGRMultiPoint(const OGRMultiPoint& other);
2603 ~OGRMultiPoint() override;
2604
2605 OGRMultiPoint& operator=(const OGRMultiPoint& other);
2606
2608 typedef OGRPoint ChildType;
2609
2613 ChildType** begin() { return reinterpret_cast<ChildType**>(papoGeoms); }
2615 ChildType** end() { return reinterpret_cast<ChildType**>(papoGeoms + nGeomCount); }
2619 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(papoGeoms); }
2621 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(papoGeoms + nGeomCount); }
2622
2623 // Non-standard (OGRGeometry).
2624 virtual const char *getGeometryName() const override;
2625 virtual OGRwkbGeometryType getGeometryType() const override;
2626 using OGRGeometry::importFromWkt;
2627 OGRErr importFromWkt( const char ** ) override;
2628 virtual OGRErr exportToWkt( char **, OGRwkbVariant=wkbVariantOldOgc )
2629 const override;
2630
2631 // IGeometry methods.
2632 virtual int getDimension() const override;
2633
2635 inline OGRGeometryCollection* toUpperClass() { return this; }
2637 inline const OGRGeometryCollection* toUpperClass() const { return this; }
2638
2639 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2640 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2641
2642 // Non-standard.
2643 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2644 const override;
2645 };
2646
2648
2649 inline const OGRMultiPoint::ChildType* const * begin(const OGRMultiPoint* poGeom) { return poGeom->begin(); }
2651 inline const OGRMultiPoint::ChildType* const * end(const OGRMultiPoint* poGeom) { return poGeom->end(); }
2652
2654 inline OGRMultiPoint::ChildType** begin(OGRMultiPoint* poGeom) { return poGeom->begin(); }
2656 inline OGRMultiPoint::ChildType** end(OGRMultiPoint* poGeom) { return poGeom->end(); }
2658
2659 /************************************************************************/
2660 /* OGRMultiCurve */
2661 /************************************************************************/
2662
2669 class CPL_DLL OGRMultiCurve : public OGRGeometryCollection
2670 {
2671 protected:
2673 static OGRErr addCurveDirectlyFromWkt( OGRGeometry* poSelf,
2674 OGRCurve* poCurve );
2676 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
2677 const override;
2678
2679 public:
2680 OGRMultiCurve();
2681 OGRMultiCurve( const OGRMultiCurve& other );
2682 ~OGRMultiCurve() override;
2683
2684 OGRMultiCurve& operator=( const OGRMultiCurve& other );
2685
2687 typedef OGRCurve ChildType;
2688
2692 ChildType** begin() { return reinterpret_cast<ChildType**>(papoGeoms); }
2694 ChildType** end() { return reinterpret_cast<ChildType**>(papoGeoms + nGeomCount); }
2698 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(papoGeoms); }
2700 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(papoGeoms + nGeomCount); }
2701
2702 // Non standard (OGRGeometry).
2703 virtual const char *getGeometryName() const override;
2704 virtual OGRwkbGeometryType getGeometryType() const override;
2705 using OGRGeometry::importFromWkt;
2706 OGRErr importFromWkt( const char ** ) override;
2707 virtual OGRErr exportToWkt( char **, OGRwkbVariant=wkbVariantOldOgc )
2708 const override;
2709
2710 // IGeometry methods.
2711 virtual int getDimension() const override;
2712
2713 // Non-standard.
2714 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2715 const override;
2716
2718 inline OGRGeometryCollection* toUpperClass() { return this; }
2720 inline const OGRGeometryCollection* toUpperClass() const { return this; }
2721
2722 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2723 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2724
2725 static OGRMultiLineString* CastToMultiLineString(OGRMultiCurve* poMC);
2726 };
2727
2729
2730 inline const OGRMultiCurve::ChildType* const * begin(const OGRMultiCurve* poGeom) { return poGeom->begin(); }
2732 inline const OGRMultiCurve::ChildType* const * end(const OGRMultiCurve* poGeom) { return poGeom->end(); }
2733
2735 inline OGRMultiCurve::ChildType** begin(OGRMultiCurve* poGeom) { return poGeom->begin(); }
2737 inline OGRMultiCurve::ChildType** end(OGRMultiCurve* poGeom) { return poGeom->end(); }
2739
2740 /************************************************************************/
2741 /* OGRMultiLineString */
2742 /************************************************************************/
2743
2748 class CPL_DLL OGRMultiLineString : public OGRMultiCurve
2749 {
2750 protected:
2751 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
2752 const override;
2753
2754 public:
2755 OGRMultiLineString();
2756 OGRMultiLineString( const OGRMultiLineString& other );
2757 ~OGRMultiLineString() override;
2758
2759 OGRMultiLineString& operator=( const OGRMultiLineString& other );
2760
2762 typedef OGRLineString ChildType;
2763
2767 ChildType** begin() { return reinterpret_cast<ChildType**>(papoGeoms); }
2769 ChildType** end() { return reinterpret_cast<ChildType**>(papoGeoms + nGeomCount); }
2773 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(papoGeoms); }
2775 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(papoGeoms + nGeomCount); }
2776
2777 // Non standard (OGRGeometry).
2778 virtual const char *getGeometryName() const override;
2779 virtual OGRwkbGeometryType getGeometryType() const override;
2780 virtual OGRErr exportToWkt( char **, OGRwkbVariant=wkbVariantOldOgc )
2781 const override;
2782
2783 // Non standard
2784 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2785 const override;
2786
2788 inline OGRGeometryCollection* toUpperClass() { return this; }
2790 inline const OGRGeometryCollection* toUpperClass() const { return this; }
2791
2792 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2793 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2794
2795 static OGRMultiCurve* CastToMultiCurve( OGRMultiLineString* poMLS );
2796 };
2797
2799
2800 inline const OGRMultiLineString::ChildType* const * begin(const OGRMultiLineString* poGeom) { return poGeom->begin(); }
2802 inline const OGRMultiLineString::ChildType* const * end(const OGRMultiLineString* poGeom) { return poGeom->end(); }
2803
2805 inline OGRMultiLineString::ChildType** begin(OGRMultiLineString* poGeom) { return poGeom->begin(); }
2807 inline OGRMultiLineString::ChildType** end(OGRMultiLineString* poGeom) { return poGeom->end(); }
2809
2810 /************************************************************************/
2811 /* OGRGeometryFactory */
2812 /************************************************************************/
2813
2818 class CPL_DLL OGRGeometryFactory
2819 {
2820 static OGRErr createFromFgfInternal( const unsigned char *pabyData,
2821 OGRSpatialReference * poSR,
2822 OGRGeometry **ppoReturn,
2823 int nBytes,
2824 int *pnBytesConsumed,
2825 int nRecLevel );
2826 public:
2827 static OGRErr createFromWkb( const void *, OGRSpatialReference *,
2828 OGRGeometry **, int = -1,
2829 OGRwkbVariant=wkbVariantOldOgc );
2830 static OGRErr createFromWkb( const void * pabyData,
2831 OGRSpatialReference *,
2832 OGRGeometry **,
2833 int nSize,
2834 OGRwkbVariant eVariant,
2835 int& nBytesConsumedOut );
2836 static OGRErr createFromWkt( const char* , OGRSpatialReference *,
2837 OGRGeometry ** );
2838 static OGRErr createFromWkt( const char **, OGRSpatialReference *,
2839 OGRGeometry ** );
2843 static OGRErr createFromWkt( char ** ppszInput, OGRSpatialReference * poSRS,
2844 OGRGeometry ** ppoGeom )
2845 CPL_WARN_DEPRECATED("Use createFromWkt(const char**, ...) instead")
2846 {
2847 return createFromWkt( const_cast<const char**>(ppszInput), poSRS, ppoGeom);
2848 }
2849
2850 static OGRErr createFromFgf( const void*, OGRSpatialReference *,
2851 OGRGeometry **, int = -1, int * = nullptr );
2852 static OGRGeometry *createFromGML( const char * );
2853 static OGRGeometry *createFromGEOS( GEOSContextHandle_t hGEOSCtxt,
2854 GEOSGeom );
2855 static OGRGeometry *createFromGeoJson( const char *);
2856 static OGRGeometry *createFromGeoJson( const CPLJSONObject &oJSONObject );
2857
2858 static void destroyGeometry( OGRGeometry * );
2859 static OGRGeometry *createGeometry( OGRwkbGeometryType );
2860
2861 static OGRGeometry * forceToPolygon( OGRGeometry * );
2862 static OGRGeometry * forceToLineString( OGRGeometry *,
2863 bool bOnlyInOrder = true );
2864 static OGRGeometry * forceToMultiPolygon( OGRGeometry * );
2865 static OGRGeometry * forceToMultiPoint( OGRGeometry * );
2866 static OGRGeometry * forceToMultiLineString( OGRGeometry * );
2867
2868 static OGRGeometry * forceTo( OGRGeometry* poGeom,
2869 OGRwkbGeometryType eTargetType,
2870 const char*const* papszOptions = nullptr );
2871
2872 static OGRGeometry * organizePolygons( OGRGeometry **papoPolygons,
2873 int nPolygonCount,
2874 int *pbResultValidGeometry,
2875 const char **papszOptions = nullptr);
2876 static bool haveGEOS();
2877
2879 class TransformWithOptionsCache
2880 {
2881 friend class OGRGeometryFactory;
2882 struct Private;
2883 std::unique_ptr<Private> d;
2884
2885 public:
2886 TransformWithOptionsCache();
2887 ~TransformWithOptionsCache();
2888 };
2889
2890 static OGRGeometry* transformWithOptions( const OGRGeometry* poSrcGeom,
2891 OGRCoordinateTransformation *poCT,
2892 char** papszOptions,
2893 const TransformWithOptionsCache& cache = TransformWithOptionsCache() );
2894
2895 static OGRGeometry*
2896 approximateArcAngles( double dfX, double dfY, double dfZ,
2897 double dfPrimaryRadius, double dfSecondaryAxis,
2898 double dfRotation,
2899 double dfStartAngle, double dfEndAngle,
2900 double dfMaxAngleStepSizeDegrees );
2901
2902 static int GetCurveParmeters( double x0, double y0,
2903 double x1, double y1,
2904 double x2, double y2,
2905 double& R, double& cx, double& cy,
2906 double& alpha0, double& alpha1,
2907 double& alpha2 );
2908 static OGRLineString* curveToLineString(
2909 double x0, double y0, double z0,
2910 double x1, double y1, double z1,
2911 double x2, double y2, double z2,
2912 int bHasZ,
2913 double dfMaxAngleStepSizeDegrees,
2914 const char* const * papszOptions = nullptr );
2915 static OGRCurve* curveFromLineString(
2916 const OGRLineString* poLS,
2917 const char* const * papszOptions = nullptr);
2918 };
2919
2920 OGRwkbGeometryType CPL_DLL OGRFromOGCGeomType( const char *pszGeomType );
2921 const char CPL_DLL * OGRToOGCGeomType( OGRwkbGeometryType eGeomType );
2922
2924 typedef struct _OGRPreparedGeometry OGRPreparedGeometry;
2925 int OGRHasPreparedGeometrySupport();
2926 OGRPreparedGeometry* OGRCreatePreparedGeometry( const OGRGeometry* poGeom );
2927 void OGRDestroyPreparedGeometry( OGRPreparedGeometry* poPreparedGeom );
2928 int OGRPreparedGeometryIntersects( const OGRPreparedGeometry* poPreparedGeom,
2929 const OGRGeometry* poOtherGeom );
2930 int OGRPreparedGeometryContains( const OGRPreparedGeometry* poPreparedGeom,
2931 const OGRGeometry* poOtherGeom );
2932
2934 struct CPL_DLL OGRPreparedGeometryUniquePtrDeleter
2935 {
2936 void operator()(OGRPreparedGeometry*) const;
2937 };
2939
2943 typedef std::unique_ptr<OGRPreparedGeometry, OGRPreparedGeometryUniquePtrDeleter> OGRPreparedGeometryUniquePtr;
2944
2945 #endif /* ndef OGR_GEOMETRY_H_INCLUDED */
OGRCurve::toSimpleCurve
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:1007
OGRCompoundCurve::begin
const ChildType *const * begin() const
Return begin of curve iterator.
Definition: ogr_geometry.h:1631
OGRGeometry::toMultiPoint
OGRMultiPoint * toMultiPoint()
Down-cast to OGRMultiPoint*.
Definition: ogr_geometry.h:692
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:1103
OGRPolyhedralSurface::~OGRPolyhedralSurface
~OGRPolyhedralSurface() override
Destructor.
OGRGeometry::closeRings
virtual void closeRings()
Force rings to be closed.
Definition: ogrgeometry.cpp:5045
OGRGeometry::getGeometryType
virtual OGRwkbGeometryType getGeometryType() const =0
Fetch geometry type.
OGRGeometry::toPolygon
const OGRPolygon * toPolygon() const
Down-cast to OGRPolygon*.
Definition: ogr_geometry.h:643
OGRGeometry::toTriangle
const OGRTriangle * toTriangle() const
Down-cast to OGRTriangle*.
Definition: ogr_geometry.h:657
OGRMultiPoint::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2613
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:2139
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:1839
OGRGeometry::Is3D
OGRBoolean Is3D() const
Definition: ogr_geometry.h:363
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:2720
OGRGeometry::toMultiLineString
OGRMultiLineString * toMultiLineString()
Down-cast to OGRMultiLineString*.
Definition: ogr_geometry.h:706
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:573
OGRCircularString::toUpperClass
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:1461
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:2489
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:1800
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:1242
OGRMultiPoint::ChildType
OGRPoint ChildType
Type of child elements.
Definition: ogr_geometry.h:2608
OGRGeometry::toCompoundCurve
OGRCompoundCurve * toCompoundCurve()
Down-cast to OGRCompoundCurve*.
Definition: ogr_geometry.h:608
OGRGeometry::toMultiPolygon
const OGRMultiPolygon * toMultiPolygon() const
Down-cast to OGRMultiPolygon*.
Definition: ogr_geometry.h:727
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:511
OGRLineString::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1286
OGRPoint::getY
double getY() const
Return y.
Definition: ogr_geometry.h:855
OGRCurvePolygon::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1883
OGRGeometry::swapXY
virtual void swapXY()
Swap x and y coordinates.
Definition: ogrgeometry.cpp:5735
OGRSimpleCurve::transform
virtual OGRErr transform(OGRCoordinateTransformation *poCT) override
Apply arbitrary coordinate transformation to geometry.
Definition: ogrlinestring.cpp:2383
OGRLineString::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1287
OGRGeometry::toCurve
OGRCurve * toCurve()
Down-cast to OGRCurve*.
Definition: ogr_geometry.h:538
OGRGeometryFactory
Create geometry objects from well known text/binary.
Definition: ogr_geometry.h:2818
OGRPolyhedralSurface::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2438
OGRGeometry::toMultiPolygon
OGRMultiPolygon * toMultiPolygon()
Down-cast to OGRMultiPolygon*.
Definition: ogr_geometry.h:720
OGRMultiLineString::toUpperClass
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2790
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:1365
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:1622
OGRMultiLineString::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2767
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:629
OGRMultiLineString::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2769
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:1463
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:2488
OGRGeometry::toMultiSurface
OGRMultiSurface * toMultiSurface()
Down-cast to OGRMultiSurface*.
Definition: ogr_geometry.h:748
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
OGRGeometryFactory::TransformWithOptionsCache
Opaque class used as argument to transformWithOptions()
Definition: ogr_geometry.h:2879
OGRGeometry::FromHandle
static OGRGeometry * FromHandle(OGRGeometryH hGeom)
Convert a OGRGeometryH to a OGRGeometry*.
Definition: ogr_geometry.h:517
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:1807
OGRMultiSurface::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2286
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:4835
OGRMultiPolygon::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2369
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:1957
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:1813
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:776
OGRPoint::getM
double getM() const
Return m.
Definition: ogr_geometry.h:859
OGRCircularString::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1464
OGRTriangle::toUpperClass
const OGRPolygon * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2075
OGRGeometryCollection::begin
const ChildType *const * begin() const
Return begin of sub-geometry iterator.
Definition: ogr_geometry.h:2137
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:2258
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:783
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:2247
OGRPolygon::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:1951
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:2312
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:524
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:5783
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:1362
OGRMultiLineString::begin
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2773
OGRCircularString
Concrete representation of a circular string, that is to say a curve made of one or several arc circl...
Definition: ogr_geometry.h:1396
OGRMultiCurve::ChildType
OGRCurve ChildType
Type of child elements.
Definition: ogr_geometry.h:2687
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:926
OGRGeometryCollection
A collection of 1 or more geometry objects.
Definition: ogr_geometry.h:2096
OGRMultiCurve::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2723
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:1360
OGRLinearRing
Concrete representation of a closed ring.
Definition: ogr_geometry.h:1314
OGRPoint::setM
void setM(double mIn)
Set m.
Definition: ogr_geometry.h:879
OGRCurvePolygon::begin
ChildType ** begin()
Return begin of curve iterator.
Definition: ogr_geometry.h:1805
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:1937
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:2537
OGRGeometry::toCircularString
OGRCircularString * toCircularString()
Down-cast to OGRCircularString*.
Definition: ogr_geometry.h:594
OGRGeometryFactory::createFromWkt
static OGRErr createFromWkt(char **ppszInput, OGRSpatialReference *poSRS, OGRGeometry **ppoGeom)
Deprecated.
Definition: ogr_geometry.h:2843
OGRPolygon::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:1959
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:2254
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:141
OGRPolygon::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:1953
OGRTriangulatedSurface::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2564
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:2637
OGRMultiCurve::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2694
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:2436
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:755
OGRMultiLineString::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2775
OGRMultiCurve::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2692
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:622
OGRMultiSurface
A collection of non-overlapping OGRSurface.
Definition: ogr_geometry.h:2233
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:2768
OGRGeometry::toSimpleCurve
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:552
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:1627
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:2698
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:2562
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:114
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:2762
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:1720
OGRTriangulatedSurface::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2550
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:877
OGRCompoundCurve
Utility class to store a collection of curves.
Definition: ogr_geometry.h:1581
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:2560
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:2565
OGRPolygon::toUpperClass
OGRCurvePolygon * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2004
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:2204
OGRCompoundCurve::begin
ChildType ** begin()
Return begin of curve iterator.
Definition: ogr_geometry.h:1625
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:908
OGRTriangulatedSurface
TriangulatedSurface class.
Definition: ogr_geometry.h:2516
OGRMultiPoint::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2639
OGRMultiCurve
A collection of OGRCurve.
Definition: ogr_geometry.h:2669
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:2205
OGRSurface
Abstract base class for 2 dimensional objects like polygons or curve polygons.
Definition: ogr_geometry.h:1728
IOGRConstGeometryVisitor
OGRGeometry visitor interface.
Definition: ogr_geometry.h:191
OGRMultiLineString
A collection of OGRLineString.
Definition: ogr_geometry.h:2748
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:664
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:2287
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:2788
OGRPoint::getZ
double getZ() const
Return z.
Definition: ogr_geometry.h:857
OGRGeometry::toMultiCurve
OGRMultiCurve * toMultiCurve()
Down-cast to OGRMultiCurve*.
Definition: ogr_geometry.h:734
OGRGeometry::toPolyhedralSurface
OGRPolyhedralSurface * toPolyhedralSurface()
Down-cast to OGRPolyhedralSurface*.
Definition: ogr_geometry.h:762
OGRMultiPoint::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2640
OGRPoint::setX
void setX(double xIn)
Set x.
Definition: ogr_geometry.h:866
OGRGeometry::IsMeasured
OGRBoolean IsMeasured() const
Definition: ogr_geometry.h:365
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:2542
OGRPolygon::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2008
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:1811
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:587
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:5839
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:1159
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:2738
OGRMultiPolygon::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2344
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:650
OGRPoint::setZ
void setZ(double zIn)
Set z.
Definition: ogr_geometry.h:874
OGRPolyhedralSurface::removeGeometry
OGRErr removeGeometry(int iIndex, int bDelete=TRUE)
Remove a geometry from the container.
Definition: ogrpolyhedralsurface.cpp:1068
OGRCurve::ChildType
OGRPoint ChildType
Type of child elements.
Definition: ogr_geometry.h:969
OGRSurface::PointOnSurface
virtual OGRErr PointOnSurface(OGRPoint *poPoint) const
This method relates to the SFCOM ISurface::get_PointOnSurface() method.
Definition: ogr_geometry.h:1738
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:2133
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:1364
OGRGeometry::toLineString
OGRLineString * toLineString()
Down-cast to OGRLineString*.
Definition: ogr_geometry.h:566
OGRPreparedGeometryIntersects
int OGRPreparedGeometryIntersects(const OGRPreparedGeometry *poPreparedGeom, const OGRGeometry *poOtherGeom)
Returns whether a prepared geometry intersects with a geometry.
Definition: ogrgeometry.cpp:5861
OGRCurvePolygon
Concrete class representing curve polygons.
Definition: ogr_geometry.h:1763
OGRGeometry::toLinearRing
OGRLinearRing * toLinearRing()
Down-cast to OGRLinearRing*.
Definition: ogr_geometry.h:580
OGRMultiPoint::begin
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2619
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:2280
OGRTriangle::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2078
OGRPolyhedralSurface
PolyhedralSurface class.
Definition: ogr_geometry.h:2397
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:2718
cpl_conv.h
Various convenience functions for CPL.
OGRPoint::setY
void setY(double yIn)
Set y.
Definition: ogr_geometry.h:870
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:156
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:2635
OGRGeometry::toCurve
const OGRCurve * toCurve() const
Down-cast to OGRCurve*.
Definition: ogr_geometry.h:545
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:1620
OGRPreparedGeometry
struct _OGRPreparedGeometry OGRPreparedGeometry
Prepared geometry API (needs GEOS >= 3.1.0)
Definition: ogr_geometry.h:2924
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:1284
OGRMultiSurface::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2252
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:2284
OGRMultiSurface::toUpperClass
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2282
OGRGeometryUniquePtr
std::unique_ptr< OGRGeometry, OGRGeometryUniquePtrDeleter > OGRGeometryUniquePtr
Unique pointer type for OGRGeometry.
Definition: ogr_geometry.h:798
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:5803
OGRMultiPolygon::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2352
OGRPolygon::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2009
OGRPoint::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:893
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:531
OGRPolyhedralSurface::addGeometry
virtual OGRErr addGeometry(const OGRGeometry *)
Add a new geometry to a collection.
Definition: ogrpolyhedralsurface.cpp:841
OGRCurvePolygon::addRingDirectly
virtual OGRErr addRingDirectly(OGRCurve *)
Add a ring to a polygon.
Definition: ogrcurvepolygon.cpp:419
OGRPoint
Point class.
Definition: ogr_geometry.h:810
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:2792
OGRTriangulatedSurface::begin
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2548
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:848
OGRPolygon::ChildType
OGRLinearRing ChildType
Type of child elements.
Definition: ogr_geometry.h:1946
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:741
OGRSimpleCurve::segmentize
virtual void segmentize(double dfMaxLength) override
Modify the geometry such it has no segment longer then the given distance.
Definition: ogrlinestring.cpp:2504
OGRMultiPolygon::toUpperClass
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2365
OGRMultiPolygon::toUpperClass
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2367
OGRCurve::toSimpleCurve
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:1002
OGRPoint::getX
double getX() const
Return x.
Definition: ogr_geometry.h:853
OGRGeometry::toPolygon
OGRPolygon * toPolygon()
Down-cast to OGRPolygon*.
Definition: ogr_geometry.h:636
OGRPolygon
Concrete class representing polygons.
Definition: ogr_geometry.h:1913
OGRSimpleCurve
Abstract curve base class for OGRLineString and OGRCircularString.
Definition: ogr_geometry.h:1035
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:678
OGRGeometryCollection::ChildType
OGRGeometry ChildType
Type of child elements.
Definition: ogr_geometry.h:2126
OGRGeometry::toCurvePolygon
const OGRCurvePolygon * toCurvePolygon() const
Down-cast to OGRCurvePolygon*.
Definition: ogr_geometry.h:671
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:4909
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:713
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:1161
OGRCoordinateTransformation
Interface for transforming between coordinate systems.
Definition: ogr_spatialref.h:683
OGRLineString::toUpperClass
OGRSimpleCurve * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:1282
OGRSimpleCurve::WkbSize
virtual int WkbSize() const override
Returns size of related binary representation.
Definition: ogrlinestring.cpp:208
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:2339
OGRPolyhedralSurface::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2432
OGRPolyhedralSurface::CastToMultiPolygon
static OGRMultiPolygon * CastToMultiPolygon(OGRPolyhedralSurface *poPS)
Casts the OGRPolyhedralSurface to an OGRMultiPolygon.
Definition: ogrpolyhedralsurface.cpp:820
OGRMultiPolygon::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2346
OGRCircularString::toUpperClass
OGRSimpleCurve * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:1459
OGRPreparedGeometryUniquePtr
std::unique_ptr< OGRPreparedGeometry, OGRPreparedGeometryUniquePtrDeleter > OGRPreparedGeometryUniquePtr
Unique pointer type for OGRPreparedGeometry.
Definition: ogr_geometry.h:2943
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:909
OGRTriangle::toUpperClass
OGRPolygon * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2073
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:5891
OGRPoint::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:892
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:699
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:1701
OGRTriangle
Triangle class.
Definition: ogr_geometry.h:2036
OGRMultiCurve::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2700
OGRPolyhedralSurface::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2430
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:2425
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:2006
OGRSimpleCurve::Value
virtual void Value(double, OGRPoint *) const override
Fetch point at given distance along curve.
Definition: ogrlinestring.cpp:1979
OGRMultiPoint::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2615
OGRGeometry::toSimpleCurve
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:559
OGRMultiLineString::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2793
OGRGeometry::toGeometryCollection
const OGRGeometryCollection * toGeometryCollection() const
Down-cast to OGRGeometryCollection*.
Definition: ogr_geometry.h:685
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:769
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:2260
OGRMultiPoint
A collection of OGRPoint.
Definition: ogr_geometry.h:2591
OGRGeometry::toCompoundCurve
const OGRCompoundCurve * toCompoundCurve() const
Down-cast to OGRCompoundCurve*.
Definition: ogr_geometry.h:615
OGRCurvePolygon::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1882
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:1633
OGRMultiPolygon::begin
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2350
OGRMultiPolygon::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2370
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:2131
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:601
OGRCompoundCurve::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1702
OGRTriangulatedSurface::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2544
OGRSimpleCurve::importFromWkb
virtual OGRErr importFromWkb(const unsigned char *, int, OGRwkbVariant, int &nBytesConsumedOut) override
Assign geometry from well known binary data.
Definition: ogrlinestring.cpp:1506
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:2722
OGRMultiPoint::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2621
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:939
OGRPolyhedralSurface::getGeometryRef
OGRGeometry * getGeometryRef(int i)
Fetch geometry from container.
Definition: ogrpolyhedralsurface.cpp:931
OGRTriangle::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2077
OGRSimpleCurve::getY
double getY(int i) const
Get Y at vertex.
Definition: ogr_geometry.h:1162
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.