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 spatialys.com>
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
59 enum class OGRWktFormat
61 {
62 F,
63 G,
64 Default
65 };
66
68 struct OGRWktOptions
69 {
70 public:
72 OGRwkbVariant variant;
74 int precision;
76 bool round;
78 OGRWktFormat format;
79
81 OGRWktOptions() : variant(wkbVariantOldOgc), precision(15), round(true),
82 format(OGRWktFormat::Default)
83 {
84 static int defPrecision = getDefaultPrecision();
85 static bool defRound = getDefaultRound();
86
87 precision = defPrecision;
88 round = defRound;
89 }
90
92 OGRWktOptions(const OGRWktOptions&) = default;
93
94 private:
95 static int getDefaultPrecision();
96 static bool getDefaultRound();
97 };
98
102 class OGRRawPoint
103 {
104 public:
106 OGRRawPoint() : x(0.0), y(0.0) {}
107
109 OGRRawPoint(double xIn, double yIn) : x(xIn), y(yIn) {}
110
112 double x;
114 double y;
115 };
116
118 typedef struct GEOSGeom_t *GEOSGeom;
120 typedef struct GEOSContextHandle_HS *GEOSContextHandle_t;
122 typedef void sfcgal_geometry_t;
123
124 class OGRPoint;
125 class OGRCurve;
126 class OGRCompoundCurve;
127 class OGRSimpleCurve;
128 class OGRLinearRing;
129 class OGRLineString;
130 class OGRCircularString;
131 class OGRSurface;
132 class OGRCurvePolygon;
133 class OGRPolygon;
134 class OGRMultiPoint;
135 class OGRMultiSurface;
136 class OGRMultiPolygon;
137 class OGRMultiCurve;
138 class OGRMultiLineString;
139 class OGRGeometryCollection;
140 class OGRTriangle;
141 class OGRPolyhedralSurface;
142 class OGRTriangulatedSurface;
143
145 typedef OGRLineString* (*OGRCurveCasterToLineString)(OGRCurve*);
146 typedef OGRLinearRing* (*OGRCurveCasterToLinearRing)(OGRCurve*);
147
148 typedef OGRPolygon* (*OGRSurfaceCasterToPolygon)(OGRSurface*);
149 typedef OGRCurvePolygon* (*OGRSurfaceCasterToCurvePolygon)(OGRSurface*);
150 typedef OGRMultiPolygon* (*OGRPolyhedralSurfaceCastToMultiPolygon)(OGRPolyhedralSurface*);
152
156 class CPL_DLL IOGRGeometryVisitor
157 {
158 public:
160 virtual ~IOGRGeometryVisitor() = default;
161
163 virtual void visit(OGRPoint*) = 0;
165 virtual void visit(OGRLineString*) = 0;
167 virtual void visit(OGRLinearRing*) = 0;
169 virtual void visit(OGRPolygon*) = 0;
171 virtual void visit(OGRMultiPoint*) = 0;
173 virtual void visit(OGRMultiLineString*) = 0;
175 virtual void visit(OGRMultiPolygon*) = 0;
177 virtual void visit(OGRGeometryCollection*) = 0;
179 virtual void visit(OGRCircularString*) = 0;
181 virtual void visit(OGRCompoundCurve*) = 0;
183 virtual void visit(OGRCurvePolygon*) = 0;
185 virtual void visit(OGRMultiCurve*) = 0;
187 virtual void visit(OGRMultiSurface*) = 0;
189 virtual void visit(OGRTriangle*) = 0;
191 virtual void visit(OGRPolyhedralSurface*) = 0;
193 virtual void visit(OGRTriangulatedSurface*) = 0;
194 };
195
203 class CPL_DLL OGRDefaultGeometryVisitor: public IOGRGeometryVisitor
204 {
205 void _visit(OGRSimpleCurve* poGeom);
206
207 public:
208
209 void visit(OGRPoint*) override {}
210 void visit(OGRLineString*) override;
211 void visit(OGRLinearRing*) override;
212 void visit(OGRPolygon*) override;
213 void visit(OGRMultiPoint*) override;
214 void visit(OGRMultiLineString*) override;
215 void visit(OGRMultiPolygon*) override;
216 void visit(OGRGeometryCollection*) override;
217 void visit(OGRCircularString*) override;
218 void visit(OGRCompoundCurve*) override;
219 void visit(OGRCurvePolygon*) override;
220 void visit(OGRMultiCurve*) override;
221 void visit(OGRMultiSurface*) override;
222 void visit(OGRTriangle*) override;
223 void visit(OGRPolyhedralSurface*) override;
224 void visit(OGRTriangulatedSurface*) override;
225 };
226
230 class CPL_DLL IOGRConstGeometryVisitor
231 {
232 public:
234 virtual ~IOGRConstGeometryVisitor() = default;
235
237 virtual void visit(const OGRPoint*) = 0;
239 virtual void visit(const OGRLineString*) = 0;
241 virtual void visit(const OGRLinearRing*) = 0;
243 virtual void visit(const OGRPolygon*) = 0;
245 virtual void visit(const OGRMultiPoint*) = 0;
247 virtual void visit(const OGRMultiLineString*) = 0;
249 virtual void visit(const OGRMultiPolygon*) = 0;
251 virtual void visit(const OGRGeometryCollection*) = 0;
253 virtual void visit(const OGRCircularString*) = 0;
255 virtual void visit(const OGRCompoundCurve*) = 0;
257 virtual void visit(const OGRCurvePolygon*) = 0;
259 virtual void visit(const OGRMultiCurve*) = 0;
261 virtual void visit(const OGRMultiSurface*) = 0;
263 virtual void visit(const OGRTriangle*) = 0;
265 virtual void visit(const OGRPolyhedralSurface*) = 0;
267 virtual void visit(const OGRTriangulatedSurface*) = 0;
268 };
269
277 class CPL_DLL OGRDefaultConstGeometryVisitor: public IOGRConstGeometryVisitor
278 {
279 void _visit(const OGRSimpleCurve* poGeom);
280
281 public:
282
283 void visit(const OGRPoint*) override {}
284 void visit(const OGRLineString*) override;
285 void visit(const OGRLinearRing*) override;
286 void visit(const OGRPolygon*) override;
287 void visit(const OGRMultiPoint*) override;
288 void visit(const OGRMultiLineString*) override;
289 void visit(const OGRMultiPolygon*) override;
290 void visit(const OGRGeometryCollection*) override;
291 void visit(const OGRCircularString*) override;
292 void visit(const OGRCompoundCurve*) override;
293 void visit(const OGRCurvePolygon*) override;
294 void visit(const OGRMultiCurve*) override;
295 void visit(const OGRMultiSurface*) override;
296 void visit(const OGRTriangle*) override;
297 void visit(const OGRPolyhedralSurface*) override;
298 void visit(const OGRTriangulatedSurface*) override;
299 };
300
301 /************************************************************************/
302 /* OGRGeometry */
303 /************************************************************************/
304
325 class CPL_DLL OGRGeometry
326 {
327 private:
328 OGRSpatialReference * poSRS = nullptr; // may be NULL
329
330 protected:
332 friend class OGRCurveCollection;
333
334 unsigned int flags = 0;
335
336 OGRErr importPreambleFromWkt( const char ** ppszInput,
337 int* pbHasZ, int* pbHasM,
338 bool* pbIsEmpty );
339 OGRErr importCurveCollectionFromWkt(
340 const char ** ppszInput,
341 int bAllowEmptyComponent,
342 int bAllowLineString,
343 int bAllowCurve,
344 int bAllowCompoundCurve,
345 OGRErr (*pfnAddCurveDirectly)(OGRGeometry* poSelf,
346 OGRCurve* poCurve) );
347 OGRErr importPreambleFromWkb( const unsigned char * pabyData,
348 int nSize,
349 OGRwkbByteOrder& eByteOrder,
350 OGRwkbVariant eWkbVariant );
351 OGRErr importPreambleOfCollectionFromWkb(
352 const unsigned char * pabyData,
353 int& nSize,
354 int& nDataOffset,
355 OGRwkbByteOrder& eByteOrder,
356 int nMinSubGeomSize,
357 int& nGeomCount,
358 OGRwkbVariant eWkbVariant );
359 OGRErr PointOnSurfaceInternal( OGRPoint * poPoint ) const;
360 OGRBoolean IsSFCGALCompatible() const;
361
362 void HomogenizeDimensionalityWith( OGRGeometry* poOtherGeom );
363 std::string wktTypeString(OGRwkbVariant variant) const;
364
366
367 public:
368
369 /************************************************************************/
370 /* Bit flags for OGRGeometry */
371 /* The OGR_G_NOT_EMPTY_POINT is used *only* for points. */
372 /* Do not use these outside of the core. */
373 /* Use Is3D, IsMeasured, set3D, and setMeasured instead */
374 /************************************************************************/
375
377 static const unsigned int OGR_G_NOT_EMPTY_POINT = 0x1;
378 static const unsigned int OGR_G_3D = 0x2;
379 static const unsigned int OGR_G_MEASURED = 0x4;
381
382 OGRGeometry();
383 OGRGeometry( const OGRGeometry& other );
384 virtual ~OGRGeometry();
385
386 OGRGeometry& operator=( const OGRGeometry& other );
387
389 bool operator==( const OGRGeometry& other ) const { return CPL_TO_BOOL(Equals(&other)); }
390
392 bool operator!=( const OGRGeometry& other ) const { return !CPL_TO_BOOL(Equals(&other)); }
393
394 // Standard IGeometry.
395 virtual int getDimension() const = 0;
396 virtual int getCoordinateDimension() const;
397 int CoordinateDimension() const;
398 virtual OGRBoolean IsEmpty() const = 0;
399 virtual OGRBoolean IsValid() const;
400 virtual OGRGeometry* MakeValid() const;
401 virtual OGRBoolean IsSimple() const;
403 OGRBoolean Is3D() const { return flags & OGR_G_3D; }
405 OGRBoolean IsMeasured() const { return flags & OGR_G_MEASURED; }
406 virtual OGRBoolean IsRing() const;
407 virtual void empty() = 0;
408 virtual OGRGeometry *clone() const CPL_WARN_UNUSED_RESULT = 0;
409 virtual void getEnvelope( OGREnvelope * psEnvelope ) const = 0;
410 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const = 0;
411
412 // IWks Interface.
413 virtual int WkbSize() const = 0;
414 OGRErr importFromWkb( const GByte*, int=-1,
415 OGRwkbVariant=wkbVariantOldOgc );
416 virtual OGRErr importFromWkb( const unsigned char *,
417 int,
418 OGRwkbVariant,
419 int& nBytesConsumedOut ) = 0;
420 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
421 OGRwkbVariant=wkbVariantOldOgc ) const = 0;
422 virtual OGRErr importFromWkt( const char ** ppszInput ) = 0;
423
427 OGRErr importFromWkt( char ** ppszInput ) CPL_WARN_DEPRECATED("Use importFromWkt(const char**) instead")
428 {
429 return importFromWkt( const_cast<const char**>(ppszInput) );
430 }
431
432 OGRErr exportToWkt( char ** ppszDstText,
433 OGRwkbVariant=wkbVariantOldOgc ) const;
434
439 virtual std::string exportToWkt(const OGRWktOptions& opts = OGRWktOptions(),
440 OGRErr *err = nullptr) const = 0;
441
442 // Non-standard.
443 virtual OGRwkbGeometryType getGeometryType() const = 0;
444 OGRwkbGeometryType getIsoGeometryType() const;
445 virtual const char *getGeometryName() const = 0;
446 virtual void dumpReadable( FILE *, const char * = nullptr
447 , char** papszOptions = nullptr ) const;
448 virtual void flattenTo2D() = 0;
449 virtual char * exportToGML( const char* const * papszOptions = nullptr ) const;
450 virtual char * exportToKML() const;
451 virtual char * exportToJson() const;
452
454 virtual void accept(IOGRGeometryVisitor* visitor) = 0;
455
457 virtual void accept(IOGRConstGeometryVisitor* visitor) const = 0;
458
459 static GEOSContextHandle_t createGEOSContext();
460 static void freeGEOSContext( GEOSContextHandle_t hGEOSCtxt );
461 virtual GEOSGeom exportToGEOS( GEOSContextHandle_t hGEOSCtxt )
462 const CPL_WARN_UNUSED_RESULT;
463 virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear = FALSE) const;
464 virtual OGRGeometry* getCurveGeometry(
465 const char* const* papszOptions = nullptr ) const CPL_WARN_UNUSED_RESULT;
466 virtual OGRGeometry* getLinearGeometry(
467 double dfMaxAngleStepSizeDegrees = 0,
468 const char* const* papszOptions = nullptr ) const CPL_WARN_UNUSED_RESULT;
469
470 // SFCGAL interfacing methods.
472 static sfcgal_geometry_t* OGRexportToSFCGAL( const OGRGeometry *poGeom );
473 static OGRGeometry* SFCGALexportToOGR( const sfcgal_geometry_t* _geometry );
475 virtual void closeRings();
476
477 virtual void setCoordinateDimension( int nDimension );
478 virtual void set3D( OGRBoolean bIs3D );
479 virtual void setMeasured( OGRBoolean bIsMeasured );
480
481 virtual void assignSpatialReference( OGRSpatialReference * poSR );
482 OGRSpatialReference *getSpatialReference( void ) const { return poSRS; }
483
484 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) = 0;
485 OGRErr transformTo( OGRSpatialReference *poSR );
486
487 virtual void segmentize(double dfMaxLength);
488
489 // ISpatialRelation
490 virtual OGRBoolean Intersects( const OGRGeometry * ) const;
491 virtual OGRBoolean Equals( const OGRGeometry * ) const = 0;
492 virtual OGRBoolean Disjoint( const OGRGeometry * ) const;
493 virtual OGRBoolean Touches( const OGRGeometry * ) const;
494 virtual OGRBoolean Crosses( const OGRGeometry * ) const;
495 virtual OGRBoolean Within( const OGRGeometry * ) const;
496 virtual OGRBoolean Contains( const OGRGeometry * ) const;
497 virtual OGRBoolean Overlaps( const OGRGeometry * ) const;
498 // virtual OGRBoolean Relate( const OGRGeometry *, const char * ) const;
499 // virtual OGRGeometry *LocateAlong( double mValue ) const;
500 // virtual OGRGeometry *LocateBetween( double mStart, double mEnd ) const;
501
502 virtual OGRGeometry *Boundary() const CPL_WARN_UNUSED_RESULT;
503 virtual double Distance( const OGRGeometry * ) const ;
504 virtual OGRGeometry *ConvexHull() const CPL_WARN_UNUSED_RESULT;
505 virtual OGRGeometry *Buffer( double dfDist, int nQuadSegs = 30 )
506 const CPL_WARN_UNUSED_RESULT;
507 virtual OGRGeometry *Intersection( const OGRGeometry *)
508 const CPL_WARN_UNUSED_RESULT;
509 virtual OGRGeometry *Union( const OGRGeometry * )
510 const CPL_WARN_UNUSED_RESULT;
511 virtual OGRGeometry *UnionCascaded() const CPL_WARN_UNUSED_RESULT;
512 virtual OGRGeometry *Difference( const OGRGeometry * )
513 const CPL_WARN_UNUSED_RESULT;
514 virtual OGRGeometry *SymDifference( const OGRGeometry * )
515 const CPL_WARN_UNUSED_RESULT;
516 virtual OGRErr Centroid( OGRPoint * poPoint ) const;
517 virtual OGRGeometry *Simplify(double dTolerance)
518 const CPL_WARN_UNUSED_RESULT;
519 OGRGeometry *SimplifyPreserveTopology(double dTolerance)
520 const CPL_WARN_UNUSED_RESULT;
521 virtual OGRGeometry *DelaunayTriangulation(
522 double dfTolerance, int bOnlyEdges ) const CPL_WARN_UNUSED_RESULT;
523
524 virtual OGRGeometry *Polygonize() const CPL_WARN_UNUSED_RESULT;
525
526 virtual double Distance3D( const OGRGeometry *poOtherGeom ) const;
527
529 // backward compatibility to non-standard method names.
530 OGRBoolean Intersect( OGRGeometry * )
531 const CPL_WARN_DEPRECATED("Non standard method. "
532 "Use Intersects() instead");
533 OGRBoolean Equal( OGRGeometry * )
534 const CPL_WARN_DEPRECATED("Non standard method. "
535 "Use Equals() instead");
536 OGRGeometry *SymmetricDifference( const OGRGeometry * )
537 const CPL_WARN_DEPRECATED("Non standard method. "
538 "Use SymDifference() instead");
539 OGRGeometry *getBoundary()
540 const CPL_WARN_DEPRECATED("Non standard method. "
541 "Use Boundary() instead");
543
545 // Special HACK for DB2 7.2 support
546 static int bGenerate_DB2_V72_BYTE_ORDER;
548
549 virtual void swapXY();
551 static OGRGeometry* CastToIdentity( OGRGeometry* poGeom ) { return poGeom; }
552 static OGRGeometry* CastToError( OGRGeometry* poGeom );
554
558 static inline OGRGeometryH ToHandle(OGRGeometry* poGeom)
559 { return reinterpret_cast<OGRGeometryH>(poGeom); }
560
564 static inline OGRGeometry* FromHandle(OGRGeometryH hGeom)
565 { return reinterpret_cast<OGRGeometry*>(hGeom); }
566
571 inline OGRPoint* toPoint()
572 { return cpl::down_cast<OGRPoint*>(this); }
573
578 inline const OGRPoint* toPoint() const
579 { return cpl::down_cast<const OGRPoint*>(this); }
580
585 inline OGRCurve* toCurve()
586 { return cpl::down_cast<OGRCurve*>(this); }
587
592 inline const OGRCurve* toCurve() const
593 { return cpl::down_cast<const OGRCurve*>(this); }
594
599 inline OGRSimpleCurve* toSimpleCurve()
600 { return cpl::down_cast<OGRSimpleCurve*>(this); }
601
606 inline const OGRSimpleCurve* toSimpleCurve() const
607 { return cpl::down_cast<const OGRSimpleCurve*>(this); }
608
613 inline OGRLineString* toLineString()
614 { return cpl::down_cast<OGRLineString*>(this); }
615
620 inline const OGRLineString* toLineString() const
621 { return cpl::down_cast<const OGRLineString*>(this); }
622
627 inline OGRLinearRing* toLinearRing()
628 { return cpl::down_cast<OGRLinearRing*>(this); }
629
634 inline const OGRLinearRing* toLinearRing() const
635 { return cpl::down_cast<const OGRLinearRing*>(this); }
636
641 inline OGRCircularString* toCircularString()
642 { return cpl::down_cast<OGRCircularString*>(this); }
643
648 inline const OGRCircularString* toCircularString() const
649 { return cpl::down_cast<const OGRCircularString*>(this); }
650
655 inline OGRCompoundCurve* toCompoundCurve()
656 { return cpl::down_cast<OGRCompoundCurve*>(this); }
657
662 inline const OGRCompoundCurve* toCompoundCurve() const
663 { return cpl::down_cast<const OGRCompoundCurve*>(this); }
664
669 inline OGRSurface* toSurface()
670 { return cpl::down_cast<OGRSurface*>(this); }
671
676 inline const OGRSurface* toSurface() const
677 { return cpl::down_cast<const OGRSurface*>(this); }
678
683 inline OGRPolygon* toPolygon()
684 { return cpl::down_cast<OGRPolygon*>(this); }
685
690 inline const OGRPolygon* toPolygon() const
691 { return cpl::down_cast<const OGRPolygon*>(this); }
692
697 inline OGRTriangle* toTriangle()
698 { return cpl::down_cast<OGRTriangle*>(this); }
699
704 inline const OGRTriangle* toTriangle() const
705 { return cpl::down_cast<const OGRTriangle*>(this); }
706
711 inline OGRCurvePolygon* toCurvePolygon()
712 { return cpl::down_cast<OGRCurvePolygon*>(this); }
713
718 inline const OGRCurvePolygon* toCurvePolygon() const
719 { return cpl::down_cast<const OGRCurvePolygon*>(this); }
720
725 inline OGRGeometryCollection* toGeometryCollection()
726 { return cpl::down_cast<OGRGeometryCollection*>(this); }
727
732 inline const OGRGeometryCollection* toGeometryCollection() const
733 { return cpl::down_cast<const OGRGeometryCollection*>(this); }
734
739 inline OGRMultiPoint* toMultiPoint()
740 { return cpl::down_cast<OGRMultiPoint*>(this); }
741
746 inline const OGRMultiPoint* toMultiPoint() const
747 { return cpl::down_cast<const OGRMultiPoint*>(this); }
748
753 inline OGRMultiLineString* toMultiLineString()
754 { return cpl::down_cast<OGRMultiLineString*>(this); }
755
760 inline const OGRMultiLineString* toMultiLineString() const
761 { return cpl::down_cast<const OGRMultiLineString*>(this); }
762
767 inline OGRMultiPolygon* toMultiPolygon()
768 { return cpl::down_cast<OGRMultiPolygon*>(this); }
769
774 inline const OGRMultiPolygon* toMultiPolygon() const
775 { return cpl::down_cast<const OGRMultiPolygon*>(this); }
776
781 inline OGRMultiCurve* toMultiCurve()
782 { return cpl::down_cast<OGRMultiCurve*>(this); }
783
788 inline const OGRMultiCurve* toMultiCurve() const
789 { return cpl::down_cast<const OGRMultiCurve*>(this); }
790
795 inline OGRMultiSurface* toMultiSurface()
796 { return cpl::down_cast<OGRMultiSurface*>(this); }
797
802 inline const OGRMultiSurface* toMultiSurface() const
803 { return cpl::down_cast<const OGRMultiSurface*>(this); }
804
809 inline OGRPolyhedralSurface* toPolyhedralSurface()
810 { return cpl::down_cast<OGRPolyhedralSurface*>(this); }
811
816 inline const OGRPolyhedralSurface* toPolyhedralSurface() const
817 { return cpl::down_cast<const OGRPolyhedralSurface*>(this); }
818
823 inline OGRTriangulatedSurface* toTriangulatedSurface()
824 { return cpl::down_cast<OGRTriangulatedSurface*>(this); }
825
830 inline const OGRTriangulatedSurface* toTriangulatedSurface() const
831 { return cpl::down_cast<const OGRTriangulatedSurface*>(this); }
832
833 };
834
836 struct CPL_DLL OGRGeometryUniquePtrDeleter
837 {
838 void operator()(OGRGeometry*) const;
839 };
841
845 typedef std::unique_ptr<OGRGeometry, OGRGeometryUniquePtrDeleter> OGRGeometryUniquePtr;
846
847 /************************************************************************/
848 /* OGRPoint */
849 /************************************************************************/
850
857 class CPL_DLL OGRPoint : public OGRGeometry
858 {
859 double x;
860 double y;
861 double z;
862 double m;
863
864 public:
865 OGRPoint();
866 OGRPoint( double x, double y );
867 OGRPoint( double x, double y, double z );
868 OGRPoint( double x, double y, double z, double m );
869 OGRPoint( const OGRPoint& other );
870 static OGRPoint* createXYM( double x, double y, double m );
871 ~OGRPoint() override;
872
873 OGRPoint& operator=( const OGRPoint& other );
874
875 // IWks Interface
876 int WkbSize() const override;
877 OGRErr importFromWkb( const unsigned char *,
878 int,
879 OGRwkbVariant,
880 int& nBytesConsumedOut ) override;
881 OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
882 OGRwkbVariant=wkbVariantOldOgc )
883 const override;
884 using OGRGeometry::importFromWkt;
885 OGRErr importFromWkt( const char ** ) override;
886 using OGRGeometry::exportToWkt;
887
892 virtual std::string exportToWkt(const OGRWktOptions& opts = OGRWktOptions(),
893 OGRErr *err = nullptr) const override;
894
895 // IGeometry
896 virtual int getDimension() const override;
897 virtual OGRGeometry *clone() const override;
898 virtual void empty() override;
899 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
900 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
901 virtual OGRBoolean IsEmpty() const override
902 { return !(flags & OGR_G_NOT_EMPTY_POINT); }
903
904 // IPoint
906 double getX() const { return x; }
908 double getY() const { return y; }
910 double getZ() const { return z; }
912 double getM() const { return m; }
913
914 // Non standard
915 virtual void setCoordinateDimension( int nDimension ) override;
919 void setX( double xIn ) { x = xIn; flags |= OGR_G_NOT_EMPTY_POINT; }
923 void setY( double yIn ) { y = yIn; flags |= OGR_G_NOT_EMPTY_POINT; }
927 void setZ( double zIn )
928 { z = zIn; flags |= (OGR_G_NOT_EMPTY_POINT | OGR_G_3D); }
932 void setM( double mIn )
933 { m = mIn; flags |= (OGR_G_NOT_EMPTY_POINT | OGR_G_MEASURED); }
934
935 // ISpatialRelation
936 virtual OGRBoolean Equals( const OGRGeometry * ) const override;
937 virtual OGRBoolean Intersects( const OGRGeometry * ) const override;
938 virtual OGRBoolean Within( const OGRGeometry * ) const override;
939
940 // Non standard from OGRGeometry
941 virtual const char *getGeometryName() const override;
942 virtual OGRwkbGeometryType getGeometryType() const override;
943 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) override;
944 virtual void flattenTo2D() override;
945 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
946 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
947
948 virtual void swapXY() override;
949 };
950
951 /************************************************************************/
952 /* OGRPointIterator */
953 /************************************************************************/
954
961 class CPL_DLL OGRPointIterator
962 {
963 public:
964 virtual ~OGRPointIterator();
965 virtual OGRBoolean getNextPoint( OGRPoint* p ) = 0;
966
967 static void destroy( OGRPointIterator* );
968 };
969
970 /************************************************************************/
971 /* OGRCurve */
972 /************************************************************************/
973
979 class CPL_DLL OGRCurve : public OGRGeometry
980 {
981 protected:
983 OGRCurve();
984 OGRCurve( const OGRCurve& other );
985
986 virtual OGRCurveCasterToLineString GetCasterToLineString() const = 0;
987 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing() const = 0;
988
989 friend class OGRCurvePolygon;
990 friend class OGRCompoundCurve;
992 virtual int ContainsPoint( const OGRPoint* p ) const;
993 virtual int IntersectsPoint( const OGRPoint* p ) const;
994 virtual double get_AreaOfCurveSegments() const = 0;
995
996 private:
997
998 class CPL_DLL ConstIterator
999 {
1000 struct Private;
1001 std::unique_ptr<Private> m_poPrivate;
1002 public:
1003 ConstIterator(const OGRCurve* poSelf, bool bStart);
1004 ConstIterator(ConstIterator&& oOther) noexcept; // declared but not defined. Needed for gcc 5.4 at least
1005 ~ConstIterator();
1006 const OGRPoint& operator*() const;
1007 ConstIterator& operator++();
1008 bool operator!=(const ConstIterator& it) const;
1009 };
1010
1011 friend inline ConstIterator begin(const OGRCurve*);
1012 friend inline ConstIterator end(const OGRCurve*);
1013
1014 public:
1015 ~OGRCurve() override;
1016
1018 OGRCurve& operator=( const OGRCurve& other );
1020
1022 typedef OGRPoint ChildType;
1023
1032 ConstIterator begin() const;
1034 ConstIterator end() const;
1035
1036 // ICurve methods
1037 virtual double get_Length() const = 0;
1038 virtual void StartPoint( OGRPoint * ) const = 0;
1039 virtual void EndPoint( OGRPoint * ) const = 0;
1040 virtual int get_IsClosed() const;
1041 virtual void Value( double, OGRPoint * ) const = 0;
1042 virtual OGRLineString* CurveToLine( double dfMaxAngleStepSizeDegrees = 0,
1043 const char* const* papszOptions = nullptr)
1044 const = 0;
1045 virtual int getDimension() const override;
1046
1047 // non standard
1048 virtual int getNumPoints() const = 0;
1049 virtual OGRPointIterator* getPointIterator() const = 0;
1050 virtual OGRBoolean IsConvex() const;
1051 virtual double get_Area() const = 0;
1052
1055 inline OGRSimpleCurve* toSimpleCurve()
1056 { return cpl::down_cast<OGRSimpleCurve*>(this); }
1057
1060 inline const OGRSimpleCurve* toSimpleCurve() const
1061 { return cpl::down_cast<const OGRSimpleCurve*>(this); }
1062
1063 static OGRCompoundCurve* CastToCompoundCurve( OGRCurve* puCurve );
1064 static OGRLineString* CastToLineString( OGRCurve* poCurve );
1065 static OGRLinearRing* CastToLinearRing( OGRCurve* poCurve );
1066 };
1067
1069
1070 inline OGRCurve::ConstIterator begin(const OGRCurve* poCurve) { return poCurve->begin(); }
1072 inline OGRCurve::ConstIterator end(const OGRCurve* poCurve) { return poCurve->end(); }
1074
1075 /************************************************************************/
1076 /* OGRSimpleCurve */
1077 /************************************************************************/
1078
1088 class CPL_DLL OGRSimpleCurve: public OGRCurve
1089 {
1090 protected:
1092 friend class OGRGeometry;
1093
1094 int nPointCount;
1095 OGRRawPoint *paoPoints;
1096 double *padfZ;
1097 double *padfM;
1098
1099 void Make3D();
1100 void Make2D();
1101 void RemoveM();
1102 void AddM();
1103
1104 OGRErr importFromWKTListOnly( const char ** ppszInput, int bHasZ, int bHasM,
1105 OGRRawPoint*& paoPointsIn,
1106 int& nMaxPoints,
1107 double*& padfZIn );
1108
1110
1111 virtual double get_LinearArea() const;
1112
1113 OGRSimpleCurve();
1114 OGRSimpleCurve( const OGRSimpleCurve& other );
1115
1116 private:
1117 class CPL_DLL Iterator
1118 {
1119 struct Private;
1120 std::unique_ptr<Private> m_poPrivate;
1121 void update();
1122 public:
1123 Iterator(OGRSimpleCurve* poSelf, int nPos);
1124 Iterator(Iterator&& oOther) noexcept; // declared but not defined. Needed for gcc 5.4 at least
1125 ~Iterator();
1126 OGRPoint& operator*();
1127 Iterator& operator++();
1128 bool operator!=(const Iterator& it) const;
1129 };
1130
1131 friend inline Iterator begin(OGRSimpleCurve*);
1132 friend inline Iterator end(OGRSimpleCurve*);
1133
1134 class CPL_DLL ConstIterator
1135 {
1136 struct Private;
1137 std::unique_ptr<Private> m_poPrivate;
1138 public:
1139 ConstIterator(const OGRSimpleCurve* poSelf, int nPos);
1140 ConstIterator(ConstIterator&& oOther) noexcept; // declared but not defined. Needed for gcc 5.4 at least
1141 ~ConstIterator();
1142 const OGRPoint& operator*() const;
1143 ConstIterator& operator++();
1144 bool operator!=(const ConstIterator& it) const;
1145 };
1146
1147 friend inline ConstIterator begin(const OGRSimpleCurve*);
1148 friend inline ConstIterator end(const OGRSimpleCurve*);
1149
1150 public:
1151 ~OGRSimpleCurve() override;
1152
1153 OGRSimpleCurve& operator=( const OGRSimpleCurve& other );
1154
1156 typedef OGRPoint ChildType;
1157
1166 Iterator begin();
1168 Iterator end();
1177 ConstIterator begin() const;
1179 ConstIterator end() const;
1180
1181 // IWks Interface.
1182 virtual int WkbSize() const override;
1183 virtual OGRErr importFromWkb( const unsigned char *,
1184 int,
1185 OGRwkbVariant,
1186 int& nBytesConsumedOut ) override;
1187 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1188 OGRwkbVariant=wkbVariantOldOgc )
1189 const override;
1190 using OGRGeometry::importFromWkt;
1191 OGRErr importFromWkt( const char ** ) override;
1192 using OGRGeometry::exportToWkt;
1193
1198 virtual std::string exportToWkt(const OGRWktOptions& opts = OGRWktOptions(),
1199 OGRErr *err = nullptr) const override;
1200
1201 // IGeometry interface.
1202 virtual OGRGeometry *clone() const override;
1203 virtual void empty() override;
1204 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
1205 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
1206 virtual OGRBoolean IsEmpty() const override;
1207
1208 // ICurve methods.
1209 virtual double get_Length() const override;
1210 virtual void StartPoint( OGRPoint * ) const override;
1211 virtual void EndPoint( OGRPoint * ) const override;
1212 virtual void Value( double, OGRPoint * ) const override;
1213 virtual double Project( const OGRPoint * ) const;
1214 virtual OGRLineString* getSubLine( double, double, int ) const;
1215
1216 // ILineString methods.
1217 virtual int getNumPoints() const override { return nPointCount; }
1218 void getPoint( int, OGRPoint * ) const;
1219 double getX( int i ) const { return paoPoints[i].x; }
1220 double getY( int i ) const { return paoPoints[i].y; }
1221 double getZ( int i ) const;
1222 double getM( int i ) const;
1223
1224 // ISpatialRelation
1225 virtual OGRBoolean Equals( const OGRGeometry * ) const override;
1226
1227 // non standard.
1228 virtual void setCoordinateDimension( int nDimension ) override;
1229 virtual void set3D( OGRBoolean bIs3D ) override;
1230 virtual void setMeasured( OGRBoolean bIsMeasured ) override;
1231 void setNumPoints( int nNewPointCount,
1232 int bZeroizeNewContent = TRUE );
1233 void setPoint( int, OGRPoint * );
1234 void setPoint( int, double, double );
1235 void setZ( int, double );
1236 void setM( int, double );
1237 void setPoint( int, double, double, double );
1238 void setPointM( int, double, double, double );
1239 void setPoint( int, double, double, double, double );
1240 void setPoints( int, const OGRRawPoint *, const double * = nullptr );
1241 void setPointsM( int, const OGRRawPoint *, const double * );
1242 void setPoints( int, const OGRRawPoint *, const double *, const double * );
1243 void setPoints( int, const double * padfX, const double * padfY,
1244 const double *padfZIn = nullptr );
1245 void setPointsM( int, const double * padfX, const double * padfY,
1246 const double *padfMIn = nullptr );
1247 void setPoints( int, const double * padfX, const double * padfY,
1248 const double *padfZIn, const double *padfMIn );
1249 void addPoint( const OGRPoint * );
1250 void addPoint( double, double );
1251 void addPoint( double, double, double );
1252 void addPointM( double, double, double );
1253 void addPoint( double, double, double, double );
1254
1255 void getPoints( OGRRawPoint *, double * = nullptr ) const;
1256 void getPoints( void* pabyX, int nXStride,
1257 void* pabyY, int nYStride,
1258 void* pabyZ = nullptr, int nZStride = 0,
1259 void* pabyM = nullptr, int nMStride = 0 ) const;
1260
1261 void addSubLineString( const OGRLineString *,
1262 int nStartVertex = 0, int nEndVertex = -1 );
1263 void reversePoints( void );
1264 virtual OGRPointIterator* getPointIterator() const override;
1265
1266 // non-standard from OGRGeometry
1267 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) override;
1268 virtual void flattenTo2D() override;
1269 virtual void segmentize(double dfMaxLength) override;
1270
1271 virtual void swapXY() override;
1272 };
1273
1275
1276 inline OGRSimpleCurve::Iterator begin(OGRSimpleCurve* poCurve) { return poCurve->begin(); }
1278 inline OGRSimpleCurve::Iterator end(OGRSimpleCurve* poCurve) { return poCurve->end(); }
1279
1281 inline OGRSimpleCurve::ConstIterator begin(const OGRSimpleCurve* poCurve) { return poCurve->begin(); }
1283 inline OGRSimpleCurve::ConstIterator end(const OGRSimpleCurve* poCurve) { return poCurve->end(); }
1285
1286 /************************************************************************/
1287 /* OGRLineString */
1288 /************************************************************************/
1289
1297 class CPL_DLL OGRLineString : public OGRSimpleCurve
1298 {
1299 // cppcheck-suppress unusedPrivateFunction
1300 static OGRLinearRing* CasterToLinearRing(OGRCurve* poCurve);
1301
1302 protected:
1304 static OGRLineString* TransferMembersAndDestroy(
1305 OGRLineString* poSrc,
1306 OGRLineString* poDst);
1307
1308 virtual OGRCurveCasterToLineString GetCasterToLineString()
1309 const override;
1310 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
1311 const override;
1312
1313 virtual double get_AreaOfCurveSegments() const override;
1315
1316 static OGRLinearRing* CastToLinearRing( OGRLineString* poLS );
1317
1318 public:
1319 OGRLineString();
1320 OGRLineString( const OGRLineString& other );
1321 ~OGRLineString() override;
1322
1323 OGRLineString& operator=(const OGRLineString& other);
1324
1325 virtual OGRLineString* CurveToLine( double dfMaxAngleStepSizeDegrees = 0,
1326 const char* const* papszOptions = nullptr )
1327 const override;
1328 virtual OGRGeometry* getCurveGeometry(
1329 const char* const* papszOptions = nullptr ) const override;
1330 virtual double get_Area() const override;
1331
1332 // Non-standard from OGRGeometry.
1333 virtual OGRwkbGeometryType getGeometryType() const override;
1334 virtual const char *getGeometryName() const override;
1335
1337 inline OGRSimpleCurve* toUpperClass() { return this; }
1339 inline const OGRSimpleCurve* toUpperClass() const { return this; }
1340
1341 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
1342 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
1343 };
1344
1345 /************************************************************************/
1346 /* OGRLinearRing */
1347 /************************************************************************/
1348
1369 class CPL_DLL OGRLinearRing : public OGRLineString
1370 {
1371 static OGRLineString* CasterToLineString( OGRCurve* poCurve );
1372
1373 protected:
1375 friend class OGRPolygon;
1376 friend class OGRTriangle;
1377
1378 // These are not IWks compatible ... just a convenience for OGRPolygon.
1379 virtual int _WkbSize( int _flags ) const;
1380 virtual OGRErr _importFromWkb( OGRwkbByteOrder, int _flags,
1381 const unsigned char *, int,
1382 int& nBytesConsumedOut );
1383 virtual OGRErr _exportToWkb( OGRwkbByteOrder, int _flags,
1384 unsigned char * ) const;
1385
1386 virtual OGRCurveCasterToLineString GetCasterToLineString()
1387 const override;
1388 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
1389 const override;
1391
1392 static OGRLineString* CastToLineString( OGRLinearRing* poLR );
1393
1394 public:
1395 OGRLinearRing();
1396 OGRLinearRing( const OGRLinearRing& other );
1397 explicit OGRLinearRing( OGRLinearRing * );
1398 ~OGRLinearRing() override;
1399
1400 OGRLinearRing& operator=( const OGRLinearRing& other );
1401
1402 // Non standard.
1403 virtual const char *getGeometryName() const override;
1404 virtual OGRGeometry *clone() const override;
1405 virtual int isClockwise() const;
1406 virtual void reverseWindingOrder();
1407 virtual void closeRings() override;
1408 OGRBoolean isPointInRing( const OGRPoint* pt,
1409 int bTestEnvelope = TRUE ) const;
1410 OGRBoolean isPointOnRingBoundary( const OGRPoint* pt,
1411 int bTestEnvelope = TRUE ) const;
1412 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) override;
1413
1415 inline OGRLineString* toUpperClass() { return this; }
1417 inline const OGRLineString* toUpperClass() const { return this; }
1418
1419 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
1420 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
1421
1422 // IWks Interface - Note this isn't really a first class object
1423 // for the purposes of WKB form. These methods always fail since this
1424 // object can't be serialized on its own.
1425 virtual int WkbSize() const override;
1426 virtual OGRErr importFromWkb( const unsigned char *,
1427 int,
1428 OGRwkbVariant,
1429 int& nBytesConsumedOut ) override;
1430 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1431 OGRwkbVariant=wkbVariantOldOgc )
1432 const override;
1433 };
1434
1435 /************************************************************************/
1436 /* OGRCircularString */
1437 /************************************************************************/
1438
1451 class CPL_DLL OGRCircularString : public OGRSimpleCurve
1452 {
1453 private:
1454 void ExtendEnvelopeWithCircular( OGREnvelope * psEnvelope ) const;
1455 OGRBoolean IsValidFast() const;
1456 int IsFullCircle( double& cx, double& cy, double& square_R ) const;
1457
1458 protected:
1460 virtual OGRCurveCasterToLineString GetCasterToLineString()
1461 const override;
1462 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
1463 const override;
1464 virtual int IntersectsPoint( const OGRPoint* p ) const override;
1465 virtual int ContainsPoint( const OGRPoint* p ) const override;
1466 virtual double get_AreaOfCurveSegments() const override;
1468
1469 public:
1470 OGRCircularString();
1471 OGRCircularString( const OGRCircularString& other );
1472 ~OGRCircularString() override;
1473
1474 OGRCircularString& operator=(const OGRCircularString& other);
1475
1476 // IWks Interface.
1477 virtual OGRErr importFromWkb( const unsigned char *,
1478 int,
1479 OGRwkbVariant,
1480 int& nBytesConsumedOut ) override;
1481 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1482 OGRwkbVariant=wkbVariantOldOgc )
1483 const override;
1484 using OGRGeometry::importFromWkt;
1485 OGRErr importFromWkt( const char ** ) override;
1486 using OGRGeometry::exportToWkt;
1487
1492 virtual std::string exportToWkt(const OGRWktOptions& opts = OGRWktOptions(),
1493 OGRErr *err = nullptr) const override;
1494
1495 // IGeometry interface.
1496 virtual OGRBoolean IsValid() const override;
1497 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
1498 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
1499
1500 // ICurve methods.
1501 virtual double get_Length() const override;
1502 virtual OGRLineString* CurveToLine( double dfMaxAngleStepSizeDegrees = 0,
1503 const char* const* papszOptions = nullptr )
1504 const override;
1505 virtual void Value( double, OGRPoint * ) const override;
1506 virtual double get_Area() const override;
1507
1508 // Non-standard from OGRGeometry.
1509 virtual OGRwkbGeometryType getGeometryType() const override;
1510 virtual const char *getGeometryName() const override;
1511 virtual void segmentize( double dfMaxLength ) override;
1512 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
1513 const override;
1514 virtual OGRGeometry* getLinearGeometry(
1515 double dfMaxAngleStepSizeDegrees = 0,
1516 const char* const* papszOptions = nullptr) const override;
1517
1519 inline OGRSimpleCurve* toUpperClass() { return this; }
1521 inline const OGRSimpleCurve* toUpperClass() const { return this; }
1522
1523 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
1524 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
1525 };
1526
1527 /************************************************************************/
1528 /* OGRCurveCollection */
1529 /************************************************************************/
1530
1541 class CPL_DLL OGRCurveCollection
1543 {
1544 protected:
1545 friend class OGRCompoundCurve;
1546 friend class OGRCurvePolygon;
1547 friend class OGRPolygon;
1548 friend class OGRTriangle;
1549
1550 int nCurveCount = 0;
1551 OGRCurve **papoCurves = nullptr;
1552
1553 public:
1554 OGRCurveCollection();
1555 OGRCurveCollection(const OGRCurveCollection& other);
1556 ~OGRCurveCollection();
1557
1558 OGRCurveCollection& operator=(const OGRCurveCollection& other);
1559
1561 typedef OGRCurve ChildType;
1562
1566 OGRCurve** begin() { return papoCurves; }
1568 OGRCurve** end() { return papoCurves + nCurveCount; }
1572 const OGRCurve* const* begin() const { return papoCurves; }
1574 const OGRCurve* const* end() const { return papoCurves + nCurveCount; }
1575
1576 void empty(OGRGeometry* poGeom);
1577 OGRBoolean IsEmpty() const;
1578 void getEnvelope( OGREnvelope * psEnvelope ) const;
1579 void getEnvelope( OGREnvelope3D * psEnvelope ) const;
1580
1581 OGRErr addCurveDirectly( OGRGeometry* poGeom, OGRCurve* poCurve,
1582 int bNeedRealloc );
1583 int WkbSize() const;
1584 OGRErr importPreambleFromWkb( OGRGeometry* poGeom,
1585 const unsigned char * pabyData,
1586 int& nSize,
1587 int& nDataOffset,
1588 OGRwkbByteOrder& eByteOrder,
1589 int nMinSubGeomSize,
1590 OGRwkbVariant eWkbVariant );
1591 OGRErr importBodyFromWkb(
1592 OGRGeometry* poGeom,
1593 const unsigned char * pabyData,
1594 int nSize,
1595 int bAcceptCompoundCurve,
1596 OGRErr (*pfnAddCurveDirectlyFromWkb)( OGRGeometry* poGeom,
1597 OGRCurve* poCurve ),
1598 OGRwkbVariant eWkbVariant,
1599 int& nBytesConsumedOut );
1600 std::string exportToWkt(const OGRGeometry *geom, const OGRWktOptions& opts,
1601 OGRErr *err) const;
1602 OGRErr exportToWkb( const OGRGeometry* poGeom, OGRwkbByteOrder,
1603 unsigned char *,
1604 OGRwkbVariant eWkbVariant ) const;
1605 OGRBoolean Equals(const OGRCurveCollection *poOCC) const;
1606 void setCoordinateDimension( OGRGeometry* poGeom,
1607 int nNewDimension );
1608 void set3D( OGRGeometry* poGeom, OGRBoolean bIs3D );
1609 void setMeasured( OGRGeometry* poGeom, OGRBoolean bIsMeasured );
1610 void assignSpatialReference( OGRGeometry* poGeom, OGRSpatialReference * poSR );
1611 int getNumCurves() const;
1612 OGRCurve *getCurve( int );
1613 const OGRCurve *getCurve( int ) const;
1614 OGRCurve *stealCurve( int );
1615
1616 OGRErr removeCurve( int iIndex, bool bDelete = true );
1617
1618 OGRErr transform( OGRGeometry* poGeom,
1619 OGRCoordinateTransformation *poCT );
1620 void flattenTo2D( OGRGeometry* poGeom );
1621 void segmentize( double dfMaxLength );
1622 void swapXY();
1623 OGRBoolean hasCurveGeometry(int bLookForNonLinear) const;
1624 };
1626
1627 /************************************************************************/
1628 /* OGRCompoundCurve */
1629 /************************************************************************/
1630
1641 class CPL_DLL OGRCompoundCurve : public OGRCurve
1642 {
1643 private:
1644 OGRCurveCollection oCC{};
1645
1646 OGRErr addCurveDirectlyInternal( OGRCurve* poCurve,
1647 double dfToleranceEps,
1648 int bNeedRealloc );
1649 static OGRErr addCurveDirectlyFromWkt( OGRGeometry* poSelf,
1650 OGRCurve* poCurve );
1651 static OGRErr addCurveDirectlyFromWkb( OGRGeometry* poSelf,
1652 OGRCurve* poCurve );
1653 OGRLineString* CurveToLineInternal( double dfMaxAngleStepSizeDegrees,
1654 const char* const* papszOptions,
1655 int bIsLinearRing ) const;
1656 // cppcheck-suppress unusedPrivateFunction
1657 static OGRLineString* CasterToLineString( OGRCurve* poCurve );
1658 // cppcheck-suppress unusedPrivateFunction
1659 static OGRLinearRing* CasterToLinearRing( OGRCurve* poCurve );
1660
1661 protected:
1663 static OGRLineString* CastToLineString( OGRCompoundCurve* poCC );
1664 static OGRLinearRing* CastToLinearRing( OGRCompoundCurve* poCC );
1665
1666 virtual OGRCurveCasterToLineString GetCasterToLineString()
1667 const override;
1668 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
1669 const override;
1671
1672 public:
1673 OGRCompoundCurve();
1674 OGRCompoundCurve( const OGRCompoundCurve& other );
1675 ~OGRCompoundCurve() override;
1676
1677 OGRCompoundCurve& operator=( const OGRCompoundCurve& other );
1678
1680 typedef OGRCurve ChildType;
1681
1685 ChildType** begin() { return oCC.begin(); }
1687 ChildType** end() { return oCC.end(); }
1691 const ChildType* const * begin() const { return oCC.begin(); }
1693 const ChildType* const * end() const { return oCC.end(); }
1694
1695 // IWks Interface
1696 virtual int WkbSize() const override;
1697 virtual OGRErr importFromWkb( const unsigned char *,
1698 int,
1699 OGRwkbVariant,
1700 int& nBytesConsumedOut ) override;
1701 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1702 OGRwkbVariant=wkbVariantOldOgc )
1703 const override;
1704 using OGRGeometry::importFromWkt;
1705 OGRErr importFromWkt( const char ** ) override;
1706 using OGRGeometry::exportToWkt;
1707
1712 virtual std::string exportToWkt(const OGRWktOptions& opts = OGRWktOptions(),
1713 OGRErr *err = nullptr) const override;
1714
1715 // IGeometry interface.
1716 virtual OGRGeometry *clone() const override;
1717 virtual void empty() override;
1718 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
1719 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
1720 virtual OGRBoolean IsEmpty() const override;
1721
1722 // ICurve methods.
1723 virtual double get_Length() const override;
1724 virtual void StartPoint( OGRPoint * ) const override;
1725 virtual void EndPoint( OGRPoint * ) const override;
1726 virtual void Value( double, OGRPoint * ) const override;
1727 virtual OGRLineString* CurveToLine( double dfMaxAngleStepSizeDegrees = 0,
1728 const char* const* papszOptions = nullptr )
1729 const override;
1730
1731 virtual int getNumPoints() const override;
1732 virtual double get_AreaOfCurveSegments() const override;
1733 virtual double get_Area() const override;
1734
1735 // ISpatialRelation.
1736 virtual OGRBoolean Equals( const OGRGeometry * ) const override;
1737
1738 // ICompoundCurve method.
1739 int getNumCurves() const;
1740 OGRCurve *getCurve( int );
1741 const OGRCurve *getCurve( int ) const;
1742
1743 // Non-standard.
1744 virtual void setCoordinateDimension( int nDimension ) override;
1745 virtual void set3D( OGRBoolean bIs3D ) override;
1746 virtual void setMeasured( OGRBoolean bIsMeasured ) override;
1747
1748 virtual void assignSpatialReference( OGRSpatialReference * poSR ) override;
1749
1750 OGRErr addCurve( OGRCurve*, double dfToleranceEps = 1e-14 );
1751 OGRErr addCurveDirectly( OGRCurve*, double dfToleranceEps = 1e-14 );
1752 OGRCurve *stealCurve( int );
1753 virtual OGRPointIterator* getPointIterator() const override;
1754
1755 // Non-standard from OGRGeometry.
1756 virtual OGRwkbGeometryType getGeometryType() const override;
1757 virtual const char *getGeometryName() const override;
1758 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) override;
1759 virtual void flattenTo2D() override;
1760 virtual void segmentize(double dfMaxLength) override;
1761 virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear = FALSE)
1762 const override;
1763 virtual OGRGeometry* getLinearGeometry(
1764 double dfMaxAngleStepSizeDegrees = 0,
1765 const char* const* papszOptions = nullptr) const override;
1766 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
1767 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
1768
1769 virtual void swapXY() override;
1770 };
1771
1773
1774 inline const OGRCompoundCurve::ChildType* const * begin(const OGRCompoundCurve* poCurve) { return poCurve->begin(); }
1776 inline const OGRCompoundCurve::ChildType* const * end(const OGRCompoundCurve* poCurve) { return poCurve->end(); }
1777
1779 inline OGRCompoundCurve::ChildType** begin(OGRCompoundCurve* poCurve) { return poCurve->begin(); }
1781 inline OGRCompoundCurve::ChildType** end(OGRCompoundCurve* poCurve) { return poCurve->end(); }
1783
1784 /************************************************************************/
1785 /* OGRSurface */
1786 /************************************************************************/
1787
1793 class CPL_DLL OGRSurface : public OGRGeometry
1794 {
1795 protected:
1797 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon() const = 0;
1798 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon() const = 0;
1800
1801 public:
1802 virtual double get_Area() const = 0;
1803 virtual OGRErr PointOnSurface( OGRPoint * poPoint ) const
1804 { return PointOnSurfaceInternal(poPoint); }
1806 static OGRPolygon* CastToPolygon(OGRSurface* poSurface);
1807 static OGRCurvePolygon* CastToCurvePolygon(OGRSurface* poSurface);
1809 };
1810
1811 /************************************************************************/
1812 /* OGRCurvePolygon */
1813 /************************************************************************/
1814
1828 class CPL_DLL OGRCurvePolygon : public OGRSurface
1829 {
1830 static OGRPolygon* CasterToPolygon(OGRSurface* poSurface);
1831
1832 private:
1833 OGRBoolean IntersectsPoint( const OGRPoint* p ) const;
1834 OGRBoolean ContainsPoint( const OGRPoint* p ) const;
1835 virtual int checkRing( OGRCurve * poNewRing ) const;
1836 OGRErr addRingDirectlyInternal( OGRCurve* poCurve,
1837 int bNeedRealloc );
1838 static OGRErr addCurveDirectlyFromWkt( OGRGeometry* poSelf,
1839 OGRCurve* poCurve );
1840 static OGRErr addCurveDirectlyFromWkb( OGRGeometry* poSelf,
1841 OGRCurve* poCurve );
1842
1843 protected:
1845 friend class OGRPolygon;
1846 friend class OGRTriangle;
1847 OGRCurveCollection oCC{};
1848
1849 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
1850 const override;
1851 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
1852 const override;
1854
1855 static OGRPolygon* CastToPolygon( OGRCurvePolygon* poCP );
1856
1857 public:
1858 OGRCurvePolygon();
1859 OGRCurvePolygon( const OGRCurvePolygon& );
1860 ~OGRCurvePolygon() override;
1861
1862 OGRCurvePolygon& operator=( const OGRCurvePolygon& other );
1863
1865 typedef OGRCurve ChildType;
1866
1870 ChildType** begin() { return oCC.begin(); }
1872 ChildType** end() { return oCC.end(); }
1876 const ChildType* const * begin() const { return oCC.begin(); }
1878 const ChildType* const * end() const { return oCC.end(); }
1879
1880 // Non standard (OGRGeometry).
1881 virtual const char *getGeometryName() const override;
1882 virtual OGRwkbGeometryType getGeometryType() const override;
1883 virtual OGRGeometry *clone() const override;
1884 virtual void empty() override;
1885 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) override;
1886 virtual void flattenTo2D() override;
1887 virtual OGRBoolean IsEmpty() const override;
1888 virtual void segmentize( double dfMaxLength ) override;
1889 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
1890 const override;
1891 virtual OGRGeometry* getLinearGeometry(
1892 double dfMaxAngleStepSizeDegrees = 0,
1893 const char* const* papszOptions = nullptr ) const override;
1894
1895 // ISurface Interface
1896 virtual double get_Area() const override;
1897
1898 // IWks Interface
1899 virtual int WkbSize() const override;
1900 virtual OGRErr importFromWkb( const unsigned char *,
1901 int,
1902 OGRwkbVariant,
1903 int& nBytesConsumedOut ) override;
1904 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1905 OGRwkbVariant=wkbVariantOldOgc )
1906 const override;
1907 using OGRGeometry::importFromWkt;
1908 OGRErr importFromWkt( const char ** ) override;
1909 using OGRGeometry::exportToWkt;
1910
1915 virtual std::string exportToWkt(const OGRWktOptions& opts = OGRWktOptions(),
1916 OGRErr *err = nullptr) const override;
1917
1918 // IGeometry
1919 virtual int getDimension() const override;
1920 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
1921 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
1922
1923 // ICurvePolygon
1924 virtual OGRPolygon* CurvePolyToPoly(
1925 double dfMaxAngleStepSizeDegrees = 0,
1926 const char* const* papszOptions = nullptr ) const;
1927
1928 // ISpatialRelation
1929 virtual OGRBoolean Equals( const OGRGeometry * ) const override;
1930 virtual OGRBoolean Intersects( const OGRGeometry * ) const override;
1931 virtual OGRBoolean Contains( const OGRGeometry * ) const override;
1932
1933 // Non standard
1934 virtual void setCoordinateDimension( int nDimension ) override;
1935 virtual void set3D( OGRBoolean bIs3D ) override;
1936 virtual void setMeasured( OGRBoolean bIsMeasured ) override;
1937
1938 virtual void assignSpatialReference( OGRSpatialReference * poSR ) override;
1939
1940 virtual OGRErr addRing( OGRCurve * );
1941 virtual OGRErr addRingDirectly( OGRCurve * );
1942
1943 OGRCurve *getExteriorRingCurve();
1944 const OGRCurve *getExteriorRingCurve() const;
1945 int getNumInteriorRings() const;
1946 OGRCurve *getInteriorRingCurve( int );
1947 const OGRCurve *getInteriorRingCurve( int ) const;
1948
1949 OGRCurve *stealExteriorRingCurve();
1950
1951 OGRErr removeRing( int iIndex, bool bDelete = true );
1952 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
1953 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
1954
1955 virtual void swapXY() override;
1956 };
1957
1959
1960 inline const OGRCurvePolygon::ChildType* const * begin(const OGRCurvePolygon* poGeom) { return poGeom->begin(); }
1962 inline const OGRCurvePolygon::ChildType* const * end(const OGRCurvePolygon* poGeom) { return poGeom->end(); }
1963
1965 inline OGRCurvePolygon::ChildType** begin(OGRCurvePolygon* poGeom) { return poGeom->begin(); }
1967 inline OGRCurvePolygon::ChildType** end(OGRCurvePolygon* poGeom) { return poGeom->end(); }
1969
1970 /************************************************************************/
1971 /* OGRPolygon */
1972 /************************************************************************/
1973
1983 class CPL_DLL OGRPolygon : public OGRCurvePolygon
1984 {
1985 static OGRCurvePolygon* CasterToCurvePolygon(OGRSurface* poSurface);
1986
1987 protected:
1989 friend class OGRMultiSurface;
1990 friend class OGRPolyhedralSurface;
1991 friend class OGRTriangulatedSurface;
1992
1993 virtual int checkRing( OGRCurve * poNewRing ) const override;
1994 virtual OGRErr importFromWKTListOnly( const char ** ppszInput,
1995 int bHasZ, int bHasM,
1996 OGRRawPoint*& paoPoints,
1997 int& nMaxPoints,
1998 double*& padfZ );
1999
2000 static OGRCurvePolygon* CastToCurvePolygon(OGRPolygon* poPoly);
2001
2002 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
2003 const override;
2004 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
2005 const override;
2007
2008 public:
2009 OGRPolygon();
2010 OGRPolygon(const OGRPolygon& other);
2011 ~OGRPolygon() override;
2012
2013 OGRPolygon& operator=(const OGRPolygon& other);
2014
2016 typedef OGRLinearRing ChildType;
2017
2021 ChildType** begin() { return reinterpret_cast<ChildType**>(oCC.begin()); }
2023 ChildType** end() { return reinterpret_cast<ChildType**>(oCC.end()); }
2027 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(oCC.begin()); }
2029 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(oCC.end()); }
2030
2031 // Non-standard (OGRGeometry).
2032 virtual const char *getGeometryName() const override;
2033 virtual OGRwkbGeometryType getGeometryType() const override;
2034 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2035 const override;
2036 virtual OGRGeometry* getCurveGeometry(
2037 const char* const* papszOptions = nullptr ) const override;
2038 virtual OGRGeometry* getLinearGeometry(
2039 double dfMaxAngleStepSizeDegrees = 0,
2040 const char* const* papszOptions = nullptr) const override;
2041
2042 // IWks Interface.
2043 virtual int WkbSize() const override;
2044 virtual OGRErr importFromWkb( const unsigned char *,
2045 int,
2046 OGRwkbVariant,
2047 int& nBytesConsumedOut ) override;
2048 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
2049 OGRwkbVariant=wkbVariantOldOgc )
2050 const override;
2051 using OGRGeometry::importFromWkt;
2052 OGRErr importFromWkt( const char ** ) override;
2053
2054 using OGRGeometry::exportToWkt;
2055
2060 virtual std::string exportToWkt(const OGRWktOptions& opts = OGRWktOptions(),
2061 OGRErr *err = nullptr) const override;
2062
2063 // ICurvePolygon.
2064 virtual OGRPolygon* CurvePolyToPoly(
2065 double dfMaxAngleStepSizeDegrees = 0,
2066 const char* const* papszOptions = nullptr ) const override;
2067
2068 OGRLinearRing *getExteriorRing();
2069 const OGRLinearRing *getExteriorRing() const;
2070 virtual OGRLinearRing *getInteriorRing( int );
2071 virtual const OGRLinearRing *getInteriorRing( int ) const;
2072
2073 OGRLinearRing *stealExteriorRing();
2074 virtual OGRLinearRing *stealInteriorRing(int);
2075
2076 OGRBoolean IsPointOnSurface( const OGRPoint * ) const;
2077
2079 inline OGRCurvePolygon* toUpperClass() { return this; }
2081 inline const OGRCurvePolygon* toUpperClass() const { return this; }
2082
2083 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2084 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2085
2086 virtual void closeRings() override;
2087 };
2088
2090
2091 inline const OGRPolygon::ChildType* const * begin(const OGRPolygon* poGeom) { return poGeom->begin(); }
2093 inline const OGRPolygon::ChildType* const * end(const OGRPolygon* poGeom) { return poGeom->end(); }
2094
2096 inline OGRPolygon::ChildType** begin(OGRPolygon* poGeom) { return poGeom->begin(); }
2098 inline OGRPolygon::ChildType** end(OGRPolygon* poGeom) { return poGeom->end(); }
2100
2101 /************************************************************************/
2102 /* OGRTriangle */
2103 /************************************************************************/
2104
2111 class CPL_DLL OGRTriangle : public OGRPolygon
2112 {
2113 private:
2114 // cppcheck-suppress unusedPrivateFunction
2115 static OGRPolygon* CasterToPolygon(OGRSurface* poSurface);
2116 bool quickValidityCheck() const;
2117
2118 protected:
2120 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon() const override;
2121 virtual OGRErr importFromWKTListOnly( const char ** ppszInput,
2122 int bHasZ, int bHasM,
2123 OGRRawPoint*& paoPoints,
2124 int& nMaxPoints,
2125 double*& padfZ ) override;
2127
2128 public:
2129 OGRTriangle();
2130 OGRTriangle( const OGRPoint &p, const OGRPoint &q, const OGRPoint &r );
2131 OGRTriangle( const OGRTriangle &other );
2132 OGRTriangle( const OGRPolygon &other, OGRErr &eErr );
2133 OGRTriangle& operator=( const OGRTriangle& other );
2134 ~OGRTriangle() override;
2135 virtual const char *getGeometryName() const override;
2136 virtual OGRwkbGeometryType getGeometryType() const override;
2137
2138 // IWks Interface.
2139 virtual OGRErr importFromWkb( const unsigned char *,
2140 int,
2141 OGRwkbVariant,
2142 int& nBytesConsumedOut ) override;
2143
2144 // New methods rewritten from OGRPolygon/OGRCurvePolygon/OGRGeometry.
2145 virtual OGRErr addRingDirectly( OGRCurve * poNewRing ) override;
2146
2148 inline OGRPolygon* toUpperClass() { return this; }
2150 inline const OGRPolygon* toUpperClass() const { return this; }
2151
2152 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2153 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2154
2156 static OGRGeometry* CastToPolygon( OGRGeometry* poGeom );
2158 };
2159
2160 /************************************************************************/
2161 /* OGRGeometryCollection */
2162 /************************************************************************/
2163
2171 class CPL_DLL OGRGeometryCollection : public OGRGeometry
2172 {
2173 OGRErr importFromWkbInternal( const unsigned char * pabyData,
2174 int nSize,
2175 int nRecLevel,
2176 OGRwkbVariant, int& nBytesConsumedOut );
2177 OGRErr importFromWktInternal( const char **ppszInput, int nRecLevel );
2178
2179 protected:
2181 int nGeomCount = 0;
2182 OGRGeometry **papoGeoms = nullptr;
2183
2184 std::string exportToWktInternal(const OGRWktOptions& opts, OGRErr *err,
2185 std::string exclude = std::string()) const;
2186 static OGRGeometryCollection* TransferMembersAndDestroy(
2187 OGRGeometryCollection* poSrc,
2188 OGRGeometryCollection* poDst );
2190 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType ) const;
2191
2192 public:
2193 OGRGeometryCollection();
2194 OGRGeometryCollection( const OGRGeometryCollection& other );
2195 ~OGRGeometryCollection() override;
2196
2197 OGRGeometryCollection& operator=( const OGRGeometryCollection& other );
2198
2200 typedef OGRGeometry ChildType;
2201
2205 ChildType** begin() { return papoGeoms; }
2207 ChildType** end() { return papoGeoms + nGeomCount; }
2211 const ChildType* const* begin() const { return papoGeoms; }
2213 const ChildType* const* end() const { return papoGeoms + nGeomCount; }
2214
2215 // Non standard (OGRGeometry).
2216 virtual const char *getGeometryName() const override;
2217 virtual OGRwkbGeometryType getGeometryType() const override;
2218 virtual OGRGeometry *clone() const override;
2219 virtual void empty() override;
2220 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) override;
2221 virtual void flattenTo2D() override;
2222 virtual OGRBoolean IsEmpty() const override;
2223 virtual void segmentize(double dfMaxLength) override;
2224 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2225 const override;
2226 virtual OGRGeometry* getCurveGeometry(
2227 const char* const* papszOptions = nullptr ) const override;
2228 virtual OGRGeometry* getLinearGeometry(
2229 double dfMaxAngleStepSizeDegrees = 0,
2230 const char* const* papszOptions = nullptr ) const override;
2231
2232 // IWks Interface
2233 virtual int WkbSize() const override;
2234 virtual OGRErr importFromWkb( const unsigned char *,
2235 int,
2236 OGRwkbVariant,
2237 int& nBytesConsumedOut ) override;
2238 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
2239 OGRwkbVariant=wkbVariantOldOgc )
2240 const override;
2241 using OGRGeometry::importFromWkt;
2242 OGRErr importFromWkt( const char ** ) override;
2243
2244 using OGRGeometry::exportToWkt;
2245
2250 virtual std::string exportToWkt(const OGRWktOptions& opts = OGRWktOptions(),
2251 OGRErr *err = nullptr) const override;
2252
2253 virtual double get_Length() const;
2254 virtual double get_Area() const;
2255
2256 // IGeometry methods
2257 virtual int getDimension() const override;
2258 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
2259 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
2260
2261 // IGeometryCollection
2262 int getNumGeometries() const;
2263 OGRGeometry *getGeometryRef( int );
2264 const OGRGeometry *getGeometryRef( int ) const;
2265
2266 // ISpatialRelation
2267 virtual OGRBoolean Equals( const OGRGeometry * ) const override;
2268
2269 // Non standard
2270 virtual void setCoordinateDimension( int nDimension ) override;
2271 virtual void set3D( OGRBoolean bIs3D ) override;
2272 virtual void setMeasured( OGRBoolean bIsMeasured ) override;
2273 virtual OGRErr addGeometry( const OGRGeometry * );
2274 virtual OGRErr addGeometryDirectly( OGRGeometry * );
2275 virtual OGRErr removeGeometry( int iIndex, int bDelete = TRUE );
2276
2277 virtual void assignSpatialReference( OGRSpatialReference * poSR ) override;
2278
2279 void closeRings() override;
2280
2281 virtual void swapXY() override;
2282
2283 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2284 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2285
2286 static OGRGeometryCollection* CastToGeometryCollection(
2287 OGRGeometryCollection* poSrc );
2288 };
2289
2291
2292 inline const OGRGeometryCollection::ChildType* const * begin(const OGRGeometryCollection* poGeom) { return poGeom->begin(); }
2294 inline const OGRGeometryCollection::ChildType* const * end(const OGRGeometryCollection* poGeom) { return poGeom->end(); }
2295
2297 inline OGRGeometryCollection::ChildType** begin(OGRGeometryCollection* poGeom) { return poGeom->begin(); }
2299 inline OGRGeometryCollection::ChildType** end(OGRGeometryCollection* poGeom) { return poGeom->end(); }
2301
2302 /************************************************************************/
2303 /* OGRMultiSurface */
2304 /************************************************************************/
2305
2312 class CPL_DLL OGRMultiSurface : public OGRGeometryCollection
2313 {
2314 protected:
2315 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
2316 const override;
2317
2318 public:
2319 OGRMultiSurface();
2320 OGRMultiSurface( const OGRMultiSurface& other );
2321 ~OGRMultiSurface() override;
2322
2323 OGRMultiSurface& operator=( const OGRMultiSurface& other );
2324
2326 typedef OGRSurface ChildType;
2327
2331 ChildType** begin() { return reinterpret_cast<ChildType**>(papoGeoms); }
2333 ChildType** end() { return reinterpret_cast<ChildType**>(papoGeoms + nGeomCount); }
2337 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(papoGeoms); }
2339 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(papoGeoms + nGeomCount); }
2340
2341 // Non standard (OGRGeometry).
2342 virtual const char *getGeometryName() const override;
2343 virtual OGRwkbGeometryType getGeometryType() const override;
2344 using OGRGeometry::importFromWkt;
2345 OGRErr importFromWkt( const char ** ) override;
2346
2347 using OGRGeometry::exportToWkt;
2348
2353 virtual std::string exportToWkt(const OGRWktOptions& opts = OGRWktOptions(),
2354 OGRErr *err = nullptr) const override;
2355
2356 // IMultiSurface methods
2357 virtual OGRErr PointOnSurface( OGRPoint * poPoint ) const;
2358
2359 // IGeometry methods
2360 virtual int getDimension() const override;
2361
2362 // Non standard
2363 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2364 const override;
2365
2367 inline OGRGeometryCollection* toUpperClass() { return this; }
2369 inline const OGRGeometryCollection* toUpperClass() const { return this; }
2370
2371 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2372 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2373
2374 static OGRMultiPolygon* CastToMultiPolygon( OGRMultiSurface* poMS );
2375 };
2376
2378
2379 inline const OGRMultiSurface::ChildType* const * begin(const OGRMultiSurface* poGeom) { return poGeom->begin(); }
2381 inline const OGRMultiSurface::ChildType* const * end(const OGRMultiSurface* poGeom) { return poGeom->end(); }
2382
2384 inline OGRMultiSurface::ChildType** begin(OGRMultiSurface* poGeom) { return poGeom->begin(); }
2386 inline OGRMultiSurface::ChildType** end(OGRMultiSurface* poGeom) { return poGeom->end(); }
2388
2389 /************************************************************************/
2390 /* OGRMultiPolygon */
2391 /************************************************************************/
2392
2397 class CPL_DLL OGRMultiPolygon : public OGRMultiSurface
2398 {
2399 protected:
2400 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
2401 const override;
2402 friend class OGRPolyhedralSurface;
2403 friend class OGRTriangulatedSurface;
2404
2405 private:
2407 OGRErr _addGeometryWithExpectedSubGeometryType(
2408 const OGRGeometry * poNewGeom,
2409 OGRwkbGeometryType eSubGeometryType );
2410 OGRErr _addGeometryDirectlyWithExpectedSubGeometryType(
2411 OGRGeometry * poNewGeom,
2412 OGRwkbGeometryType eSubGeometryType );
2414
2415
2416 public:
2417 OGRMultiPolygon();
2418 OGRMultiPolygon( const OGRMultiPolygon& other );
2419 ~OGRMultiPolygon() override;
2420
2421 OGRMultiPolygon& operator=(const OGRMultiPolygon& other);
2422
2424 typedef OGRPolygon ChildType;
2425
2429 ChildType** begin() { return reinterpret_cast<ChildType**>(papoGeoms); }
2431 ChildType** end() { return reinterpret_cast<ChildType**>(papoGeoms + nGeomCount); }
2435 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(papoGeoms); }
2437 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(papoGeoms + nGeomCount); }
2438
2439 // Non-standard (OGRGeometry).
2440 virtual const char *getGeometryName() const override;
2441 virtual OGRwkbGeometryType getGeometryType() const override;
2442 using OGRGeometry::exportToWkt;
2443
2448 virtual std::string exportToWkt(const OGRWktOptions& opts = OGRWktOptions(),
2449 OGRErr *err = nullptr) const override;
2450
2451 // Non standard
2452 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2453 const override;
2454
2456 inline OGRGeometryCollection* toUpperClass() { return this; }
2458 inline const OGRGeometryCollection* toUpperClass() const { return this; }
2459
2460 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2461 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2462
2463 static OGRMultiSurface* CastToMultiSurface( OGRMultiPolygon* poMP );
2464 };
2465
2467
2468 inline const OGRMultiPolygon::ChildType* const * begin(const OGRMultiPolygon* poGeom) { return poGeom->begin(); }
2470 inline const OGRMultiPolygon::ChildType* const * end(const OGRMultiPolygon* poGeom) { return poGeom->end(); }
2471
2473 inline OGRMultiPolygon::ChildType** begin(OGRMultiPolygon* poGeom) { return poGeom->begin(); }
2475 inline OGRMultiPolygon::ChildType** end(OGRMultiPolygon* poGeom) { return poGeom->end(); }
2477
2478 /************************************************************************/
2479 /* OGRPolyhedralSurface */
2480 /************************************************************************/
2481
2488 class CPL_DLL OGRPolyhedralSurface : public OGRSurface
2489 {
2490 protected:
2492 friend class OGRTriangulatedSurface;
2493 OGRMultiPolygon oMP{};
2494 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
2495 const override;
2496 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
2497 const override;
2498 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType ) const;
2499 virtual const char* getSubGeometryName() const;
2500 virtual OGRwkbGeometryType getSubGeometryType() const;
2501 std::string exportToWktInternal (const OGRWktOptions& opts, OGRErr *err) const;
2502
2503 virtual OGRPolyhedralSurfaceCastToMultiPolygon GetCasterToMultiPolygon()
2504 const;
2505 static OGRMultiPolygon* CastToMultiPolygonImpl(OGRPolyhedralSurface* poPS);
2507
2508 public:
2509 OGRPolyhedralSurface();
2510 OGRPolyhedralSurface( const OGRPolyhedralSurface &poGeom );
2511 ~OGRPolyhedralSurface() override;
2512 OGRPolyhedralSurface& operator=(const OGRPolyhedralSurface& other);
2513
2515 typedef OGRPolygon ChildType;
2516
2520 ChildType** begin() { return oMP.begin(); }
2522 ChildType** end() { return oMP.end(); }
2526 const ChildType* const* begin() const { return oMP.begin(); }
2528 const ChildType* const* end() const { return oMP.end(); }
2529
2530 // IWks Interface.
2531 virtual int WkbSize() const override;
2532 virtual const char *getGeometryName() const override;
2533 virtual OGRwkbGeometryType getGeometryType() const override;
2534 virtual OGRErr importFromWkb( const unsigned char *,
2535 int,
2536 OGRwkbVariant,
2537 int& nBytesConsumedOut ) override;
2538 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
2539 OGRwkbVariant=wkbVariantOldOgc )
2540 const override;
2541 using OGRGeometry::importFromWkt;
2542 OGRErr importFromWkt( const char ** ) override;
2543 using OGRGeometry::exportToWkt;
2544
2549 virtual std::string exportToWkt(const OGRWktOptions& opts = OGRWktOptions(),
2550 OGRErr *err = nullptr) const override;
2551
2552 // IGeometry methods.
2553 virtual int getDimension() const override;
2554
2555 virtual void empty() override;
2556
2557 virtual OGRGeometry *clone() const override;
2558 virtual void getEnvelope( OGREnvelope * psEnvelope ) const override;
2559 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const override;
2560
2561 virtual void flattenTo2D() override;
2562 virtual OGRErr transform( OGRCoordinateTransformation* ) override;
2563 virtual OGRBoolean Equals( const OGRGeometry* ) const override;
2564 virtual double get_Area() const override;
2565 virtual OGRErr PointOnSurface( OGRPoint* ) const override;
2566
2567 static OGRMultiPolygon* CastToMultiPolygon( OGRPolyhedralSurface* poPS );
2568 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2569 const override;
2570 virtual OGRErr addGeometry( const OGRGeometry * );
2571 OGRErr addGeometryDirectly( OGRGeometry *poNewGeom );
2572 int getNumGeometries() const;
2573 OGRGeometry* getGeometryRef(int i);
2574 const OGRGeometry* getGeometryRef(int i) const;
2575
2576 virtual OGRBoolean IsEmpty() const override;
2577 virtual void setCoordinateDimension( int nDimension ) override;
2578 virtual void set3D( OGRBoolean bIs3D ) override;
2579 virtual void setMeasured( OGRBoolean bIsMeasured ) override;
2580 virtual void swapXY() override;
2581 OGRErr removeGeometry( int iIndex, int bDelete = TRUE );
2582
2583 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2584 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2585
2586 virtual void assignSpatialReference( OGRSpatialReference * poSR ) override;
2587 };
2588
2590
2591 inline const OGRPolyhedralSurface::ChildType* const * begin(const OGRPolyhedralSurface* poGeom) { return poGeom->begin(); }
2593 inline const OGRPolyhedralSurface::ChildType* const * end(const OGRPolyhedralSurface* poGeom) { return poGeom->end(); }
2594
2596 inline OGRPolyhedralSurface::ChildType** begin(OGRPolyhedralSurface* poGeom) { return poGeom->begin(); }
2598 inline OGRPolyhedralSurface::ChildType** end(OGRPolyhedralSurface* poGeom) { return poGeom->end(); }
2600
2601 /************************************************************************/
2602 /* OGRTriangulatedSurface */
2603 /************************************************************************/
2604
2611 class CPL_DLL OGRTriangulatedSurface : public OGRPolyhedralSurface
2612 {
2613 protected:
2615 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
2616 const override;
2617 virtual const char* getSubGeometryName() const override;
2618 virtual OGRwkbGeometryType getSubGeometryType() const override;
2619
2620 virtual OGRPolyhedralSurfaceCastToMultiPolygon GetCasterToMultiPolygon()
2621 const override;
2622 static OGRMultiPolygon *
2623 CastToMultiPolygonImpl( OGRPolyhedralSurface* poPS );
2625
2626 public:
2627 OGRTriangulatedSurface();
2628 OGRTriangulatedSurface( const OGRTriangulatedSurface &other );
2629 ~OGRTriangulatedSurface();
2630
2632 typedef OGRTriangle ChildType;
2633
2637 ChildType** begin() { return reinterpret_cast<ChildType**>(oMP.begin()); }
2639 ChildType** end() { return reinterpret_cast<ChildType**>(oMP.end()); }
2643 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(oMP.begin()); }
2645 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(oMP.end()); }
2646
2647 OGRTriangulatedSurface& operator=( const OGRTriangulatedSurface& other );
2648 virtual const char *getGeometryName() const override;
2649 virtual OGRwkbGeometryType getGeometryType() const override;
2650
2651 // IWks Interface.
2652 virtual OGRErr addGeometry( const OGRGeometry * ) override;
2653
2655 inline OGRPolyhedralSurface* toUpperClass() { return this; }
2657 inline const OGRPolyhedralSurface* toUpperClass() const { return this; }
2658
2659 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2660 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2661
2662 static OGRPolyhedralSurface *
2663 CastToPolyhedralSurface( OGRTriangulatedSurface* poTS );
2664 };
2665
2667
2668 inline const OGRTriangulatedSurface::ChildType* const * begin(const OGRTriangulatedSurface* poGeom) { return poGeom->begin(); }
2670 inline const OGRTriangulatedSurface::ChildType* const * end(const OGRTriangulatedSurface* poGeom) { return poGeom->end(); }
2671
2673 inline OGRTriangulatedSurface::ChildType** begin(OGRTriangulatedSurface* poGeom) { return poGeom->begin(); }
2675 inline OGRTriangulatedSurface::ChildType** end(OGRTriangulatedSurface* poGeom) { return poGeom->end(); }
2677
2678 /************************************************************************/
2679 /* OGRMultiPoint */
2680 /************************************************************************/
2681
2686 class CPL_DLL OGRMultiPoint : public OGRGeometryCollection
2687 {
2688 private:
2689 OGRErr importFromWkt_Bracketed( const char **, int bHasM, int bHasZ );
2690
2691 protected:
2692 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
2693 const override;
2694
2695 public:
2696 OGRMultiPoint();
2697 OGRMultiPoint(const OGRMultiPoint& other);
2698 ~OGRMultiPoint() override;
2699
2700 OGRMultiPoint& operator=(const OGRMultiPoint& other);
2701
2703 typedef OGRPoint ChildType;
2704
2708 ChildType** begin() { return reinterpret_cast<ChildType**>(papoGeoms); }
2710 ChildType** end() { return reinterpret_cast<ChildType**>(papoGeoms + nGeomCount); }
2714 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(papoGeoms); }
2716 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(papoGeoms + nGeomCount); }
2717
2718 // Non-standard (OGRGeometry).
2719 virtual const char *getGeometryName() const override;
2720 virtual OGRwkbGeometryType getGeometryType() const override;
2721 using OGRGeometry::importFromWkt;
2722 OGRErr importFromWkt( const char ** ) override;
2723 using OGRGeometry::exportToWkt;
2724
2729 virtual std::string exportToWkt(const OGRWktOptions& opts = OGRWktOptions(),
2730 OGRErr *err = nullptr) const override;
2731
2732 // IGeometry methods.
2733 virtual int getDimension() const override;
2734
2736 inline OGRGeometryCollection* toUpperClass() { return this; }
2738 inline const OGRGeometryCollection* toUpperClass() const { return this; }
2739
2740 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2741 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2742
2743 // Non-standard.
2744 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2745 const override;
2746 };
2747
2749
2750 inline const OGRMultiPoint::ChildType* const * begin(const OGRMultiPoint* poGeom) { return poGeom->begin(); }
2752 inline const OGRMultiPoint::ChildType* const * end(const OGRMultiPoint* poGeom) { return poGeom->end(); }
2753
2755 inline OGRMultiPoint::ChildType** begin(OGRMultiPoint* poGeom) { return poGeom->begin(); }
2757 inline OGRMultiPoint::ChildType** end(OGRMultiPoint* poGeom) { return poGeom->end(); }
2759
2760 /************************************************************************/
2761 /* OGRMultiCurve */
2762 /************************************************************************/
2763
2770 class CPL_DLL OGRMultiCurve : public OGRGeometryCollection
2771 {
2772 protected:
2774 static OGRErr addCurveDirectlyFromWkt( OGRGeometry* poSelf,
2775 OGRCurve* poCurve );
2777 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
2778 const override;
2779
2780 public:
2781 OGRMultiCurve();
2782 OGRMultiCurve( const OGRMultiCurve& other );
2783 ~OGRMultiCurve() override;
2784
2785 OGRMultiCurve& operator=( const OGRMultiCurve& other );
2786
2788 typedef OGRCurve ChildType;
2789
2793 ChildType** begin() { return reinterpret_cast<ChildType**>(papoGeoms); }
2795 ChildType** end() { return reinterpret_cast<ChildType**>(papoGeoms + nGeomCount); }
2799 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(papoGeoms); }
2801 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(papoGeoms + nGeomCount); }
2802
2803 // Non standard (OGRGeometry).
2804 virtual const char *getGeometryName() const override;
2805 virtual OGRwkbGeometryType getGeometryType() const override;
2806 using OGRGeometry::importFromWkt;
2807 OGRErr importFromWkt( const char ** ) override;
2808 using OGRGeometry::exportToWkt;
2809
2814 virtual std::string exportToWkt(const OGRWktOptions& opts = OGRWktOptions(),
2815 OGRErr *err = nullptr) const override;
2816
2817 // IGeometry methods.
2818 virtual int getDimension() const override;
2819
2820 // Non-standard.
2821 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2822 const override;
2823
2825 inline OGRGeometryCollection* toUpperClass() { return this; }
2827 inline const OGRGeometryCollection* toUpperClass() const { return this; }
2828
2829 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2830 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2831
2832 static OGRMultiLineString* CastToMultiLineString(OGRMultiCurve* poMC);
2833 };
2834
2836
2837 inline const OGRMultiCurve::ChildType* const * begin(const OGRMultiCurve* poGeom) { return poGeom->begin(); }
2839 inline const OGRMultiCurve::ChildType* const * end(const OGRMultiCurve* poGeom) { return poGeom->end(); }
2840
2842 inline OGRMultiCurve::ChildType** begin(OGRMultiCurve* poGeom) { return poGeom->begin(); }
2844 inline OGRMultiCurve::ChildType** end(OGRMultiCurve* poGeom) { return poGeom->end(); }
2846
2847 /************************************************************************/
2848 /* OGRMultiLineString */
2849 /************************************************************************/
2850
2855 class CPL_DLL OGRMultiLineString : public OGRMultiCurve
2856 {
2857 protected:
2858 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
2859 const override;
2860
2861 public:
2862 OGRMultiLineString();
2863 OGRMultiLineString( const OGRMultiLineString& other );
2864 ~OGRMultiLineString() override;
2865
2866 OGRMultiLineString& operator=( const OGRMultiLineString& other );
2867
2869 typedef OGRLineString ChildType;
2870
2874 ChildType** begin() { return reinterpret_cast<ChildType**>(papoGeoms); }
2876 ChildType** end() { return reinterpret_cast<ChildType**>(papoGeoms + nGeomCount); }
2880 const ChildType* const* begin() const { return reinterpret_cast<const ChildType* const*>(papoGeoms); }
2882 const ChildType* const* end() const { return reinterpret_cast<const ChildType* const*>(papoGeoms + nGeomCount); }
2883
2884 // Non standard (OGRGeometry).
2885 virtual const char *getGeometryName() const override;
2886 virtual OGRwkbGeometryType getGeometryType() const override;
2887 using OGRGeometry::exportToWkt;
2888
2893 virtual std::string exportToWkt(const OGRWktOptions& opts = OGRWktOptions(),
2894 OGRErr *err = nullptr) const override;
2895
2896 // Non standard
2897 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
2898 const override;
2899
2901 inline OGRGeometryCollection* toUpperClass() { return this; }
2903 inline const OGRGeometryCollection* toUpperClass() const { return this; }
2904
2905 virtual void accept(IOGRGeometryVisitor* visitor) override { visitor->visit(this); }
2906 virtual void accept(IOGRConstGeometryVisitor* visitor) const override { visitor->visit(this); }
2907
2908 static OGRMultiCurve* CastToMultiCurve( OGRMultiLineString* poMLS );
2909 };
2910
2912
2913 inline const OGRMultiLineString::ChildType* const * begin(const OGRMultiLineString* poGeom) { return poGeom->begin(); }
2915 inline const OGRMultiLineString::ChildType* const * end(const OGRMultiLineString* poGeom) { return poGeom->end(); }
2916
2918 inline OGRMultiLineString::ChildType** begin(OGRMultiLineString* poGeom) { return poGeom->begin(); }
2920 inline OGRMultiLineString::ChildType** end(OGRMultiLineString* poGeom) { return poGeom->end(); }
2922
2923 /************************************************************************/
2924 /* OGRGeometryFactory */
2925 /************************************************************************/
2926
2931 class CPL_DLL OGRGeometryFactory
2932 {
2933 static OGRErr createFromFgfInternal( const unsigned char *pabyData,
2934 OGRSpatialReference * poSR,
2935 OGRGeometry **ppoReturn,
2936 int nBytes,
2937 int *pnBytesConsumed,
2938 int nRecLevel );
2939 public:
2940 static OGRErr createFromWkb( const void *, OGRSpatialReference *,
2941 OGRGeometry **, int = -1,
2942 OGRwkbVariant=wkbVariantOldOgc );
2943 static OGRErr createFromWkb( const void * pabyData,
2944 OGRSpatialReference *,
2945 OGRGeometry **,
2946 int nSize,
2947 OGRwkbVariant eVariant,
2948 int& nBytesConsumedOut );
2949 static OGRErr createFromWkt( const char* , OGRSpatialReference *,
2950 OGRGeometry ** );
2951 static OGRErr createFromWkt( const char **, OGRSpatialReference *,
2952 OGRGeometry ** );
2956 static OGRErr createFromWkt( char ** ppszInput, OGRSpatialReference * poSRS,
2957 OGRGeometry ** ppoGeom )
2958 CPL_WARN_DEPRECATED("Use createFromWkt(const char**, ...) instead")
2959 {
2960 return createFromWkt( const_cast<const char**>(ppszInput), poSRS, ppoGeom);
2961 }
2962
2963 static OGRErr createFromFgf( const void*, OGRSpatialReference *,
2964 OGRGeometry **, int = -1, int * = nullptr );
2965 static OGRGeometry *createFromGML( const char * );
2966 static OGRGeometry *createFromGEOS( GEOSContextHandle_t hGEOSCtxt,
2967 GEOSGeom );
2968 static OGRGeometry *createFromGeoJson( const char *);
2969 static OGRGeometry *createFromGeoJson( const CPLJSONObject &oJSONObject );
2970
2971 static void destroyGeometry( OGRGeometry * );
2972 static OGRGeometry *createGeometry( OGRwkbGeometryType );
2973
2974 static OGRGeometry * forceToPolygon( OGRGeometry * );
2975 static OGRGeometry * forceToLineString( OGRGeometry *,
2976 bool bOnlyInOrder = true );
2977 static OGRGeometry * forceToMultiPolygon( OGRGeometry * );
2978 static OGRGeometry * forceToMultiPoint( OGRGeometry * );
2979 static OGRGeometry * forceToMultiLineString( OGRGeometry * );
2980
2981 static OGRGeometry * forceTo( OGRGeometry* poGeom,
2982 OGRwkbGeometryType eTargetType,
2983 const char*const* papszOptions = nullptr );
2984
2985 static OGRGeometry * removeLowerDimensionSubGeoms( const OGRGeometry* poGeom );
2986
2987 static OGRGeometry * organizePolygons( OGRGeometry **papoPolygons,
2988 int nPolygonCount,
2989 int *pbResultValidGeometry,
2990 const char **papszOptions = nullptr);
2991 static bool haveGEOS();
2992
2994 class CPL_DLL TransformWithOptionsCache
2995 {
2996 friend class OGRGeometryFactory;
2997 struct Private;
2998 std::unique_ptr<Private> d;
2999
3000 public:
3001 TransformWithOptionsCache();
3002 ~TransformWithOptionsCache();
3003 };
3004
3005 static OGRGeometry* transformWithOptions( const OGRGeometry* poSrcGeom,
3006 OGRCoordinateTransformation *poCT,
3007 char** papszOptions,
3008 const TransformWithOptionsCache& cache = TransformWithOptionsCache() );
3009
3010 static OGRGeometry*
3011 approximateArcAngles( double dfX, double dfY, double dfZ,
3012 double dfPrimaryRadius, double dfSecondaryAxis,
3013 double dfRotation,
3014 double dfStartAngle, double dfEndAngle,
3015 double dfMaxAngleStepSizeDegrees,
3016 const bool bUseMaxGap = false );
3017
3018 static int GetCurveParmeters( double x0, double y0,
3019 double x1, double y1,
3020 double x2, double y2,
3021 double& R, double& cx, double& cy,
3022 double& alpha0, double& alpha1,
3023 double& alpha2 );
3024 static OGRLineString* curveToLineString(
3025 double x0, double y0, double z0,
3026 double x1, double y1, double z1,
3027 double x2, double y2, double z2,
3028 int bHasZ,
3029 double dfMaxAngleStepSizeDegrees,
3030 const char* const * papszOptions = nullptr );
3031 static OGRCurve* curveFromLineString(
3032 const OGRLineString* poLS,
3033 const char* const * papszOptions = nullptr);
3034 };
3035
3036 OGRwkbGeometryType CPL_DLL OGRFromOGCGeomType( const char *pszGeomType );
3037 const char CPL_DLL * OGRToOGCGeomType( OGRwkbGeometryType eGeomType );
3038
3040 typedef struct _OGRPreparedGeometry OGRPreparedGeometry;
3041 int OGRHasPreparedGeometrySupport();
3042 OGRPreparedGeometry* OGRCreatePreparedGeometry( const OGRGeometry* poGeom );
3043 void OGRDestroyPreparedGeometry( OGRPreparedGeometry* poPreparedGeom );
3044 int OGRPreparedGeometryIntersects( const OGRPreparedGeometry* poPreparedGeom,
3045 const OGRGeometry* poOtherGeom );
3046 int OGRPreparedGeometryContains( const OGRPreparedGeometry* poPreparedGeom,
3047 const OGRGeometry* poOtherGeom );
3048
3050 struct CPL_DLL OGRPreparedGeometryUniquePtrDeleter
3051 {
3052 void operator()(OGRPreparedGeometry*) const;
3053 };
3055
3059 typedef std::unique_ptr<OGRPreparedGeometry, OGRPreparedGeometryUniquePtrDeleter> OGRPreparedGeometryUniquePtr;
3060
3061 #endif /* ndef OGR_GEOMETRY_H_INCLUDED */
OGRCurve::toSimpleCurve
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:1060
OGRCompoundCurve::begin
const ChildType *const * begin() const
Return begin of curve iterator.
Definition: ogr_geometry.h:1691
OGRGeometry::toMultiPoint
OGRMultiPoint * toMultiPoint()
Down-cast to OGRMultiPoint*.
Definition: ogr_geometry.h:739
OGRTriangulatedSurface::getGeometryName
virtual const char * getGeometryName() const override
Returns the geometry name of the TriangulatedSurface.
Definition: ogrtriangulatedsurface.cpp:116
OGRPolyhedralSurface::importFromWkt
OGRErr importFromWkt(const char **) override
deprecated
Definition: ogrpolyhedralsurface.cpp:353
OGRSimpleCurve::ChildType
OGRPoint ChildType
Type of child elements.
Definition: ogr_geometry.h:1156
OGRTriangle::importFromWkb
virtual OGRErr importFromWkb(const unsigned char *, int, OGRwkbVariant, int &nBytesConsumedOut) override
Assign geometry from well known binary data.
Definition: ogrtriangle.cpp:188
OGRPolyhedralSurface::~OGRPolyhedralSurface
~OGRPolyhedralSurface() override
Destructor.
OGRGeometry::closeRings
virtual void closeRings()
Force rings to be closed.
Definition: ogrgeometry.cpp:5104
OGRGeometry::toPolygon
const OGRPolygon * toPolygon() const
Down-cast to OGRPolygon*.
Definition: ogr_geometry.h:690
OGRGeometry::toTriangle
const OGRTriangle * toTriangle() const
Down-cast to OGRTriangle*.
Definition: ogr_geometry.h:704
OGRMultiPoint::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2708
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:2213
OGRPolygon::getLinearGeometry
virtual OGRGeometry * getLinearGeometry(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=nullptr) const override
Return, possibly approximate, non-curve version of this geometry.
Definition: ogrpolygon.cpp:740
OGRGeometry::Is3D
OGRBoolean Is3D() const
Definition: ogr_geometry.h:403
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:616
OGRMultiCurve::toUpperClass
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2827
OGRGeometry::toMultiLineString
OGRMultiLineString * toMultiLineString()
Down-cast to OGRMultiLineString*.
Definition: ogr_geometry.h:753
OGRGeometry::toLineString
const OGRLineString * toLineString() const
Down-cast to OGRLineString*.
Definition: ogr_geometry.h:620
OGRWktOptions::format
OGRWktFormat format
Formatting type.
Definition: ogr_geometry.h:78
OGRCircularString::toUpperClass
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:1521
OGRPolyhedralSurface::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2584
OGRRawPoint::y
double y
y
Definition: ogr_geometry.h:114
OGRTriangle::getGeometryName
virtual const char * getGeometryName() const override
Fetch WKT name for geometry type.
Definition: ogrtriangle.cpp:151
OGRCurvePolygon::ChildType
OGRCurve ChildType
Type of child elements.
Definition: ogr_geometry.h:1865
OGRLineString
Concrete representation of a multi-vertex line.
Definition: ogr_geometry.h:1297
OGRMultiPoint::ChildType
OGRPoint ChildType
Type of child elements.
Definition: ogr_geometry.h:2703
OGRGeometry::toCompoundCurve
OGRCompoundCurve * toCompoundCurve()
Down-cast to OGRCompoundCurve*.
Definition: ogr_geometry.h:655
OGRGeometry::toMultiPolygon
const OGRMultiPolygon * toMultiPolygon() const
Down-cast to OGRMultiPolygon*.
Definition: ogr_geometry.h:774
OGRGeometry::ToHandle
static OGRGeometryH ToHandle(OGRGeometry *poGeom)
Convert a OGRGeometry* to a OGRGeometryH.
Definition: ogr_geometry.h:558
OGRLineString::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1341
OGRPoint::getY
double getY() const
Return y.
Definition: ogr_geometry.h:908
OGRCurvePolygon::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1953
OGRWktFormat::Default
Format as F when abs(value) < 1, otherwise as G.
OGRLineString::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1342
OGRGeometry::toCurve
OGRCurve * toCurve()
Down-cast to OGRCurve*.
Definition: ogr_geometry.h:585
OGRPolyhedralSurface::flattenTo2D
virtual void flattenTo2D() override
Convert geometry to strictly 2D.
Definition: ogrpolyhedralsurface.cpp:499
OGRGeometryFactory
Create geometry objects from well known text/binary.
Definition: ogr_geometry.h:2931
OGRPolyhedralSurface::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2528
OGRGeometry::toMultiPolygon
OGRMultiPolygon * toMultiPolygon()
Down-cast to OGRMultiPolygon*.
Definition: ogr_geometry.h:767
OGRMultiLineString::toUpperClass
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2903
OGRPolyhedralSurface::getDimension
virtual int getDimension() const override
Get the dimension of this object.
Definition: ogrpolyhedralsurface.cpp:139
OGRLinearRing::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1420
OGRRawPoint::x
double x
x
Definition: ogr_geometry.h:112
OGRMultiLineString::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2874
OGRCurvePolygon::transform
virtual OGRErr transform(OGRCoordinateTransformation *poCT) override
Apply arbitrary coordinate transformation to geometry.
Definition: ogrcurvepolygon.cpp:655
OGRGeometry::toSurface
const OGRSurface * toSurface() const
Down-cast to OGRSurface*.
Definition: ogr_geometry.h:676
OGRMultiLineString::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2876
OGRCurvePolygon::set3D
virtual void set3D(OGRBoolean bIs3D) override
Add or remove the Z coordinate dimension.
Definition: ogrcurvepolygon.cpp:691
OGRCircularString::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1523
OGRGeometry::getCurveGeometry
virtual OGRGeometry * getCurveGeometry(const char *const *papszOptions=nullptr) const CPL_WARN_UNUSED_RESULT
Return curve version of this geometry.
Definition: ogrgeometry.cpp:3213
OGRPolyhedralSurface::OGRPolyhedralSurface
OGRPolyhedralSurface()
Create an empty PolyhedralSurface.
OGRPolyhedralSurface::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2583
OGRGeometry::toMultiSurface
OGRMultiSurface * toMultiSurface()
Down-cast to OGRMultiSurface*.
Definition: ogr_geometry.h:795
OGRPolyhedralSurface::set3D
virtual void set3D(OGRBoolean bIs3D) override
Set the type as 3D geometry.
Definition: ogrpolyhedralsurface.cpp:864
OGRGeometryFactory::TransformWithOptionsCache
Opaque class used as argument to transformWithOptions()
Definition: ogr_geometry.h:2994
OGRGeometry::FromHandle
static OGRGeometry * FromHandle(OGRGeometryH hGeom)
Convert a OGRGeometryH to a OGRGeometry*.
Definition: ogr_geometry.h:564
OGRCurvePolygon::setCoordinateDimension
virtual void setCoordinateDimension(int nDimension) override
Set the coordinate dimension.
Definition: ogrcurvepolygon.cpp:685
OGRCurvePolygon::end
ChildType ** end()
Return end of curve iterator.
Definition: ogr_geometry.h:1872
OGRWktOptions
Options for formatting WKT output.
Definition: ogr_geometry.h:68
OGRMultiSurface::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2371
OGRPolyhedralSurface::getEnvelope
virtual void getEnvelope(OGREnvelope *psEnvelope) const override
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure...
Definition: ogrpolyhedralsurface.cpp:193
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:3178
OGRMultiPolygon::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2460
OGRGeometry::operator!=
bool operator!=(const OGRGeometry &other) const
Returns if two geometries are different.
Definition: ogr_geometry.h:392
OGRBoolean
int OGRBoolean
Type for a OGR boolean.
Definition: ogr_core.h:334
OGRPolygon::begin
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2027
OGRCurvePolygon::getExteriorRingCurve
OGRCurve * getExteriorRingCurve()
Fetch reference to external polygon ring.
Definition: ogrcurvepolygon.cpp:201
OGRCurvePolygon::end
const ChildType *const * end() const
Return end of curve iterator.
Definition: ogr_geometry.h:1878
OGRPolygon::hasCurveGeometry
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const override
Returns if this geometry is or has curve geometry.
Definition: ogrpolygon.cpp:731
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:827
GByte
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:215
ogr_spatialref.h
Coordinate systems services.
OGRPolyhedralSurface::IsEmpty
virtual OGRBoolean IsEmpty() const override
Checks if the PolyhedralSurface is empty.
Definition: ogrpolyhedralsurface.cpp:851
OGRGeometry::toTriangulatedSurface
OGRTriangulatedSurface * toTriangulatedSurface()
Down-cast to OGRTriangulatedSurface*.
Definition: ogr_geometry.h:823
OGRPoint::getM
double getM() const
Return m.
Definition: ogr_geometry.h:912
OGRCircularString::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1524
OGRTriangle::toUpperClass
const OGRPolygon * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2150
OGRGeometryCollection::begin
const ChildType *const * begin() const
Return begin of sub-geometry iterator.
Definition: ogr_geometry.h:2211
OGRMultiSurface::begin
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2337
OGRRawPoint::OGRRawPoint
OGRRawPoint()
Constructor.
Definition: ogr_geometry.h:106
OGRGeometry::toTriangulatedSurface
const OGRTriangulatedSurface * toTriangulatedSurface() const
Down-cast to OGRTriangulatedSurface*.
Definition: ogr_geometry.h:830
OGRMultiSurface::ChildType
OGRSurface ChildType
Type of child elements.
Definition: ogr_geometry.h:2326
OGRWktOptions::precision
int precision
Precision of output. Interpretation depends on format.
Definition: ogr_geometry.h:74
OGRPolygon::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2021
OGRCurvePolygon::assignSpatialReference
virtual void assignSpatialReference(OGRSpatialReference *poSR) override
Assign spatial reference to this object.
Definition: ogrcurvepolygon.cpp:705
OGRMultiPolygon
A collection of non-overlapping OGRPolygon.
Definition: ogr_geometry.h:2397
OGRGeometry::toPoint
OGRPoint * toPoint()
Down-cast to OGRPoint*.
Definition: ogr_geometry.h:571
OGRCurvePolygon::segmentize
virtual void segmentize(double dfMaxLength) override
Modify the geometry such it has no segment longer then the given distance.
Definition: ogrcurvepolygon.cpp:723
OGRHasPreparedGeometrySupport
int OGRHasPreparedGeometrySupport()
Returns if GEOS has prepared geometry support.
Definition: ogrgeometry.cpp:5842
OGRCurvePolygon::clone
virtual OGRGeometry * clone() const override
Make a copy of this object.
Definition: ogrcurvepolygon.cpp:103
OGRwkbByteOrder
OGRwkbByteOrder
Enumeration to describe byte order.
Definition: ogr_core.h:527
OGRLinearRing::toUpperClass
const OGRLineString * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:1417
OGRMultiLineString::begin
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2880
OGRCircularString
Concrete representation of a circular string, that is to say a curve made of one or several arc circl...
Definition: ogr_geometry.h:1451
OGRMultiCurve::ChildType
OGRCurve ChildType
Type of child elements.
Definition: ogr_geometry.h:2788
OGRCurve
Abstract curve base class for OGRLineString, OGRCircularString and OGRCompoundCurve.
Definition: ogr_geometry.h:979
OGRGeometryCollection
A collection of 1 or more geometry objects.
Definition: ogr_geometry.h:2171
OGRMultiCurve::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2830
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:1415
OGRLinearRing
Concrete representation of a closed ring.
Definition: ogr_geometry.h:1369
OGRPoint::setM
void setM(double mIn)
Set m.
Definition: ogr_geometry.h:932
OGRCurvePolygon::begin
ChildType ** begin()
Return begin of curve iterator.
Definition: ogr_geometry.h:1870
OGRPolyhedralSurface::setCoordinateDimension
virtual void setCoordinateDimension(int nDimension) override
Set the coordinate dimension.
Definition: ogrpolyhedralsurface.cpp:900
OGRTriangulatedSurface::ChildType
OGRTriangle ChildType
Type of child elements.
Definition: ogr_geometry.h:2632
OGRGeometry::toCircularString
OGRCircularString * toCircularString()
Down-cast to OGRCircularString*.
Definition: ogr_geometry.h:641
OGRPolyhedralSurface::exportToWkt
virtual std::string exportToWkt(const OGRWktOptions &opts=OGRWktOptions(), OGRErr *err=nullptr) const override
Export a polyhedral surface to WKT.
Definition: ogrpolyhedralsurface.cpp:451
OGRGeometryFactory::createFromWkt
static OGRErr createFromWkt(char **ppszInput, OGRSpatialReference *poSRS, OGRGeometry **ppoGeom)
Deprecated.
Definition: ogr_geometry.h:2956
OGRPolygon::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2029
OGRCurvePolygon::setMeasured
virtual void setMeasured(OGRBoolean bIsMeasured) override
Add or remove the M coordinate dimension.
Definition: ogrcurvepolygon.cpp:696
OGRMultiSurface::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2333
OGRPolygon::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2023
OGRTriangulatedSurface::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2659
CPLJSONObject
The CPLJSONArray class holds JSON object from CPLJSONDocument.
Definition: cpl_json.h:53
OGRGeometry::exportToWkt
OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const
Convert a geometry into well known text format.
Definition: ogrgeometry.cpp:1787
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:2738
OGRMultiCurve::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2795
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:2526
OGRPolyhedralSurface::Equals
virtual OGRBoolean Equals(const OGRGeometry *) const override
Returns TRUE if two geometries are equivalent.
Definition: ogrpolyhedralsurface.cpp:592
IOGRGeometryVisitor
OGRGeometry visitor interface.
Definition: ogr_geometry.h:156
OGRGeometry::toMultiSurface
const OGRMultiSurface * toMultiSurface() const
Down-cast to OGRMultiSurface*.
Definition: ogr_geometry.h:802
OGRMultiLineString::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2882
OGRMultiCurve::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2793
OGRGeometry::toSurface
OGRSurface * toSurface()
Down-cast to OGRSurface*.
Definition: ogr_geometry.h:669
OGRMultiSurface
A collection of non-overlapping OGRSurface.
Definition: ogr_geometry.h:2312
OGRGeometry::toSimpleCurve
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:599
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:1687
OGRMultiCurve::begin
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2799
OGRTriangulatedSurface::toUpperClass
const OGRPolyhedralSurface * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2657
OGRFromOGCGeomType
OGRwkbGeometryType OGRFromOGCGeomType(const char *pszGeomType)
Map OGCgeometry format type to corresponding OGR constants.
Definition: ogrgeometry.cpp:2344
OGRDefaultGeometryVisitor::visit
void visit(OGRPoint *) override
Visit OGRPoint.
Definition: ogr_geometry.h:209
OGRMultiLineString::ChildType
OGRLineString ChildType
Type of child elements.
Definition: ogr_geometry.h:2869
OGRGeometry::importFromWkt
virtual OGRErr importFromWkt(const char **ppszInput)=0
Assign geometry from well known text data.
OGRTriangulatedSurface::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2645
OGRPolyhedralSurface::addGeometryDirectly
OGRErr addGeometryDirectly(OGRGeometry *poNewGeom)
Add a geometry directly to the container.
Definition: ogrpolyhedralsurface.cpp:760
OGRCompoundCurve
Utility class to store a collection of curves.
Definition: ogr_geometry.h:1641
OGRRawPoint
Simple container for a position.
Definition: ogr_geometry.h:102
OGRTriangulatedSurface::toUpperClass
OGRPolyhedralSurface * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2655
OGRwkbGeometryType
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:345
OGRTriangulatedSurface::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2660
OGRPolygon::toUpperClass
OGRCurvePolygon * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2079
OGRWktOptions::OGRWktOptions
OGRWktOptions()
Constructor.
Definition: ogr_geometry.h:81
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:2283
OGRCompoundCurve::begin
ChildType ** begin()
Return begin of curve iterator.
Definition: ogr_geometry.h:1685
OGRGeometry::operator==
bool operator==(const OGRGeometry &other) const
Returns if two geometries are equal.
Definition: ogr_geometry.h:389
OGRWktOptions::round
bool round
Whether GDAL-special rounding should be applied.
Definition: ogr_geometry.h:76
OGRPointIterator
Interface for a point iterator.
Definition: ogr_geometry.h:961
OGRTriangulatedSurface
TriangulatedSurface class.
Definition: ogr_geometry.h:2611
OGRMultiPoint::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2740
OGRPolyhedralSurface::swapXY
virtual void swapXY() override
Swap x and y coordinates.
Definition: ogrpolyhedralsurface.cpp:915
OGRMultiCurve
A collection of OGRCurve.
Definition: ogr_geometry.h:2770
OGRCompoundCurve::get_AreaOfCurveSegments
virtual double get_AreaOfCurveSegments() const override
Return area of curve segments.
Definition: ogrcompoundcurve.cpp:902
OGRGeometryCollection::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2284
OGRSurface
Abstract base class for 2 dimensional objects like polygons or curve polygons.
Definition: ogr_geometry.h:1793
IOGRConstGeometryVisitor
OGRGeometry visitor interface.
Definition: ogr_geometry.h:230
OGRMultiLineString
A collection of OGRLineString.
Definition: ogr_geometry.h:2855
OGRGeometry::toCurvePolygon
OGRCurvePolygon * toCurvePolygon()
Down-cast to OGRCurvePolygon*.
Definition: ogr_geometry.h:711
OGRGeometry
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:325
OGRMultiSurface::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2372
OGRMultiLineString::toUpperClass
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2901
OGRPoint::getZ
double getZ() const
Return z.
Definition: ogr_geometry.h:910
OGRGeometry::toMultiCurve
OGRMultiCurve * toMultiCurve()
Down-cast to OGRMultiCurve*.
Definition: ogr_geometry.h:781
OGRGeometry::toPolyhedralSurface
OGRPolyhedralSurface * toPolyhedralSurface()
Down-cast to OGRPolyhedralSurface*.
Definition: ogr_geometry.h:809
OGRMultiPoint::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2741
OGRPoint::setX
void setX(double xIn)
Set x.
Definition: ogr_geometry.h:919
OGRGeometry::IsMeasured
OGRBoolean IsMeasured() const
Definition: ogr_geometry.h:405
sfcgal_geometry_t
void sfcgal_geometry_t
SFCGAL geometry type.
Definition: ogr_geometry.h:122
OGRTriangulatedSurface::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2637
OGRPolygon::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2083
OGRCurvePolygon::begin
const ChildType *const * begin() const
Return begin of curve iterator.
Definition: ogr_geometry.h:1876
OGRTriangle::operator=
OGRTriangle & operator=(const OGRTriangle &other)
Assignment operator.
Definition: ogrtriangle.cpp:138
OGRGeometry::toLinearRing
const OGRLinearRing * toLinearRing() const
Down-cast to OGRLinearRing*.
Definition: ogr_geometry.h:634
OGRDestroyPreparedGeometry
void OGRDestroyPreparedGeometry(OGRPreparedGeometry *poPreparedGeom)
Destroys a prepared geometry.
Definition: ogrgeometry.cpp:5898
GEOSGeom
struct GEOSGeom_t * GEOSGeom
GEOS geometry type.
Definition: ogr_geometry.h:118
OGRDefaultGeometryVisitor
OGRGeometry visitor default implementation.
Definition: ogr_geometry.h:203
OGRSimpleCurve::getNumPoints
virtual int getNumPoints() const override
Fetch vertex count.
Definition: ogr_geometry.h:1217
OGRCurvePolygon::flattenTo2D
virtual void flattenTo2D() override
Convert geometry to strictly 2D.
Definition: ogrcurvepolygon.cpp:165
OGRPolyhedralSurface::importFromWkb
virtual OGRErr importFromWkb(const unsigned char *, int, OGRwkbVariant, int &nBytesConsumedOut) override
Assign geometry from well known binary data.
Definition: ogrpolyhedralsurface.cpp:211
OGRMultiPolygon::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2429
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:697
OGRPoint::setZ
void setZ(double zIn)
Set z.
Definition: ogr_geometry.h:927
OGRPolyhedralSurface::removeGeometry
OGRErr removeGeometry(int iIndex, int bDelete=TRUE)
Remove a geometry from the container.
Definition: ogrpolyhedralsurface.cpp:951
OGRCurve::ChildType
OGRPoint ChildType
Type of child elements.
Definition: ogr_geometry.h:1022
OGRCurvePolygon::get_Area
virtual double get_Area() const override
Get the area of the surface object.
Definition: ogrcurvepolygon.cpp:665
OGRSurface::PointOnSurface
virtual OGRErr PointOnSurface(OGRPoint *poPoint) const
This method relates to the SFCOM ISurface::get_PointOnSurface() method.
Definition: ogr_geometry.h:1803
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:2207
OGRLinearRing::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1419
OGRPolyhedralSurface::setMeasured
virtual void setMeasured(OGRBoolean bIsMeasured) override
Set the type as Measured.
Definition: ogrpolyhedralsurface.cpp:879
OGRGeometry::toLineString
OGRLineString * toLineString()
Down-cast to OGRLineString*.
Definition: ogr_geometry.h:613
OGRPolygon::importFromWkt
OGRErr importFromWkt(const char **) override
deprecated
Definition: ogrpolygon.cpp:445
OGRPreparedGeometryIntersects
int OGRPreparedGeometryIntersects(const OGRPreparedGeometry *poPreparedGeom, const OGRGeometry *poOtherGeom)
Returns whether a prepared geometry intersects with a geometry.
Definition: ogrgeometry.cpp:5920
OGRCurvePolygon
Concrete class representing curve polygons.
Definition: ogr_geometry.h:1828
OGRGeometry::toLinearRing
OGRLinearRing * toLinearRing()
Down-cast to OGRLinearRing*.
Definition: ogr_geometry.h:627
OGRMultiPoint::begin
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2714
OGRPolyhedralSurface::clone
virtual OGRGeometry * clone() const override
Make a copy of this object.
Definition: ogrpolyhedralsurface.cpp:166
OGRPolyhedralSurface::hasCurveGeometry
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const override
Returns if this geometry is or has curve geometry.
Definition: ogrpolyhedralsurface.cpp:925
OGRTriangle::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2153
OGRPolyhedralSurface
PolyhedralSurface class.
Definition: ogr_geometry.h:2488
OGRMultiCurve::toUpperClass
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2825
OGRCurvePolygon::getDimension
virtual int getDimension() const override
Get the dimension of this object.
Definition: ogrcurvepolygon.cpp:155
cpl_conv.h
Various convenience functions for CPL.
OGRPoint::setY
void setY(double yIn)
Set y.
Definition: ogr_geometry.h:923
OGRWktFormat::F
F-type formatting.
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:157
OGRMultiPoint::toUpperClass
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2736
OGRGeometry::toCurve
const OGRCurve * toCurve() const
Down-cast to OGRCurve*.
Definition: ogr_geometry.h:592
OGRCompoundCurve::ChildType
OGRCurve ChildType
Type of child elements.
Definition: ogr_geometry.h:1680
OGRPreparedGeometry
struct _OGRPreparedGeometry OGRPreparedGeometry
Prepared geometry API (needs GEOS >= 3.1.0)
Definition: ogr_geometry.h:3040
OGREnvelope3D
Simple container for a bounding region in 3D.
Definition: ogr_core.h:175
wkbVariantOldOgc
Old-style 99-402 extended dimension (Z) WKB types.
Definition: ogr_core.h:463
OGRPolyhedralSurface::transform
virtual OGRErr transform(OGRCoordinateTransformation *) override
Apply arbitrary coordinate transformation to geometry.
Definition: ogrpolyhedralsurface.cpp:511
OGRLineString::toUpperClass
const OGRSimpleCurve * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:1339
OGRMultiSurface::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2331
OGRCurvePolygon::OGRCurvePolygon
OGRCurvePolygon()
Create an empty curve polygon.
OGRMultiSurface::toUpperClass
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2369
OGRMultiSurface::toUpperClass
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2367
OGRGeometryUniquePtr
std::unique_ptr< OGRGeometry, OGRGeometryUniquePtrDeleter > OGRGeometryUniquePtr
Unique pointer type for OGRGeometry.
Definition: ogr_geometry.h:845
cpl_json.h
Interface for read and write JSON documents.
OGRCurvePolygon::swapXY
virtual void swapXY() override
Swap x and y coordinates.
Definition: ogrcurvepolygon.cpp:737
OGRCreatePreparedGeometry
OGRPreparedGeometry * OGRCreatePreparedGeometry(const OGRGeometry *poGeom)
Creates a prepared geometry.
Definition: ogrgeometry.cpp:5862
OGRMultiPolygon::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2437
OGRPolygon::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2084
OGRPoint::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:946
OGRPolygon::exportToWkb
virtual OGRErr exportToWkb(OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc) const override
Convert a geometry into well known binary format.
Definition: ogrpolygon.cpp:372
OGRPolyhedralSurface::empty
virtual void empty() override
Clear geometry information.
Definition: ogrpolyhedralsurface.cpp:148
OGRGeometry::toPoint
const OGRPoint * toPoint() const
Down-cast to OGRPoint*.
Definition: ogr_geometry.h:578
OGRCurvePolygon::Intersects
virtual OGRBoolean Intersects(const OGRGeometry *) const override
Do these features intersect?
Definition: ogrcurvepolygon.cpp:796
OGRPoint
Point class.
Definition: ogr_geometry.h:857
OGRGeometryH
void * OGRGeometryH
Opaque type for a geometry.
Definition: ogr_api.h:60
OGRMultiLineString::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2905
OGRTriangulatedSurface::begin
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2643
OGRwkbVariant
OGRwkbVariant
Output variants of WKB we support.
Definition: ogr_core.h:461
OGRPoint::IsEmpty
virtual OGRBoolean IsEmpty() const override
Returns TRUE (non-zero) if the object has no points.
Definition: ogr_geometry.h:901
OGRGeometry::importFromWkt
OGRErr importFromWkt(char **ppszInput) CPL_WARN_DEPRECATED("Use importFromWkt( const char**) instead")
Deprecated.
Definition: ogr_geometry.h:427
OGRPolygon::ChildType
OGRLinearRing ChildType
Type of child elements.
Definition: ogr_geometry.h:2016
OGRTriangulatedSurface::getGeometryType
virtual OGRwkbGeometryType getGeometryType() const override
Returns the WKB Type of TriangulatedSurface.
Definition: ogrtriangulatedsurface.cpp:130
OGRGeometry::toMultiCurve
const OGRMultiCurve * toMultiCurve() const
Down-cast to OGRMultiCurve*.
Definition: ogr_geometry.h:788
OGRMultiPolygon::toUpperClass
OGRGeometryCollection * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2456
OGRMultiPolygon::toUpperClass
const OGRGeometryCollection * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2458
OGRCurve::toSimpleCurve
OGRSimpleCurve * toSimpleCurve()
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:1055
OGRPoint::getX
double getX() const
Return x.
Definition: ogr_geometry.h:906
OGRGeometry::toPolygon
OGRPolygon * toPolygon()
Down-cast to OGRPolygon*.
Definition: ogr_geometry.h:683
OGRPolygon
Concrete class representing polygons.
Definition: ogr_geometry.h:1983
OGREnvelope
Simple container for a bounding region (rectangle)
Definition: ogr_core.h:57
OGRSimpleCurve
Abstract curve base class for OGRLineString and OGRCircularString.
Definition: ogr_geometry.h:1088
GEOSContextHandle_t
struct GEOSContextHandle_HS * GEOSContextHandle_t
GEOS context handle type.
Definition: ogr_geometry.h:120
OGRGeometry::toGeometryCollection
OGRGeometryCollection * toGeometryCollection()
Down-cast to OGRGeometryCollection*.
Definition: ogr_geometry.h:725
OGRGeometryCollection::ChildType
OGRGeometry ChildType
Type of child elements.
Definition: ogr_geometry.h:2200
OGRGeometry::toCurvePolygon
const OGRCurvePolygon * toCurvePolygon() const
Down-cast to OGRCurvePolygon*.
Definition: ogr_geometry.h:718
OGRWktOptions::variant
OGRwkbVariant variant
Type of WKT output to produce.
Definition: ogr_geometry.h:72
OGRWktFormat
OGRWktFormat
WKT Output formatting options.
Definition: ogr_geometry.h:60
OGRPolyhedralSurface::get_Area
virtual double get_Area() const override
Returns the area enclosed.
Definition: ogrpolyhedralsurface.cpp:632
OGRDefaultConstGeometryVisitor
OGRGeometry visitor default implementation.
Definition: ogr_geometry.h:277
OGRTriangulatedSurface::operator=
OGRTriangulatedSurface & operator=(const OGRTriangulatedSurface &other)
Assignment operator.
Definition: ogrtriangulatedsurface.cpp:84
OGRPolyhedralSurface::exportToWkb
virtual OGRErr exportToWkb(OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc) const override
Convert a geometry into well known binary format.
Definition: ogrpolyhedralsurface.cpp:303
OGRGeometry::toMultiLineString
const OGRMultiLineString * toMultiLineString() const
Down-cast to OGRMultiLineString*.
Definition: ogr_geometry.h:760
OGRRawPoint::OGRRawPoint
OGRRawPoint(double xIn, double yIn)
Constructor.
Definition: ogr_geometry.h:109
OGRPolygon::closeRings
virtual void closeRings() override
Force rings to be closed.
Definition: ogrpolygon.cpp:709
OGRDefaultConstGeometryVisitor::visit
void visit(const OGRPoint *) override
Visit OGRPoint.
Definition: ogr_geometry.h:283
OGRSimpleCurve::getX
double getX(int i) const
Get X at vertex.
Definition: ogr_geometry.h:1219
OGRCoordinateTransformation
Interface for transforming between coordinate systems.
Definition: ogr_spatialref.h:715
OGRLineString::toUpperClass
OGRSimpleCurve * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:1337
OGRMultiPolygon::ChildType
OGRPolygon ChildType
Type of child elements.
Definition: ogr_geometry.h:2424
OGRPolyhedralSurface::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2522
OGRGeometry::getSpatialReference
OGRSpatialReference * getSpatialReference(void) const
Returns spatial reference system for object.
Definition: ogr_geometry.h:482
OGRPolyhedralSurface::CastToMultiPolygon
static OGRMultiPolygon * CastToMultiPolygon(OGRPolyhedralSurface *poPS)
Casts the OGRPolyhedralSurface to an OGRMultiPolygon.
Definition: ogrpolyhedralsurface.cpp:703
OGRMultiPolygon::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2431
OGRCircularString::toUpperClass
OGRSimpleCurve * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:1519
OGRPreparedGeometryUniquePtr
std::unique_ptr< OGRPreparedGeometry, OGRPreparedGeometryUniquePtrDeleter > OGRPreparedGeometryUniquePtr
Unique pointer type for OGRPreparedGeometry.
Definition: ogr_geometry.h:3059
OGRPolyhedralSurface::getNumGeometries
int getNumGeometries() const
Fetch number of geometries in PolyhedralSurface.
Definition: ogrpolyhedralsurface.cpp:792
OGRTriangle::toUpperClass
OGRPolygon * toUpperClass()
Return pointer of this in upper class.
Definition: ogr_geometry.h:2148
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:714
OGRPreparedGeometryContains
int OGRPreparedGeometryContains(const OGRPreparedGeometry *poPreparedGeom, const OGRGeometry *poOtherGeom)
Returns whether a prepared geometry contains a geometry.
Definition: ogrgeometry.cpp:5950
OGRPoint::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:945
OGRCurvePolygon::addRing
virtual OGRErr addRing(OGRCurve *)
Add a ring to a polygon.
Definition: ogrcurvepolygon.cpp:362
OGRGeometry::toMultiPoint
const OGRMultiPoint * toMultiPoint() const
Down-cast to OGRMultiPoint*.
Definition: ogr_geometry.h:746
OGRPolyhedralSurface::WkbSize
virtual int WkbSize() const override
Returns size of related binary representation.
Definition: ogrpolyhedralsurface.cpp:125
OGRCompoundCurve::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1766
OGRTriangle
Triangle class.
Definition: ogr_geometry.h:2111
OGRMultiCurve::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2801
OGRPolyhedralSurface::begin
ChildType ** begin()
Return begin of iterator.
Definition: ogr_geometry.h:2520
OGRPolyhedralSurface::ChildType
OGRPolygon ChildType
Type of child elements.
Definition: ogr_geometry.h:2515
OGRErr
int OGRErr
Type for a OGR error.
Definition: ogr_core.h:318
OGRPolygon::toUpperClass
const OGRCurvePolygon * toUpperClass() const
Return pointer of this in upper class.
Definition: ogr_geometry.h:2081
OGRCurvePolygon::Contains
virtual OGRBoolean Contains(const OGRGeometry *) const override
Test for containment.
Definition: ogrcurvepolygon.cpp:780
OGRPolyhedralSurface::PointOnSurface
virtual OGRErr PointOnSurface(OGRPoint *) const override
This method relates to the SFCOM ISurface::get_PointOnSurface() method.
Definition: ogrpolyhedralsurface.cpp:659
OGRMultiPoint::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2710
OGRWktFormat::G
G-type formatting.
OGRGeometry::toSimpleCurve
const OGRSimpleCurve * toSimpleCurve() const
Down-cast to OGRSimpleCurve*.
Definition: ogr_geometry.h:606
OGRMultiLineString::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2906
OGRGeometry::toGeometryCollection
const OGRGeometryCollection * toGeometryCollection() const
Down-cast to OGRGeometryCollection*.
Definition: ogr_geometry.h:732
OGRToOGCGeomType
const char * OGRToOGCGeomType(OGRwkbGeometryType eGeomType)
Map OGR geometry format constants to corresponding OGC geometry type.
Definition: ogrgeometry.cpp:2417
OGRGeometry::toPolyhedralSurface
const OGRPolyhedralSurface * toPolyhedralSurface() const
Down-cast to OGRPolyhedralSurface*.
Definition: ogr_geometry.h:816
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:2339
OGRTriangle::getGeometryType
virtual OGRwkbGeometryType getGeometryType() const override
Fetch geometry type.
Definition: ogrtriangle.cpp:160
OGRPolygon::exportToWkt
virtual std::string exportToWkt(const OGRWktOptions &opts=OGRWktOptions(), OGRErr *err=nullptr) const override
Export a polygon to WKT.
Definition: ogrpolygon.cpp:621
OGRMultiPoint
A collection of OGRPoint.
Definition: ogr_geometry.h:2686
OGRGeometry::toCompoundCurve
const OGRCompoundCurve * toCompoundCurve() const
Down-cast to OGRCompoundCurve*.
Definition: ogr_geometry.h:662
OGRCurvePolygon::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:1952
OGRCompoundCurve::end
const ChildType *const * end() const
Return end of curve iterator.
Definition: ogr_geometry.h:1693
OGRMultiPolygon::begin
const ChildType *const * begin() const
Return begin of iterator.
Definition: ogr_geometry.h:2435
OGRPolyhedralSurface::assignSpatialReference
virtual void assignSpatialReference(OGRSpatialReference *poSR) override
Assign spatial reference to this object.
Definition: ogrpolyhedralsurface.cpp:960
OGRMultiPolygon::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:2461
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:2205
OGRGeometry::toCircularString
const OGRCircularString * toCircularString() const
Down-cast to OGRCircularString*.
Definition: ogr_geometry.h:648
OGRCompoundCurve::accept
virtual void accept(IOGRConstGeometryVisitor *visitor) const override
Accept a visitor.
Definition: ogr_geometry.h:1767
OGRTriangulatedSurface::end
ChildType ** end()
Return end of iterator.
Definition: ogr_geometry.h:2639
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:720
OGRMultiCurve::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2829
OGRMultiPoint::end
const ChildType *const * end() const
Return end of iterator.
Definition: ogr_geometry.h:2716
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:942
OGRPolyhedralSurface::getGeometryRef
OGRGeometry * getGeometryRef(int i)
Fetch geometry from container.
Definition: ogrpolyhedralsurface.cpp:814
OGRTriangle::accept
virtual void accept(IOGRGeometryVisitor *visitor) override
Accept a visitor.
Definition: ogr_geometry.h:2152
OGRSimpleCurve::getY
double getY(int i) const
Get Y at vertex.
Definition: ogr_geometry.h:1220
OGRCurvePolygon::Equals
virtual OGRBoolean Equals(const OGRGeometry *) const override
Returns TRUE if two geometries are equivalent.
Definition: ogrcurvepolygon.cpp:636