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: ogr_geometry.h 37472 2017-02-26 02:47:45Z goatbar $
3 *
4 * Project: OpenGIS Simple Features Reference Implementation
5 * Purpose: Classes for manipulating simple features that is not specific
6 * to a particular interface technology.
7 * Author: Frank Warmerdam, warmerdam@pobox.com
8 *
9 ******************************************************************************
10 * Copyright (c) 1999, Frank Warmerdam
11 * Copyright (c) 2008-2014, Even Rouault <even dot rouault at mines-paris dot org>
12 *
13 * Permission is hereby granted, free of charge, to any person obtaining a
14 * copy of this software and associated documentation files (the "Software"),
15 * to deal in the Software without restriction, including without limitation
16 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 * and/or sell copies of the Software, and to permit persons to whom the
18 * Software is furnished to do so, subject to the following conditions:
19 *
20 * The above copyright notice and this permission notice shall be included
21 * in all copies or substantial portions of the Software.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 * DEALINGS IN THE SOFTWARE.
30 ****************************************************************************/
31
32 #ifndef OGR_GEOMETRY_H_INCLUDED
33 #define OGR_GEOMETRY_H_INCLUDED
34
35 #include "ogr_core.h"
36 #include "ogr_spatialref.h"
37
47 class OGRRawPoint
48 {
49 public:
51 OGRRawPoint() : x(0.0), y(0.0) {}
52
54 OGRRawPoint(double xIn, double yIn) : x(xIn), y(yIn) {}
55
57 double x;
59 double y;
60 };
61
63 typedef struct GEOSGeom_t *GEOSGeom;
65 typedef struct GEOSContextHandle_HS *GEOSContextHandle_t;
67 typedef void sfcgal_geometry_t;
68
69 class OGRPoint;
70 class OGRCurve;
71 class OGRCompoundCurve;
72 class OGRLinearRing;
73 class OGRLineString;
74 class OGRSurface;
75 class OGRCurvePolygon;
76 class OGRPolygon;
77 class OGRMultiSurface;
78 class OGRMultiPolygon;
79 class OGRMultiCurve;
80 class OGRMultiLineString;
81 class OGRTriangle;
82 class OGRPolyhedralSurface;
83 class OGRTriangulatedSurface;
84
86 typedef OGRLineString* (*OGRCurveCasterToLineString)(OGRCurve*);
87 typedef OGRLinearRing* (*OGRCurveCasterToLinearRing)(OGRCurve*);
88
89 typedef OGRPolygon* (*OGRSurfaceCasterToPolygon)(OGRSurface*);
90 typedef OGRCurvePolygon* (*OGRSurfaceCasterToCurvePolygon)(OGRSurface*);
91 typedef OGRMultiPolygon* (*OGRPolyhedralSurfaceCastToMultiPolygon)(OGRPolyhedralSurface*);
93
94 /************************************************************************/
95 /* OGRGeometry */
96 /************************************************************************/
97
118 class CPL_DLL OGRGeometry
119 {
120 private:
121 OGRSpatialReference * poSRS; // may be NULL
122
123 protected:
125 friend class OGRCurveCollection;
126
127 unsigned int flags;
128
129 OGRErr importPreambuleFromWkt( char ** ppszInput,
130 int* pbHasZ, int* pbHasM,
131 bool* pbIsEmpty );
132 OGRErr importCurveCollectionFromWkt(
133 char ** ppszInput,
134 int bAllowEmptyComponent,
135 int bAllowLineString,
136 int bAllowCurve,
137 int bAllowCompoundCurve,
138 OGRErr (*pfnAddCurveDirectly)(OGRGeometry* poSelf,
139 OGRCurve* poCurve) );
140 OGRErr importPreambuleFromWkb( unsigned char * pabyData,
141 int nSize,
142 OGRwkbByteOrder& eByteOrder,
143 OGRwkbVariant eWkbVariant );
144 OGRErr importPreambuleOfCollectionFromWkb(
145 unsigned char * pabyData,
146 int& nSize,
147 int& nDataOffset,
148 OGRwkbByteOrder& eByteOrder,
149 int nMinSubGeomSize,
150 int& nGeomCount,
151 OGRwkbVariant eWkbVariant );
152 OGRErr PointOnSurfaceInternal( OGRPoint * poPoint ) const;
153 OGRBoolean IsSFCGALCompatible() const;
155
156 public:
157
158 /************************************************************************/
159 /* Bit flags for OGRGeometry */
160 /* The OGR_G_NOT_EMPTY_POINT is used *only* for points. */
161 /* Do not use these outside of the core. */
162 /* Use Is3D, IsMeasured, set3D, and setMeasured instead */
163 /************************************************************************/
164
166 static const unsigned int OGR_G_NOT_EMPTY_POINT = 0x1;
167 static const unsigned int OGR_G_3D = 0x2;
168 static const unsigned int OGR_G_MEASURED = 0x4;
170
171 OGRGeometry();
172 OGRGeometry( const OGRGeometry& other );
173 virtual ~OGRGeometry();
174
175 OGRGeometry& operator=( const OGRGeometry& other );
176
177 // Standard IGeometry.
178 virtual int getDimension() const = 0;
179 virtual int getCoordinateDimension() const;
180 int CoordinateDimension() const;
181 virtual OGRBoolean IsEmpty() const = 0;
182 virtual OGRBoolean IsValid() const;
183 virtual OGRBoolean IsSimple() const;
185 OGRBoolean Is3D() const { return flags & OGR_G_3D; }
187 OGRBoolean IsMeasured() const { return flags & OGR_G_MEASURED; }
188 virtual OGRBoolean IsRing() const;
189 virtual void empty() = 0;
190 virtual OGRGeometry *clone() const CPL_WARN_UNUSED_RESULT = 0;
191 virtual void getEnvelope( OGREnvelope * psEnvelope ) const = 0;
192 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const = 0;
193
194 // IWks Interface.
195 virtual int WkbSize() const = 0;
196 virtual OGRErr importFromWkb( unsigned char *, int=-1,
197 OGRwkbVariant=wkbVariantOldOgc ) = 0;
198 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
199 OGRwkbVariant=wkbVariantOldOgc ) const = 0;
200 virtual OGRErr importFromWkt( char ** ppszInput ) = 0;
201 virtual OGRErr exportToWkt( char ** ppszDstText,
202 OGRwkbVariant=wkbVariantOldOgc ) const = 0;
203
204 // Non-standard.
205 virtual OGRwkbGeometryType getGeometryType() const = 0;
206 OGRwkbGeometryType getIsoGeometryType() const;
207 virtual const char *getGeometryName() const = 0;
208 virtual void dumpReadable( FILE *, const char * = NULL
209 , char** papszOptions = NULL ) const;
210 virtual void flattenTo2D() = 0;
211 virtual char * exportToGML( const char* const * papszOptions = NULL ) const;
212 virtual char * exportToKML() const;
213 virtual char * exportToJson() const;
214
215 static GEOSContextHandle_t createGEOSContext();
216 static void freeGEOSContext( GEOSContextHandle_t hGEOSCtxt );
217 virtual GEOSGeom exportToGEOS( GEOSContextHandle_t hGEOSCtxt )
218 const CPL_WARN_UNUSED_RESULT;
219 virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear = FALSE) const;
220 virtual OGRGeometry* getCurveGeometry(
221 const char* const* papszOptions = NULL ) const CPL_WARN_UNUSED_RESULT;
222 virtual OGRGeometry* getLinearGeometry(
223 double dfMaxAngleStepSizeDegrees = 0,
224 const char* const* papszOptions = NULL ) const CPL_WARN_UNUSED_RESULT;
225
226 // SFCGAL interfacing methods.
228 static sfcgal_geometry_t* OGRexportToSFCGAL( OGRGeometry *poGeom );
229 static OGRGeometry* SFCGALexportToOGR( sfcgal_geometry_t* _geometry );
231 virtual void closeRings();
232
233 virtual void setCoordinateDimension( int nDimension );
234 virtual void set3D( OGRBoolean bIs3D );
235 virtual void setMeasured( OGRBoolean bIsMeasured );
236
237 void assignSpatialReference( OGRSpatialReference * poSR );
238 OGRSpatialReference *getSpatialReference( void ) const { return poSRS; }
239
240 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) = 0;
241 OGRErr transformTo( OGRSpatialReference *poSR );
242
243 virtual void segmentize(double dfMaxLength);
244
245 // ISpatialRelation
246 virtual OGRBoolean Intersects( const OGRGeometry * ) const;
247 virtual OGRBoolean Equals( OGRGeometry * ) const = 0;
248 virtual OGRBoolean Disjoint( const OGRGeometry * ) const;
249 virtual OGRBoolean Touches( const OGRGeometry * ) const;
250 virtual OGRBoolean Crosses( const OGRGeometry * ) const;
251 virtual OGRBoolean Within( const OGRGeometry * ) const;
252 virtual OGRBoolean Contains( const OGRGeometry * ) const;
253 virtual OGRBoolean Overlaps( const OGRGeometry * ) const;
254 // virtual OGRBoolean Relate( const OGRGeometry *, const char * ) const;
255 // virtual OGRGeometry *LocateAlong( double mValue ) const;
256 // virtual OGRGeometry *LocateBetween( double mStart, double mEnd ) const;
257
258 virtual OGRGeometry *Boundary() const CPL_WARN_UNUSED_RESULT;
259 virtual double Distance( const OGRGeometry * ) const ;
260 virtual OGRGeometry *ConvexHull() const CPL_WARN_UNUSED_RESULT;
261 virtual OGRGeometry *Buffer( double dfDist, int nQuadSegs = 30 )
262 const CPL_WARN_UNUSED_RESULT;
263 virtual OGRGeometry *Intersection( const OGRGeometry *)
264 const CPL_WARN_UNUSED_RESULT;
265 virtual OGRGeometry *Union( const OGRGeometry * )
266 const CPL_WARN_UNUSED_RESULT;
267 virtual OGRGeometry *UnionCascaded() const CPL_WARN_UNUSED_RESULT;
268 virtual OGRGeometry *Difference( const OGRGeometry * )
269 const CPL_WARN_UNUSED_RESULT;
270 virtual OGRGeometry *SymDifference( const OGRGeometry * )
271 const CPL_WARN_UNUSED_RESULT;
272 virtual OGRErr Centroid( OGRPoint * poPoint ) const;
273 virtual OGRGeometry *Simplify(double dTolerance)
274 const CPL_WARN_UNUSED_RESULT;
275 OGRGeometry *SimplifyPreserveTopology(double dTolerance)
276 const CPL_WARN_UNUSED_RESULT;
277 virtual OGRGeometry *DelaunayTriangulation(
278 double dfTolerance, int bOnlyEdges ) const CPL_WARN_UNUSED_RESULT;
279
280 virtual OGRGeometry *Polygonize() const CPL_WARN_UNUSED_RESULT;
281
282 virtual double Distance3D( const OGRGeometry *poOtherGeom ) const;
283
285 // backward compatibility to non-standard method names.
286 OGRBoolean Intersect( OGRGeometry * )
287 const CPL_WARN_DEPRECATED("Non standard method. "
288 "Use Intersects() instead");
289 OGRBoolean Equal( OGRGeometry * )
290 const CPL_WARN_DEPRECATED("Non standard method. "
291 "Use Equals() instead");
292 OGRGeometry *SymmetricDifference( const OGRGeometry * )
293 const CPL_WARN_DEPRECATED("Non standard method. "
294 "Use SymDifference() instead");
295 OGRGeometry *getBoundary()
296 const CPL_WARN_DEPRECATED("Non standard method. "
297 "Use Boundary() instead");
299
301 // Special HACK for DB2 7.2 support
302 static int bGenerate_DB2_V72_BYTE_ORDER;
304
305 virtual void swapXY();
307 static OGRGeometry* CastToIdentity( OGRGeometry* poGeom ) { return poGeom; }
308 static OGRGeometry* CastToError( OGRGeometry* poGeom );
310 };
311
312 /************************************************************************/
313 /* OGRPoint */
314 /************************************************************************/
315
322 class CPL_DLL OGRPoint : public OGRGeometry
323 {
324 double x;
325 double y;
326 double z;
327 double m;
328
329 public:
330 OGRPoint();
331 OGRPoint( double x, double y );
332 OGRPoint( double x, double y, double z );
333 OGRPoint( double x, double y, double z, double m );
334 OGRPoint( const OGRPoint& other );
335 virtual ~OGRPoint();
336
337 OGRPoint& operator=( const OGRPoint& other );
338
339 // IWks Interface
340 virtual int WkbSize() const CPL_OVERRIDE;
341 virtual OGRErr importFromWkb( unsigned char *, int=-1,
342 OGRwkbVariant=wkbVariantOldOgc ) CPL_OVERRIDE;
343 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
344 OGRwkbVariant=wkbVariantOldOgc )
345 const CPL_OVERRIDE;
346 virtual OGRErr importFromWkt( char ** ) CPL_OVERRIDE;
347 virtual OGRErr exportToWkt( char ** ppszDstText,
348 OGRwkbVariant=wkbVariantOldOgc )
349 const CPL_OVERRIDE;
350
351 // IGeometry
352 virtual int getDimension() const CPL_OVERRIDE;
353 virtual OGRGeometry *clone() const CPL_OVERRIDE;
354 virtual void empty() CPL_OVERRIDE;
355 virtual void getEnvelope( OGREnvelope * psEnvelope ) const CPL_OVERRIDE;
356 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const CPL_OVERRIDE;
357 virtual OGRBoolean IsEmpty() const CPL_OVERRIDE
358 { return !(flags & OGR_G_NOT_EMPTY_POINT); }
359
360 // IPoint
362 double getX() const { return x; }
364 double getY() const { return y; }
366 double getZ() const { return z; }
368 double getM() const { return m; }
369
370 // Non standard
371 virtual void setCoordinateDimension( int nDimension ) CPL_OVERRIDE;
375 void setX( double xIn ) { x = xIn; flags |= OGR_G_NOT_EMPTY_POINT; }
379 void setY( double yIn ) { y = yIn; flags |= OGR_G_NOT_EMPTY_POINT; }
383 void setZ( double zIn )
384 { z = zIn; flags |= (OGR_G_NOT_EMPTY_POINT | OGR_G_3D); }
388 void setM( double mIn )
389 { m = mIn; flags |= (OGR_G_NOT_EMPTY_POINT | OGR_G_MEASURED); }
390
391 // ISpatialRelation
392 virtual OGRBoolean Equals( OGRGeometry * ) const CPL_OVERRIDE;
393 virtual OGRBoolean Intersects( const OGRGeometry * ) const CPL_OVERRIDE;
394 virtual OGRBoolean Within( const OGRGeometry * ) const CPL_OVERRIDE;
395
396 // Non standard from OGRGeometry
397 virtual const char *getGeometryName() const CPL_OVERRIDE;
398 virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE;
399 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) CPL_OVERRIDE;
400 virtual void flattenTo2D() CPL_OVERRIDE;
401
402 virtual void swapXY() CPL_OVERRIDE;
403 };
404
405 /************************************************************************/
406 /* OGRPointIterator */
407 /************************************************************************/
408
415 class CPL_DLL OGRPointIterator
416 {
417 public:
418 virtual ~OGRPointIterator();
419 virtual OGRBoolean getNextPoint( OGRPoint* p ) = 0;
420
421 static void destroy( OGRPointIterator* );
422 };
423
424 /************************************************************************/
425 /* OGRCurve */
426 /************************************************************************/
427
433 class CPL_DLL OGRCurve : public OGRGeometry
434 {
435 protected:
437 OGRCurve();
438 OGRCurve( const OGRCurve& other );
439
440 virtual OGRCurveCasterToLineString GetCasterToLineString() const = 0;
441 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing() const = 0;
442
443 friend class OGRCurvePolygon;
444 friend class OGRCompoundCurve;
446 virtual int ContainsPoint( const OGRPoint* p ) const;
447 virtual double get_AreaOfCurveSegments() const = 0;
448
449 public:
450 virtual ~OGRCurve();
451
453 OGRCurve& operator=( const OGRCurve& other );
455
456 // ICurve methods
457 virtual double get_Length() const = 0;
458 virtual void StartPoint( OGRPoint * ) const = 0;
459 virtual void EndPoint( OGRPoint * ) const = 0;
460 virtual int get_IsClosed() const;
461 virtual void Value( double, OGRPoint * ) const = 0;
462 virtual OGRLineString* CurveToLine( double dfMaxAngleStepSizeDegrees = 0,
463 const char* const* papszOptions = NULL)
464 const = 0;
465 virtual int getDimension() const CPL_OVERRIDE;
466
467 // non standard
468 virtual int getNumPoints() const = 0;
469 virtual OGRPointIterator* getPointIterator() const = 0;
470 virtual OGRBoolean IsConvex() const;
471 virtual double get_Area() const = 0;
472
473 static OGRCompoundCurve* CastToCompoundCurve( OGRCurve* puCurve );
474 static OGRLineString* CastToLineString( OGRCurve* poCurve );
475 static OGRLinearRing* CastToLinearRing( OGRCurve* poCurve );
476 };
477
478 /************************************************************************/
479 /* OGRSimpleCurve */
480 /************************************************************************/
481
491 class CPL_DLL OGRSimpleCurve: public OGRCurve
492 {
493 protected:
495 friend class OGRGeometry;
496
497 int nPointCount;
498 OGRRawPoint *paoPoints;
499 double *padfZ;
500 double *padfM;
501
502 void Make3D();
503 void Make2D();
504 void RemoveM();
505 void AddM();
506
507 OGRErr importFromWKTListOnly( char ** ppszInput, int bHasZ, int bHasM,
508 OGRRawPoint*& paoPointsIn,
509 int& nMaxPoints,
510 double*& padfZIn );
511
513
514 virtual double get_LinearArea() const;
515
516 OGRSimpleCurve();
517 OGRSimpleCurve( const OGRSimpleCurve& other );
518
519 public:
520 virtual ~OGRSimpleCurve();
521
522 OGRSimpleCurve& operator=( const OGRSimpleCurve& other );
523
524 // IWks Interface.
525 virtual int WkbSize() const CPL_OVERRIDE;
526 virtual OGRErr importFromWkb( unsigned char *, int = -1,
527 OGRwkbVariant=wkbVariantOldOgc ) CPL_OVERRIDE;
528 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
529 OGRwkbVariant=wkbVariantOldOgc )
530 const CPL_OVERRIDE;
531 virtual OGRErr importFromWkt( char ** ) CPL_OVERRIDE;
532 virtual OGRErr exportToWkt( char ** ppszDstText,
533 OGRwkbVariant=wkbVariantOldOgc )
534 const CPL_OVERRIDE;
535
536 // IGeometry interface.
537 virtual OGRGeometry *clone() const CPL_OVERRIDE;
538 virtual void empty() CPL_OVERRIDE;
539 virtual void getEnvelope( OGREnvelope * psEnvelope ) const CPL_OVERRIDE;
540 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const CPL_OVERRIDE;
541 virtual OGRBoolean IsEmpty() const CPL_OVERRIDE;
542
543 // ICurve methods.
544 virtual double get_Length() const CPL_OVERRIDE;
545 virtual void StartPoint( OGRPoint * ) const CPL_OVERRIDE;
546 virtual void EndPoint( OGRPoint * ) const CPL_OVERRIDE;
547 virtual void Value( double, OGRPoint * ) const CPL_OVERRIDE;
548 virtual double Project( const OGRPoint * ) const;
549 virtual OGRLineString* getSubLine( double, double, int ) const;
550
551 // ILineString methods.
552 virtual int getNumPoints() const CPL_OVERRIDE { return nPointCount; }
553 void getPoint( int, OGRPoint * ) const;
554 double getX( int i ) const { return paoPoints[i].x; }
555 double getY( int i ) const { return paoPoints[i].y; }
556 double getZ( int i ) const;
557 double getM( int i ) const;
558
559 // ISpatialRelation
560 virtual OGRBoolean Equals( OGRGeometry * ) const CPL_OVERRIDE;
561
562 // non standard.
563 virtual void setCoordinateDimension( int nDimension ) CPL_OVERRIDE;
564 virtual void set3D( OGRBoolean bIs3D ) CPL_OVERRIDE;
565 virtual void setMeasured( OGRBoolean bIsMeasured ) CPL_OVERRIDE;
566 void setNumPoints( int nNewPointCount,
567 int bZeroizeNewContent = TRUE );
568 void setPoint( int, OGRPoint * );
569 void setPoint( int, double, double );
570 void setZ( int, double );
571 void setM( int, double );
572 void setPoint( int, double, double, double );
573 void setPointM( int, double, double, double );
574 void setPoint( int, double, double, double, double );
575 void setPoints( int, OGRRawPoint *, double * = NULL );
576 void setPointsM( int, OGRRawPoint *, double * );
577 void setPoints( int, OGRRawPoint *, double *, double * );
578 void setPoints( int, double * padfX, double * padfY,
579 double *padfZIn = NULL );
580 void setPointsM( int, double * padfX, double * padfY,
581 double *padfMIn = NULL );
582 void setPoints( int, double * padfX, double * padfY,
583 double *padfZIn, double *padfMIn );
584 void addPoint( const OGRPoint * );
585 void addPoint( double, double );
586 void addPoint( double, double, double );
587 void addPointM( double, double, double );
588 void addPoint( double, double, double, double );
589
590 void getPoints( OGRRawPoint *, double * = NULL ) const;
591 void getPoints( void* pabyX, int nXStride,
592 void* pabyY, int nYStride,
593 void* pabyZ = NULL, int nZStride = 0 ) const;
594 void getPoints( void* pabyX, int nXStride,
595 void* pabyY, int nYStride,
596 void* pabyZ, int nZStride,
597 void* pabyM, int nMStride ) const;
598
599 void addSubLineString( const OGRLineString *,
600 int nStartVertex = 0, int nEndVertex = -1 );
601 void reversePoints( void );
602 virtual OGRPointIterator* getPointIterator() const CPL_OVERRIDE;
603
604 // non-standard from OGRGeometry
605 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) CPL_OVERRIDE;
606 virtual void flattenTo2D() CPL_OVERRIDE;
607 virtual void segmentize(double dfMaxLength) CPL_OVERRIDE;
608
609 virtual void swapXY() CPL_OVERRIDE;
610 };
611
612 /************************************************************************/
613 /* OGRLineString */
614 /************************************************************************/
615
623 class CPL_DLL OGRLineString : public OGRSimpleCurve
624 {
625 protected:
627 static OGRLineString* TransferMembersAndDestroy(
628 OGRLineString* poSrc,
629 OGRLineString* poDst);
630
631 virtual OGRCurveCasterToLineString GetCasterToLineString()
632 const CPL_OVERRIDE;
633 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
634 const CPL_OVERRIDE;
635
636 virtual double get_AreaOfCurveSegments() const CPL_OVERRIDE;
638
639 static OGRLinearRing* CastToLinearRing( OGRLineString* poLS );
640
641 public:
642 OGRLineString();
643 OGRLineString( const OGRLineString& other );
644 virtual ~OGRLineString();
645
646 OGRLineString& operator=(const OGRLineString& other);
647
648 virtual OGRLineString* CurveToLine( double dfMaxAngleStepSizeDegrees = 0,
649 const char* const* papszOptions = NULL )
650 const CPL_OVERRIDE;
651 virtual OGRGeometry* getCurveGeometry(
652 const char* const* papszOptions = NULL ) const CPL_OVERRIDE;
653 virtual double get_Area() const CPL_OVERRIDE;
654
655 // Non-standard from OGRGeometry.
656 virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE;
657 virtual const char *getGeometryName() const CPL_OVERRIDE;
658 };
659
660 /************************************************************************/
661 /* OGRLinearRing */
662 /************************************************************************/
663
684 class CPL_DLL OGRLinearRing : public OGRLineString
685 {
686 protected:
688 friend class OGRPolygon;
689 friend class OGRTriangle;
690
691 // These are not IWks compatible ... just a convenience for OGRPolygon.
692 virtual int _WkbSize( int _flags ) const;
693 virtual OGRErr _importFromWkb( OGRwkbByteOrder, int _flags,
694 unsigned char *, int=-1 );
695 virtual OGRErr _exportToWkb( OGRwkbByteOrder, int _flags,
696 unsigned char * ) const;
697
698 virtual OGRCurveCasterToLineString GetCasterToLineString()
699 const CPL_OVERRIDE;
700 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
701 const CPL_OVERRIDE;
703
704 static OGRLineString* CastToLineString( OGRLinearRing* poLR );
705
706 public:
707 OGRLinearRing();
708 OGRLinearRing( const OGRLinearRing& other );
709 explicit OGRLinearRing( OGRLinearRing * );
710 virtual ~OGRLinearRing();
711
712 OGRLinearRing& operator=( const OGRLinearRing& other );
713
714 // Non standard.
715 virtual const char *getGeometryName() const CPL_OVERRIDE;
716 virtual OGRGeometry *clone() const CPL_OVERRIDE;
717 virtual int isClockwise() const;
718 virtual void reverseWindingOrder();
719 virtual void closeRings() CPL_OVERRIDE;
720 OGRBoolean isPointInRing( const OGRPoint* pt,
721 int bTestEnvelope = TRUE ) const;
722 OGRBoolean isPointOnRingBoundary( const OGRPoint* pt,
723 int bTestEnvelope = TRUE ) const;
724 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) CPL_OVERRIDE;
725
726 // IWks Interface - Note this isn't really a first class object
727 // for the purposes of WKB form. These methods always fail since this
728 // object can't be serialized on its own.
729 virtual int WkbSize() const CPL_OVERRIDE;
730 virtual OGRErr importFromWkb( unsigned char *, int=-1,
731 OGRwkbVariant=wkbVariantOldOgc ) CPL_OVERRIDE;
732 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
733 OGRwkbVariant=wkbVariantOldOgc )
734 const CPL_OVERRIDE;
735 };
736
737 /************************************************************************/
738 /* OGRCircularString */
739 /************************************************************************/
740
753 class CPL_DLL OGRCircularString : public OGRSimpleCurve
754 {
755 private:
756 void ExtendEnvelopeWithCircular( OGREnvelope * psEnvelope ) const;
757 OGRBoolean IsValidFast() const;
758 int IsFullCircle( double& cx, double& cy, double& square_R ) const;
759
760 protected:
762 virtual OGRCurveCasterToLineString GetCasterToLineString()
763 const CPL_OVERRIDE;
764 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
765 const CPL_OVERRIDE;
766 virtual int ContainsPoint( const OGRPoint* p ) const CPL_OVERRIDE;
767 virtual double get_AreaOfCurveSegments() const CPL_OVERRIDE;
769
770 public:
771 OGRCircularString();
772 OGRCircularString(const OGRCircularString& other);
773 virtual ~OGRCircularString();
774
775 OGRCircularString& operator=(const OGRCircularString& other);
776
777 // IWks Interface.
778 virtual OGRErr importFromWkb( unsigned char *, int = -1,
779 OGRwkbVariant=wkbVariantOldOgc ) CPL_OVERRIDE;
780 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
781 OGRwkbVariant=wkbVariantOldOgc )
782 const CPL_OVERRIDE;
783 virtual OGRErr importFromWkt( char ** ) CPL_OVERRIDE;
784 virtual OGRErr exportToWkt( char ** ppszDstText,
785 OGRwkbVariant=wkbVariantOldOgc )
786 const CPL_OVERRIDE;
787
788 // IGeometry interface.
789 virtual OGRBoolean IsValid() const CPL_OVERRIDE;
790 virtual void getEnvelope( OGREnvelope * psEnvelope ) const CPL_OVERRIDE;
791 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const CPL_OVERRIDE;
792
793 // ICurve methods.
794 virtual double get_Length() const CPL_OVERRIDE;
795 virtual OGRLineString* CurveToLine( double dfMaxAngleStepSizeDegrees = 0,
796 const char* const* papszOptions = NULL )
797 const CPL_OVERRIDE;
798 virtual void Value( double, OGRPoint * ) const CPL_OVERRIDE;
799 virtual double get_Area() const CPL_OVERRIDE;
800
801 // Non-standard from OGRGeometry.
802 virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE;
803 virtual const char *getGeometryName() const CPL_OVERRIDE;
804 virtual void segmentize( double dfMaxLength ) CPL_OVERRIDE;
805 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
806 const CPL_OVERRIDE;
807 virtual OGRGeometry* getLinearGeometry(
808 double dfMaxAngleStepSizeDegrees = 0,
809 const char* const* papszOptions = NULL) const CPL_OVERRIDE;
810 };
811
812 /************************************************************************/
813 /* OGRCurveCollection */
814 /************************************************************************/
815
826 class CPL_DLL OGRCurveCollection
828 {
829 protected:
830 friend class OGRCompoundCurve;
831 friend class OGRCurvePolygon;
832 friend class OGRPolygon;
833 friend class OGRTriangle;
834
835 int nCurveCount;
836 OGRCurve **papoCurves;
837
838 public:
839 OGRCurveCollection();
840 OGRCurveCollection(const OGRCurveCollection& other);
841 ~OGRCurveCollection();
842
843 OGRCurveCollection& operator=(const OGRCurveCollection& other);
844
845 void empty(OGRGeometry* poGeom);
846 OGRBoolean IsEmpty() const;
847 void getEnvelope( OGREnvelope * psEnvelope ) const;
848 void getEnvelope( OGREnvelope3D * psEnvelope ) const;
849
850 OGRErr addCurveDirectly( OGRGeometry* poGeom, OGRCurve* poCurve,
851 int bNeedRealloc );
852 int WkbSize() const;
853 OGRErr importPreambuleFromWkb( OGRGeometry* poGeom,
854 unsigned char * pabyData,
855 int& nSize,
856 int& nDataOffset,
857 OGRwkbByteOrder& eByteOrder,
858 int nMinSubGeomSize,
859 OGRwkbVariant eWkVariant );
860 OGRErr importBodyFromWkb(
861 OGRGeometry* poGeom,
862 unsigned char * pabyData,
863 int nSize,
864 int nDataOffset,
865 int bAcceptCompoundCurve,
866 OGRErr (*pfnAddCurveDirectlyFromWkb)( OGRGeometry* poGeom,
867 OGRCurve* poCurve ),
868 OGRwkbVariant eWkVariant );
869 OGRErr exportToWkt( const OGRGeometry* poGeom,
870 char ** ppszDstText ) const;
871 OGRErr exportToWkb( const OGRGeometry* poGeom, OGRwkbByteOrder,
872 unsigned char *,
873 OGRwkbVariant eWkbVariant ) const;
874 OGRBoolean Equals(OGRCurveCollection *poOCC) const;
875 void setCoordinateDimension( OGRGeometry* poGeom,
876 int nNewDimension );
877 void set3D( OGRGeometry* poGeom, OGRBoolean bIs3D );
878 void setMeasured( OGRGeometry* poGeom, OGRBoolean bIsMeasured );
879 int getNumCurves() const;
880 OGRCurve *getCurve( int );
881 const OGRCurve *getCurve( int ) const;
882 OGRCurve *stealCurve( int );
883 OGRErr transform( OGRGeometry* poGeom,
884 OGRCoordinateTransformation *poCT );
885 void flattenTo2D( OGRGeometry* poGeom );
886 void segmentize( double dfMaxLength );
887 void swapXY();
888 OGRBoolean hasCurveGeometry(int bLookForNonLinear) const;
889 };
891
892 /************************************************************************/
893 /* OGRCompoundCurve */
894 /************************************************************************/
895
906 class CPL_DLL OGRCompoundCurve : public OGRCurve
907 {
908 private:
909 OGRCurveCollection oCC;
910
911 OGRErr addCurveDirectlyInternal( OGRCurve* poCurve,
912 double dfToleranceEps,
913 int bNeedRealloc );
914 static OGRErr addCurveDirectlyFromWkt( OGRGeometry* poSelf,
915 OGRCurve* poCurve );
916 static OGRErr addCurveDirectlyFromWkb( OGRGeometry* poSelf,
917 OGRCurve* poCurve );
918 OGRLineString* CurveToLineInternal( double dfMaxAngleStepSizeDegrees,
919 const char* const* papszOptions,
920 int bIsLinearRing ) const;
921
922 protected:
924 static OGRLineString* CastToLineString( OGRCompoundCurve* poCC );
925 static OGRLinearRing* CastToLinearRing( OGRCompoundCurve* poCC );
926
927 virtual OGRCurveCasterToLineString GetCasterToLineString()
928 const CPL_OVERRIDE;
929 virtual OGRCurveCasterToLinearRing GetCasterToLinearRing()
930 const CPL_OVERRIDE;
932
933 public:
934 OGRCompoundCurve();
935 OGRCompoundCurve( const OGRCompoundCurve& other );
936 virtual ~OGRCompoundCurve();
937
938 OGRCompoundCurve& operator=( const OGRCompoundCurve& other );
939
940 // IWks Interface
941 virtual int WkbSize() const CPL_OVERRIDE;
942 virtual OGRErr importFromWkb( unsigned char *, int = -1,
943 OGRwkbVariant=wkbVariantOldOgc ) CPL_OVERRIDE;
944 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
945 OGRwkbVariant=wkbVariantOldOgc )
946 const CPL_OVERRIDE;
947 virtual OGRErr importFromWkt( char ** ) CPL_OVERRIDE;
948 virtual OGRErr exportToWkt( char ** ppszDstText,
949 OGRwkbVariant=wkbVariantOldOgc )
950 const CPL_OVERRIDE;
951
952 // IGeometry interface.
953 virtual OGRGeometry *clone() const CPL_OVERRIDE;
954 virtual void empty() CPL_OVERRIDE;
955 virtual void getEnvelope( OGREnvelope * psEnvelope ) const CPL_OVERRIDE;
956 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const CPL_OVERRIDE;
957 virtual OGRBoolean IsEmpty() const CPL_OVERRIDE;
958
959 // ICurve methods.
960 virtual double get_Length() const CPL_OVERRIDE;
961 virtual void StartPoint( OGRPoint * ) const CPL_OVERRIDE;
962 virtual void EndPoint( OGRPoint * ) const CPL_OVERRIDE;
963 virtual void Value( double, OGRPoint * ) const CPL_OVERRIDE;
964 virtual OGRLineString* CurveToLine( double dfMaxAngleStepSizeDegrees = 0,
965 const char* const* papszOptions = NULL )
966 const CPL_OVERRIDE;
967
968 virtual int getNumPoints() const CPL_OVERRIDE;
969 virtual double get_AreaOfCurveSegments() const CPL_OVERRIDE;
970 virtual double get_Area() const CPL_OVERRIDE;
971
972 // ISpatialRelation.
973 virtual OGRBoolean Equals( OGRGeometry * ) const CPL_OVERRIDE;
974
975 // ICompoundCurve method.
976 int getNumCurves() const;
977 OGRCurve *getCurve( int );
978 const OGRCurve *getCurve( int ) const;
979
980 // Non-standard.
981 virtual void setCoordinateDimension( int nDimension ) CPL_OVERRIDE;
982 virtual void set3D( OGRBoolean bIs3D ) CPL_OVERRIDE;
983 virtual void setMeasured( OGRBoolean bIsMeasured ) CPL_OVERRIDE;
984
985 OGRErr addCurve( OGRCurve*, double dfToleranceEps = 1e-14 );
986 OGRErr addCurveDirectly( OGRCurve*, double dfToleranceEps = 1e-14 );
987 OGRCurve *stealCurve( int );
988 virtual OGRPointIterator* getPointIterator() const CPL_OVERRIDE;
989
990 // Non-standard from OGRGeometry.
991 virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE;
992 virtual const char *getGeometryName() const CPL_OVERRIDE;
993 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) CPL_OVERRIDE;
994 virtual void flattenTo2D() CPL_OVERRIDE;
995 virtual void segmentize(double dfMaxLength) CPL_OVERRIDE;
996 virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear = FALSE)
997 const CPL_OVERRIDE;
998 virtual OGRGeometry* getLinearGeometry(
999 double dfMaxAngleStepSizeDegrees = 0,
1000 const char* const* papszOptions = NULL) const CPL_OVERRIDE;
1001
1002 virtual void swapXY() CPL_OVERRIDE;
1003 };
1004
1005 /************************************************************************/
1006 /* OGRSurface */
1007 /************************************************************************/
1008
1014 class CPL_DLL OGRSurface : public OGRGeometry
1015 {
1016 protected:
1018 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon() const = 0;
1019 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon() const = 0;
1021
1022 public:
1023 virtual double get_Area() const = 0;
1024 virtual OGRErr PointOnSurface( OGRPoint * poPoint ) const = 0;
1026 static OGRPolygon* CastToPolygon(OGRSurface* poSurface);
1027 static OGRCurvePolygon* CastToCurvePolygon(OGRSurface* poSurface);
1029 };
1030
1031 /************************************************************************/
1032 /* OGRCurvePolygon */
1033 /************************************************************************/
1034
1048 class CPL_DLL OGRCurvePolygon : public OGRSurface
1049 {
1050 private:
1051 OGRBoolean ContainsPoint( const OGRPoint* p ) const;
1052 virtual int checkRing( OGRCurve * poNewRing ) const;
1053 OGRErr addRingDirectlyInternal( OGRCurve* poCurve,
1054 int bNeedRealloc );
1055 static OGRErr addCurveDirectlyFromWkt( OGRGeometry* poSelf,
1056 OGRCurve* poCurve );
1057 static OGRErr addCurveDirectlyFromWkb( OGRGeometry* poSelf,
1058 OGRCurve* poCurve );
1059
1060 protected:
1062 friend class OGRPolygon;
1063 friend class OGRTriangle;
1064 OGRCurveCollection oCC;
1065
1066 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
1067 const CPL_OVERRIDE;
1068 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
1069 const CPL_OVERRIDE;
1071
1072 static OGRPolygon* CastToPolygon( OGRCurvePolygon* poCP );
1073
1074 public:
1075 OGRCurvePolygon();
1076 OGRCurvePolygon( const OGRCurvePolygon& );
1077 virtual ~OGRCurvePolygon();
1078
1079 OGRCurvePolygon& operator=( const OGRCurvePolygon& other );
1080
1081 // Non standard (OGRGeometry).
1082 virtual const char *getGeometryName() const CPL_OVERRIDE;
1083 virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE;
1084 virtual OGRGeometry *clone() const CPL_OVERRIDE;
1085 virtual void empty() CPL_OVERRIDE;
1086 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) CPL_OVERRIDE;
1087 virtual void flattenTo2D() CPL_OVERRIDE;
1088 virtual OGRBoolean IsEmpty() const CPL_OVERRIDE;
1089 virtual void segmentize( double dfMaxLength ) CPL_OVERRIDE;
1090 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
1091 const CPL_OVERRIDE;
1092 virtual OGRGeometry* getLinearGeometry(
1093 double dfMaxAngleStepSizeDegrees = 0,
1094 const char* const* papszOptions = NULL ) const CPL_OVERRIDE;
1095
1096 // ISurface Interface
1097 virtual double get_Area() const CPL_OVERRIDE;
1098 virtual OGRErr PointOnSurface( OGRPoint * poPoint ) const CPL_OVERRIDE;
1099
1100 // IWks Interface
1101 virtual int WkbSize() const CPL_OVERRIDE;
1102 virtual OGRErr importFromWkb( unsigned char *, int = -1,
1103 OGRwkbVariant=wkbVariantOldOgc ) CPL_OVERRIDE;
1104 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1105 OGRwkbVariant=wkbVariantOldOgc )
1106 const CPL_OVERRIDE;
1107 virtual OGRErr importFromWkt( char ** ) CPL_OVERRIDE;
1108 virtual OGRErr exportToWkt( char ** ppszDstText,
1109 OGRwkbVariant eWkbVariant = wkbVariantOldOgc )
1110 const CPL_OVERRIDE;
1111
1112 // IGeometry
1113 virtual int getDimension() const CPL_OVERRIDE;
1114 virtual void getEnvelope( OGREnvelope * psEnvelope ) const CPL_OVERRIDE;
1115 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const CPL_OVERRIDE;
1116
1117 // ICurvePolygon
1118 virtual OGRPolygon* CurvePolyToPoly(
1119 double dfMaxAngleStepSizeDegrees = 0,
1120 const char* const* papszOptions = NULL ) const;
1121
1122 // ISpatialRelation
1123 virtual OGRBoolean Equals( OGRGeometry * ) const CPL_OVERRIDE;
1124 virtual OGRBoolean Intersects( const OGRGeometry * ) const CPL_OVERRIDE;
1125 virtual OGRBoolean Contains( const OGRGeometry * ) const CPL_OVERRIDE;
1126
1127 // Non standard
1128 virtual void setCoordinateDimension( int nDimension ) CPL_OVERRIDE;
1129 virtual void set3D( OGRBoolean bIs3D ) CPL_OVERRIDE;
1130 virtual void setMeasured( OGRBoolean bIsMeasured ) CPL_OVERRIDE;
1131
1132 virtual OGRErr addRing( OGRCurve * );
1133 virtual OGRErr addRingDirectly( OGRCurve * );
1134
1135 OGRCurve *getExteriorRingCurve();
1136 const OGRCurve *getExteriorRingCurve() const;
1137 int getNumInteriorRings() const;
1138 OGRCurve *getInteriorRingCurve( int );
1139 const OGRCurve *getInteriorRingCurve( int ) const;
1140
1141 OGRCurve *stealExteriorRingCurve();
1142
1143 virtual void swapXY() CPL_OVERRIDE;
1144 };
1145
1146 /************************************************************************/
1147 /* OGRPolygon */
1148 /************************************************************************/
1149
1159 class CPL_DLL OGRPolygon : public OGRCurvePolygon
1160 {
1161 protected:
1163 friend class OGRMultiSurface;
1164 friend class OGRPolyhedralSurface;
1165 friend class OGRTriangulatedSurface;
1166
1167 virtual int checkRing( OGRCurve * poNewRing ) const CPL_OVERRIDE;
1168 virtual OGRErr importFromWKTListOnly( char ** ppszInput,
1169 int bHasZ, int bHasM,
1170 OGRRawPoint*& paoPoints,
1171 int& nMaxPoints,
1172 double*& padfZ );
1173
1174 static OGRCurvePolygon* CastToCurvePolygon(OGRPolygon* poPoly);
1175
1176 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
1177 const CPL_OVERRIDE;
1178 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
1179 const CPL_OVERRIDE;
1181
1182 public:
1183 OGRPolygon();
1184 OGRPolygon(const OGRPolygon& other);
1185 virtual ~OGRPolygon();
1186
1187 OGRPolygon& operator=(const OGRPolygon& other);
1188
1189 // Non-standard (OGRGeometry).
1190 virtual const char *getGeometryName() const CPL_OVERRIDE;
1191 virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE;
1192 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
1193 const CPL_OVERRIDE;
1194 virtual OGRGeometry* getCurveGeometry(
1195 const char* const* papszOptions = NULL ) const CPL_OVERRIDE;
1196 virtual OGRGeometry* getLinearGeometry(
1197 double dfMaxAngleStepSizeDegrees = 0,
1198 const char* const* papszOptions = NULL) const CPL_OVERRIDE;
1199
1200 // ISurface Interface.
1201 virtual OGRErr PointOnSurface( OGRPoint * poPoint )
1202 const CPL_OVERRIDE;
1203
1204 // IWks Interface.
1205 virtual int WkbSize() const CPL_OVERRIDE;
1206 virtual OGRErr importFromWkb( unsigned char *, int = -1,
1207 OGRwkbVariant=wkbVariantOldOgc ) CPL_OVERRIDE;
1208 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1209 OGRwkbVariant=wkbVariantOldOgc )
1210 const CPL_OVERRIDE;
1211 virtual OGRErr importFromWkt( char ** ) CPL_OVERRIDE;
1212 virtual OGRErr exportToWkt( char ** ppszDstText,
1213 OGRwkbVariant=wkbVariantOldOgc )
1214 const CPL_OVERRIDE;
1215
1216 // ICurvePolygon.
1217 virtual OGRPolygon* CurvePolyToPoly(
1218 double dfMaxAngleStepSizeDegrees = 0,
1219 const char* const* papszOptions = NULL ) const CPL_OVERRIDE;
1220
1221 OGRLinearRing *getExteriorRing();
1222 const OGRLinearRing *getExteriorRing() const;
1223 virtual OGRLinearRing *getInteriorRing( int );
1224 virtual const OGRLinearRing *getInteriorRing( int ) const;
1225
1226 OGRLinearRing *stealExteriorRing();
1227 virtual OGRLinearRing *stealInteriorRing(int);
1228
1229 OGRBoolean IsPointOnSurface( const OGRPoint * ) const;
1230
1231 virtual void closeRings() CPL_OVERRIDE;
1232 };
1233
1234 /************************************************************************/
1235 /* OGRTriangle */
1236 /************************************************************************/
1237
1244 class CPL_DLL OGRTriangle : public OGRPolygon
1245 {
1246 private:
1247 bool quickValidityCheck() const;
1248
1249 protected:
1251 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon() const CPL_OVERRIDE;
1252 virtual OGRErr importFromWKTListOnly( char ** ppszInput,
1253 int bHasZ, int bHasM,
1254 OGRRawPoint*& paoPoints,
1255 int& nMaxPoints,
1256 double*& padfZ ) CPL_OVERRIDE;
1258
1259 public:
1260 OGRTriangle();
1261 OGRTriangle( const OGRPoint &p, const OGRPoint &q, const OGRPoint &r );
1262 OGRTriangle( const OGRTriangle &other );
1263 OGRTriangle( const OGRPolygon &other, OGRErr &eErr );
1264 OGRTriangle& operator=( const OGRTriangle& other );
1265 virtual ~OGRTriangle();
1266 virtual const char *getGeometryName() const CPL_OVERRIDE;
1267 virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE;
1268
1269 // IWks Interface.
1270 virtual OGRErr importFromWkb( unsigned char *, int = -1,
1271 OGRwkbVariant=wkbVariantOldOgc ) CPL_OVERRIDE;
1272
1273 // New methods rewritten from OGRPolygon/OGRCurvePolygon/OGRGeometry.
1274 virtual OGRErr addRingDirectly( OGRCurve * poNewRing ) CPL_OVERRIDE;
1275
1277 static OGRGeometry* CastToPolygon( OGRGeometry* poGeom );
1279 };
1280
1281 /************************************************************************/
1282 /* OGRGeometryCollection */
1283 /************************************************************************/
1284
1292 class CPL_DLL OGRGeometryCollection : public OGRGeometry
1293 {
1294 OGRErr importFromWkbInternal( unsigned char * pabyData, int nSize,
1295 int nRecLevel,
1296 OGRwkbVariant );
1297 OGRErr importFromWktInternal( char **ppszInput, int nRecLevel );
1298
1299 protected:
1301 int nGeomCount;
1302 OGRGeometry **papoGeoms;
1303
1304 OGRErr exportToWktInternal( char ** ppszDstText,
1305 OGRwkbVariant eWkbVariant,
1306 const char* pszSkipPrefix ) const;
1307 static OGRGeometryCollection* TransferMembersAndDestroy(
1308 OGRGeometryCollection* poSrc,
1309 OGRGeometryCollection* poDst );
1311 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType ) const;
1312
1313 public:
1314 OGRGeometryCollection();
1315 OGRGeometryCollection( const OGRGeometryCollection& other );
1316 virtual ~OGRGeometryCollection();
1317
1318 OGRGeometryCollection& operator=( const OGRGeometryCollection& other );
1319
1320 // Non standard (OGRGeometry).
1321 virtual const char *getGeometryName() const CPL_OVERRIDE;
1322 virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE;
1323 virtual OGRGeometry *clone() const CPL_OVERRIDE;
1324 virtual void empty() CPL_OVERRIDE;
1325 virtual OGRErr transform( OGRCoordinateTransformation *poCT ) CPL_OVERRIDE;
1326 virtual void flattenTo2D() CPL_OVERRIDE;
1327 virtual OGRBoolean IsEmpty() const CPL_OVERRIDE;
1328 virtual void segmentize(double dfMaxLength) CPL_OVERRIDE;
1329 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
1330 const CPL_OVERRIDE;
1331 virtual OGRGeometry* getCurveGeometry(
1332 const char* const* papszOptions = NULL ) const CPL_OVERRIDE;
1333 virtual OGRGeometry* getLinearGeometry(
1334 double dfMaxAngleStepSizeDegrees = 0,
1335 const char* const* papszOptions = NULL ) const CPL_OVERRIDE;
1336
1337 // IWks Interface
1338 virtual int WkbSize() const CPL_OVERRIDE;
1339 virtual OGRErr importFromWkb( unsigned char *, int = -1,
1340 OGRwkbVariant=wkbVariantOldOgc ) CPL_OVERRIDE;
1341 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1342 OGRwkbVariant=wkbVariantOldOgc )
1343 const CPL_OVERRIDE;
1344 virtual OGRErr importFromWkt( char ** ) CPL_OVERRIDE;
1345 virtual OGRErr exportToWkt( char ** ppszDstText,
1346 OGRwkbVariant=wkbVariantOldOgc )
1347 const CPL_OVERRIDE;
1348
1349 virtual double get_Length() const;
1350 virtual double get_Area() const;
1351
1352 // IGeometry methods
1353 virtual int getDimension() const CPL_OVERRIDE;
1354 virtual void getEnvelope( OGREnvelope * psEnvelope ) const CPL_OVERRIDE;
1355 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const CPL_OVERRIDE;
1356
1357 // IGeometryCollection
1358 int getNumGeometries() const;
1359 OGRGeometry *getGeometryRef( int );
1360 const OGRGeometry *getGeometryRef( int ) const;
1361
1362 // ISpatialRelation
1363 virtual OGRBoolean Equals( OGRGeometry * ) const CPL_OVERRIDE;
1364
1365 // Non standard
1366 virtual void setCoordinateDimension( int nDimension ) CPL_OVERRIDE;
1367 virtual void set3D( OGRBoolean bIs3D ) CPL_OVERRIDE;
1368 virtual void setMeasured( OGRBoolean bIsMeasured ) CPL_OVERRIDE;
1369 virtual OGRErr addGeometry( const OGRGeometry * );
1370 virtual OGRErr addGeometryDirectly( OGRGeometry * );
1371 virtual OGRErr removeGeometry( int iIndex, int bDelete = TRUE );
1372
1373 void closeRings() CPL_OVERRIDE;
1374
1375 virtual void swapXY() CPL_OVERRIDE;
1376
1377 static OGRGeometryCollection* CastToGeometryCollection(
1378 OGRGeometryCollection* poSrc );
1379 };
1380
1381 /************************************************************************/
1382 /* OGRMultiSurface */
1383 /************************************************************************/
1384
1391 class CPL_DLL OGRMultiSurface : public OGRGeometryCollection
1392 {
1393 protected:
1394 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
1395 const CPL_OVERRIDE;
1396
1397 public:
1398 OGRMultiSurface();
1399 OGRMultiSurface( const OGRMultiSurface& other );
1400 virtual ~OGRMultiSurface();
1401
1402 OGRMultiSurface& operator=( const OGRMultiSurface& other );
1403
1404 // Non standard (OGRGeometry).
1405 virtual const char *getGeometryName() const CPL_OVERRIDE;
1406 virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE;
1407 virtual OGRErr importFromWkt( char ** ) CPL_OVERRIDE;
1408 virtual OGRErr exportToWkt( char **, OGRwkbVariant=wkbVariantOldOgc )
1409 const CPL_OVERRIDE;
1410
1411 // IMultiSurface methods
1412 virtual OGRErr PointOnSurface( OGRPoint * poPoint ) const;
1413
1414 // IGeometry methods
1415 virtual int getDimension() const CPL_OVERRIDE;
1416
1417 // Non standard
1418 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
1419 const CPL_OVERRIDE;
1420
1421 static OGRMultiPolygon* CastToMultiPolygon( OGRMultiSurface* poMS );
1422 };
1423
1424 /************************************************************************/
1425 /* OGRMultiPolygon */
1426 /************************************************************************/
1427
1432 class CPL_DLL OGRMultiPolygon : public OGRMultiSurface
1433 {
1434 protected:
1435 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
1436 const CPL_OVERRIDE;
1437 friend class OGRPolyhedralSurface;
1438 friend class OGRTriangulatedSurface;
1439
1440 private:
1442 OGRErr _addGeometryWithExpectedSubGeometryType(
1443 const OGRGeometry * poNewGeom,
1444 OGRwkbGeometryType eSubGeometryType );
1445 OGRErr _addGeometryDirectlyWithExpectedSubGeometryType(
1446 OGRGeometry * poNewGeom,
1447 OGRwkbGeometryType eSubGeometryType );
1449
1450
1451 public:
1452 OGRMultiPolygon();
1453 OGRMultiPolygon(const OGRMultiPolygon& other);
1454 virtual ~OGRMultiPolygon();
1455
1456 OGRMultiPolygon& operator=(const OGRMultiPolygon& other);
1457
1458 // Non-standard (OGRGeometry).
1459 virtual const char *getGeometryName() const CPL_OVERRIDE;
1460 virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE;
1461 virtual OGRErr exportToWkt( char **, OGRwkbVariant=wkbVariantOldOgc )
1462 const CPL_OVERRIDE;
1463
1464 // IMultiSurface methods
1465 virtual OGRErr PointOnSurface( OGRPoint * poPoint ) const CPL_OVERRIDE;
1466
1467 // Non standard
1468 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
1469 const CPL_OVERRIDE;
1470
1471 static OGRMultiSurface* CastToMultiSurface( OGRMultiPolygon* poMP );
1472 };
1473
1474 /************************************************************************/
1475 /* OGRPolyhedralSurface */
1476 /************************************************************************/
1477
1484 class CPL_DLL OGRPolyhedralSurface : public OGRSurface
1485 {
1486 protected:
1488 friend class OGRTriangulatedSurface;
1489 OGRMultiPolygon oMP;
1490 virtual OGRSurfaceCasterToPolygon GetCasterToPolygon()
1491 const CPL_OVERRIDE;
1492 virtual OGRSurfaceCasterToCurvePolygon GetCasterToCurvePolygon()
1493 const CPL_OVERRIDE;
1494 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType ) const;
1495 virtual const char* getSubGeometryName() const;
1496 virtual OGRwkbGeometryType getSubGeometryType() const;
1497 OGRErr exportToWktInternal (char ** ppszDstText, OGRwkbVariant eWkbVariant,
1498 const char* pszSkipPrefix ) const;
1499
1500 virtual OGRPolyhedralSurfaceCastToMultiPolygon GetCasterToMultiPolygon()
1501 const;
1502 static OGRMultiPolygon* CastToMultiPolygonImpl(OGRPolyhedralSurface* poPS);
1504
1505 public:
1506 OGRPolyhedralSurface();
1507 OGRPolyhedralSurface(const OGRPolyhedralSurface &poGeom);
1508 virtual ~OGRPolyhedralSurface();
1509 OGRPolyhedralSurface& operator=(const OGRPolyhedralSurface& other);
1510
1511 // IWks Interface.
1512 virtual int WkbSize() const CPL_OVERRIDE;
1513 virtual const char *getGeometryName() const CPL_OVERRIDE;
1514 virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE;
1515 virtual OGRErr importFromWkb( unsigned char *, int=-1,
1516 OGRwkbVariant=wkbVariantOldOgc ) CPL_OVERRIDE;
1517 virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *,
1518 OGRwkbVariant=wkbVariantOldOgc )
1519 const CPL_OVERRIDE;
1520 virtual OGRErr importFromWkt( char ** ) CPL_OVERRIDE;
1521 virtual OGRErr exportToWkt( char ** ppszDstText,
1522 OGRwkbVariant=wkbVariantOldOgc )
1523 const CPL_OVERRIDE;
1524
1525 // IGeometry methods.
1526 virtual int getDimension() const CPL_OVERRIDE;
1527
1528 virtual void empty() CPL_OVERRIDE;
1529
1530 virtual OGRGeometry *clone() const CPL_OVERRIDE;
1531 virtual void getEnvelope( OGREnvelope * psEnvelope ) const CPL_OVERRIDE;
1532 virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const CPL_OVERRIDE;
1533
1534 virtual void flattenTo2D() CPL_OVERRIDE;
1535 virtual OGRErr transform( OGRCoordinateTransformation* ) CPL_OVERRIDE;
1536 virtual OGRBoolean Equals( OGRGeometry* ) const CPL_OVERRIDE;
1537 virtual double get_Area() const CPL_OVERRIDE;
1538 virtual OGRErr PointOnSurface( OGRPoint* ) const CPL_OVERRIDE;
1539
1540 static OGRMultiPolygon* CastToMultiPolygon( OGRPolyhedralSurface* poPS );
1541 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
1542 const CPL_OVERRIDE;
1543 virtual OGRErr addGeometry( const OGRGeometry * );
1544 OGRErr addGeometryDirectly( OGRGeometry *poNewGeom );
1545 int getNumGeometries() const;
1546 OGRGeometry* getGeometryRef(int i);
1547 const OGRGeometry* getGeometryRef(int i) const;
1548
1549 virtual OGRBoolean IsEmpty() const CPL_OVERRIDE;
1550 virtual void setCoordinateDimension( int nDimension ) CPL_OVERRIDE;
1551 virtual void set3D( OGRBoolean bIs3D ) CPL_OVERRIDE;
1552 virtual void setMeasured( OGRBoolean bIsMeasured ) CPL_OVERRIDE;
1553 virtual void swapXY() CPL_OVERRIDE;
1554 OGRErr removeGeometry( int iIndex, int bDelete = TRUE );
1555 };
1556
1557 /************************************************************************/
1558 /* OGRTriangulatedSurface */
1559 /************************************************************************/
1560
1567 class CPL_DLL OGRTriangulatedSurface : public OGRPolyhedralSurface
1568 {
1569 protected:
1571 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
1572 const CPL_OVERRIDE;
1573 virtual const char* getSubGeometryName() const CPL_OVERRIDE;
1574 virtual OGRwkbGeometryType getSubGeometryType() const CPL_OVERRIDE;
1575
1576 virtual OGRPolyhedralSurfaceCastToMultiPolygon GetCasterToMultiPolygon()
1577 const CPL_OVERRIDE;
1578 static OGRMultiPolygon *
1579 CastToMultiPolygonImpl( OGRPolyhedralSurface* poPS );
1581
1582 public:
1583 OGRTriangulatedSurface();
1584 OGRTriangulatedSurface( const OGRTriangulatedSurface &other );
1585 ~OGRTriangulatedSurface();
1586
1587 OGRTriangulatedSurface& operator=( const OGRTriangulatedSurface& other );
1588 virtual const char *getGeometryName() const CPL_OVERRIDE;
1589 virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE;
1590
1591 // IWks Interface.
1592 virtual OGRErr addGeometry( const OGRGeometry * ) CPL_OVERRIDE;
1593
1594 static OGRPolyhedralSurface *
1595 CastToPolyhedralSurface( OGRTriangulatedSurface* poTS );
1596 };
1597
1598 /************************************************************************/
1599 /* OGRMultiPoint */
1600 /************************************************************************/
1601
1606 class CPL_DLL OGRMultiPoint : public OGRGeometryCollection
1607 {
1608 private:
1609 OGRErr importFromWkt_Bracketed( char **, int bHasM, int bHasZ );
1610
1611 protected:
1612 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
1613 const CPL_OVERRIDE;
1614
1615 public:
1616 OGRMultiPoint();
1617 OGRMultiPoint(const OGRMultiPoint& other);
1618 virtual ~OGRMultiPoint();
1619
1620 OGRMultiPoint& operator=(const OGRMultiPoint& other);
1621
1622 // Non-standard (OGRGeometry).
1623 virtual const char *getGeometryName() const CPL_OVERRIDE;
1624 virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE;
1625 virtual OGRErr importFromWkt( char ** ) CPL_OVERRIDE;
1626 virtual OGRErr exportToWkt( char **, OGRwkbVariant=wkbVariantOldOgc )
1627 const CPL_OVERRIDE;
1628
1629 // IGeometry methods.
1630 virtual int getDimension() const CPL_OVERRIDE;
1631
1632 // Non-standard.
1633 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
1634 const CPL_OVERRIDE;
1635 };
1636
1637 /************************************************************************/
1638 /* OGRMultiCurve */
1639 /************************************************************************/
1640
1647 class CPL_DLL OGRMultiCurve : public OGRGeometryCollection
1648 {
1649 protected:
1651 static OGRErr addCurveDirectlyFromWkt( OGRGeometry* poSelf,
1652 OGRCurve* poCurve );
1654 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
1655 const CPL_OVERRIDE;
1656
1657 public:
1658 OGRMultiCurve();
1659 OGRMultiCurve( const OGRMultiCurve& other );
1660 virtual ~OGRMultiCurve();
1661
1662 OGRMultiCurve& operator=( const OGRMultiCurve& other );
1663
1664 // Non standard (OGRGeometry).
1665 virtual const char *getGeometryName() const CPL_OVERRIDE;
1666 virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE;
1667 virtual OGRErr importFromWkt( char ** ) CPL_OVERRIDE;
1668 virtual OGRErr exportToWkt( char **, OGRwkbVariant=wkbVariantOldOgc )
1669 const CPL_OVERRIDE;
1670
1671 // IGeometry methods.
1672 virtual int getDimension() const CPL_OVERRIDE;
1673
1674 // Non-standard.
1675 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
1676 const CPL_OVERRIDE;
1677
1678 static OGRMultiLineString* CastToMultiLineString(OGRMultiCurve* poMC);
1679 };
1680
1681 /************************************************************************/
1682 /* OGRMultiLineString */
1683 /************************************************************************/
1684
1689 class CPL_DLL OGRMultiLineString : public OGRMultiCurve
1690 {
1691 protected:
1692 virtual OGRBoolean isCompatibleSubType( OGRwkbGeometryType )
1693 const CPL_OVERRIDE;
1694
1695 public:
1696 OGRMultiLineString();
1697 OGRMultiLineString( const OGRMultiLineString& other );
1698 virtual ~OGRMultiLineString();
1699
1700 OGRMultiLineString& operator=( const OGRMultiLineString& other );
1701
1702 // Non standard (OGRGeometry).
1703 virtual const char *getGeometryName() const CPL_OVERRIDE;
1704 virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE;
1705 virtual OGRErr exportToWkt( char **, OGRwkbVariant=wkbVariantOldOgc )
1706 const CPL_OVERRIDE;
1707
1708 // Non standard
1709 virtual OGRBoolean hasCurveGeometry( int bLookForNonLinear = FALSE )
1710 const CPL_OVERRIDE;
1711
1712 static OGRMultiCurve* CastToMultiCurve( OGRMultiLineString* poMLS );
1713 };
1714
1715 /************************************************************************/
1716 /* OGRGeometryFactory */
1717 /************************************************************************/
1718
1723 class CPL_DLL OGRGeometryFactory
1724 {
1725 static OGRErr createFromFgfInternal( unsigned char *pabyData,
1726 OGRSpatialReference * poSR,
1727 OGRGeometry **ppoReturn,
1728 int nBytes,
1729 int *pnBytesConsumed,
1730 int nRecLevel );
1731 public:
1732 static OGRErr createFromWkb( unsigned char *, OGRSpatialReference *,
1733 OGRGeometry **, int = -1,
1734 OGRwkbVariant=wkbVariantOldOgc );
1735 static OGRErr createFromWkt( char **, OGRSpatialReference *,
1736 OGRGeometry ** );
1737 static OGRErr createFromFgf( unsigned char *, OGRSpatialReference *,
1738 OGRGeometry **, int = -1, int * = NULL );
1739 static OGRGeometry *createFromGML( const char * );
1740 static OGRGeometry *createFromGEOS( GEOSContextHandle_t hGEOSCtxt,
1741 GEOSGeom );
1742
1743 static void destroyGeometry( OGRGeometry * );
1744 static OGRGeometry *createGeometry( OGRwkbGeometryType );
1745
1746 static OGRGeometry * forceToPolygon( OGRGeometry * );
1747 static OGRGeometry * forceToLineString( OGRGeometry *,
1748 bool bOnlyInOrder = true );
1749 static OGRGeometry * forceToMultiPolygon( OGRGeometry * );
1750 static OGRGeometry * forceToMultiPoint( OGRGeometry * );
1751 static OGRGeometry * forceToMultiLineString( OGRGeometry * );
1752
1753 static OGRGeometry * forceTo( OGRGeometry* poGeom,
1754 OGRwkbGeometryType eTargetType,
1755 const char*const* papszOptions = NULL );
1756
1757 static OGRGeometry * organizePolygons( OGRGeometry **papoPolygons,
1758 int nPolygonCount,
1759 int *pbResultValidGeometry,
1760 const char **papszOptions = NULL);
1761 static bool haveGEOS();
1762
1763 static OGRGeometry* transformWithOptions( const OGRGeometry* poSrcGeom,
1764 OGRCoordinateTransformation *poCT,
1765 char** papszOptions );
1766
1767 static OGRGeometry*
1768 approximateArcAngles( double dfX, double dfY, double dfZ,
1769 double dfPrimaryRadius, double dfSecondaryAxis,
1770 double dfRotation,
1771 double dfStartAngle, double dfEndAngle,
1772 double dfMaxAngleStepSizeDegrees );
1773
1774 static int GetCurveParmeters( double x0, double y0,
1775 double x1, double y1,
1776 double x2, double y2,
1777 double& R, double& cx, double& cy,
1778 double& alpha0, double& alpha1,
1779 double& alpha2 );
1780 static OGRLineString* curveToLineString(
1781 double x0, double y0, double z0,
1782 double x1, double y1, double z1,
1783 double x2, double y2, double z2,
1784 int bHasZ,
1785 double dfMaxAngleStepSizeDegrees,
1786 const char* const * papszOptions = NULL );
1787 static OGRCurve* curveFromLineString(
1788 const OGRLineString* poLS,
1789 const char* const * papszOptions = NULL);
1790 };
1791
1792 OGRwkbGeometryType CPL_DLL OGRFromOGCGeomType( const char *pszGeomType );
1793 const char CPL_DLL * OGRToOGCGeomType( OGRwkbGeometryType eGeomType );
1794
1796 typedef struct _OGRPreparedGeometry OGRPreparedGeometry;
1797 int OGRHasPreparedGeometrySupport();
1798 OGRPreparedGeometry* OGRCreatePreparedGeometry( const OGRGeometry* poGeom );
1799 void OGRDestroyPreparedGeometry( OGRPreparedGeometry* poPreparedGeom );
1800 int OGRPreparedGeometryIntersects( const OGRPreparedGeometry* poPreparedGeom,
1801 const OGRGeometry* poOtherGeom );
1802 int OGRPreparedGeometryContains( const OGRPreparedGeometry* poPreparedGeom,
1803 const OGRGeometry* poOtherGeom );
1804
1805 #endif /* ndef OGR_GEOMETRY_H_INCLUDED */
OGRCurvePolygon::importFromWkt
virtual OGRErr importFromWkt(char **) CPL_OVERRIDE
Assign geometry from well known text data.
Definition: ogrcurvepolygon.cpp:507
OGRSimpleCurve::Value
virtual void Value(double, OGRPoint *) const CPL_OVERRIDE
Fetch point at given distance along curve.
Definition: ogrlinestring.cpp:1936
OGRCurve::Value
virtual void Value(double, OGRPoint *) const =0
Fetch point at given distance along curve.
OGRPolygon::exportToWkb
virtual OGRErr exportToWkb(OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc) const CPL_OVERRIDE
Convert a geometry into well known binary format.
Definition: ogrpolygon.cpp:364
OGRGeometry::closeRings
virtual void closeRings()
Force rings to be closed.
Definition: ogrgeometry.cpp:4970
OGRCurvePolygon::WkbSize
virtual int WkbSize() const CPL_OVERRIDE
Returns size of related binary representation.
Definition: ogrcurvepolygon.cpp:418
OGRMultiCurve::getGeometryType
virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE
Fetch geometry type.
Definition: ogrmulticurve.cpp:100
OGRGeometry::getGeometryType
virtual OGRwkbGeometryType getGeometryType() const =0
Fetch geometry type.
OGRPolygon::importFromWkb
virtual OGRErr importFromWkb(unsigned char *, int=-1, OGRwkbVariant=wkbVariantOldOgc) CPL_OVERRIDE
Assign geometry from well known binary data.
Definition: ogrpolygon.cpp:319
OGRGeometry::setCoordinateDimension
virtual void setCoordinateDimension(int nDimension)
Set the coordinate dimension.
Definition: ogrgeometry.cpp:1022
OGRGeometry::Is3D
OGRBoolean Is3D() const
Definition: ogr_geometry.h:185
OGRGeometry::set3D
virtual void set3D(OGRBoolean bIs3D)
Add or remove the Z coordinate dimension.
Definition: ogrgeometry.cpp:1045
OGRMultiSurface::getGeometryType
virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE
Fetch geometry type.
Definition: ogrmultisurface.cpp:101
OGRMultiCurve::hasCurveGeometry
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const CPL_OVERRIDE
Returns if this geometry is or has curve geometry.
Definition: ogrmulticurve.cpp:193
OGRGeometryCollection::exportToWkt
virtual OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const CPL_OVERRIDE
Convert a geometry into well known text format.
Definition: ogrgeometrycollection.cpp:801
OGRGeometry::setMeasured
virtual void setMeasured(OGRBoolean bIsMeasured)
Add or remove the M coordinate dimension.
Definition: ogrgeometry.cpp:1068
OGRRawPoint::y
double y
y
Definition: ogr_geometry.h:59
OGRLineString
Concrete representation of a multi-vertex line.
Definition: ogr_geometry.h:623
OGRGeometry::importFromWkt
virtual OGRErr importFromWkt(char **ppszInput)=0
Assign geometry from well known text data.
OGRGeometry::hasCurveGeometry
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const
Returns if this geometry is or has curve geometry.
Definition: ogrgeometry.cpp:3048
CPL_OVERRIDE
#define CPL_OVERRIDE
To be used in public headers only.
Definition: cpl_port.h:1055
OGRPoint::getY
double getY() const
Return y.
Definition: ogr_geometry.h:364
OGRCurvePolygon::exportToWkb
virtual OGRErr exportToWkb(OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc) const CPL_OVERRIDE
Convert a geometry into well known binary format.
Definition: ogrcurvepolygon.cpp:473
OGRGeometry::swapXY
virtual void swapXY()
Swap x and y coordinates.
Definition: ogrgeometry.cpp:5706
OGRCompoundCurve::StartPoint
virtual void StartPoint(OGRPoint *) const CPL_OVERRIDE
Return the curve start point.
Definition: ogrcompoundcurve.cpp:288
OGRSimpleCurve::get_Length
virtual double get_Length() const CPL_OVERRIDE
Returns the length of the curve.
Definition: ogrlinestring.cpp:1894
OGRGeometryFactory
Create geometry objects from well known text/binary.
Definition: ogr_geometry.h:1723
OGRRawPoint::x
double x
x
Definition: ogr_geometry.h:57
OGRCurvePolygon::exportToWkt
virtual OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant eWkbVariant=wkbVariantOldOgc) const CPL_OVERRIDE
Convert a geometry into well known text format.
Definition: ogrcurvepolygon.cpp:523
OGRGeometry::getGeometryName
virtual const char * getGeometryName() const =0
Fetch WKT name for geometry type.
OGRCompoundCurve::get_Length
virtual double get_Length() const CPL_OVERRIDE
Returns the length of the curve.
Definition: ogrcompoundcurve.cpp:276
OGRMultiSurface::isCompatibleSubType
virtual OGRBoolean isCompatibleSubType(OGRwkbGeometryType) const CPL_OVERRIDE
Returns whether a geometry of the specified geometry type can be a member of this collection...
Definition: ogrmultisurface.cpp:139
OGRPolyhedralSurface::OGRPolyhedralSurface
OGRPolyhedralSurface()
Create an empty PolyhedralSurface.
Definition: ogrpolyhedralsurface.cpp:47
OGRGeometry::exportToWkb
virtual OGRErr exportToWkb(OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc) const =0
Convert a geometry into well known binary format.
OGRMultiCurve::operator=
OGRMultiCurve & operator=(const OGRMultiCurve &other)
Assignment operator.
Definition: ogrmulticurve.cpp:87
OGRGeometryCollection::getGeometryName
virtual const char * getGeometryName() const CPL_OVERRIDE
Fetch WKT name for geometry type.
Definition: ogrgeometrycollection.cpp:231
OGRGeometry::clone
virtual OGRGeometry * clone() const CPL_WARN_UNUSED_RESULT=0
Make a copy of this object.
OGRCurvePolygon::stealExteriorRingCurve
OGRCurve * stealExteriorRingCurve()
"Steal" reference to external ring.
Definition: ogrcurvepolygon.cpp:311
OGRBoolean
int OGRBoolean
Type for a OGR boolean.
Definition: ogr_core.h:301
OGRCompoundCurve::Value
virtual void Value(double, OGRPoint *) const CPL_OVERRIDE
Fetch point at given distance along curve.
Definition: ogrcompoundcurve.cpp:308
OGRCurvePolygon::getExteriorRingCurve
OGRCurve * getExteriorRingCurve()
Fetch reference to external polygon ring.
Definition: ogrcurvepolygon.cpp:205
OGRTriangle::addRingDirectly
virtual OGRErr addRingDirectly(OGRCurve *poNewRing) CPL_OVERRIDE
Add a ring to a polygon.
Definition: ogrtriangle.cpp:249
OGRPoint::IsEmpty
virtual OGRBoolean IsEmpty() const CPL_OVERRIDE
Returns TRUE (non-zero) if the object has no points.
Definition: ogr_geometry.h:357
OGRCurvePolygon::CastToPolygon
static OGRPolygon * CastToPolygon(OGRCurvePolygon *poCP)
Convert to polygon.
Definition: ogrcurvepolygon.cpp:813
ogr_spatialref.h
Coordinate systems services.
OGRPoint::getM
double getM() const
Return m.
Definition: ogr_geometry.h:368
OGRGeometryCollection::getGeometryType
virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE
Fetch geometry type.
Definition: ogrgeometrycollection.cpp:177
OGRLineString::getGeometryName
virtual const char * getGeometryName() const CPL_OVERRIDE
Fetch WKT name for geometry type.
Definition: ogrlinestring.cpp:2683
OGRPolygon::getGeometryName
virtual const char * getGeometryName() const CPL_OVERRIDE
Fetch WKT name for geometry type.
Definition: ogrpolygon.cpp:123
OGRRawPoint::OGRRawPoint
OGRRawPoint()
Constructor.
Definition: ogr_geometry.h:51
OGRCurve::EndPoint
virtual void EndPoint(OGRPoint *) const =0
Return the curve end point.
OGRGeometryCollection::hasCurveGeometry
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const CPL_OVERRIDE
Returns if this geometry is or has curve geometry.
Definition: ogrgeometrycollection.cpp:1299
OGRMultiPolygon
A collection of non-overlapping OGRPolygon.
Definition: ogr_geometry.h:1432
OGRHasPreparedGeometrySupport
int OGRHasPreparedGeometrySupport()
Returns if GEOS has prepared geometry support.
Definition: ogrgeometry.cpp:5736
OGRCurvePolygon::getGeometryName
virtual const char * getGeometryName() const CPL_OVERRIDE
Fetch WKT name for geometry type.
Definition: ogrcurvepolygon.cpp:179
OGRGeometry::Equals
virtual OGRBoolean Equals(OGRGeometry *) const =0
Returns TRUE if two geometries are equivalent.
OGRGeometry::importFromWkb
virtual OGRErr importFromWkb(unsigned char *, int=-1, OGRwkbVariant=wkbVariantOldOgc)=0
Assign geometry from well known binary data.
OGRwkbByteOrder
OGRwkbByteOrder
Enumeration to describe byte order.
Definition: ogr_core.h:479
OGRCircularString
Concrete representation of a circular string, that is to say a curve made of one or several arc circl...
Definition: ogr_geometry.h:753
OGRGeometry::flattenTo2D
virtual void flattenTo2D()=0
Convert geometry to strictly 2D.
OGRCurve
Abstract curve base class for OGRLineString, OGRCircularString and OGRCompoundCurve.
Definition: ogr_geometry.h:433
OGRGeometryCollection
A collection of 1 or more geometry objects.
Definition: ogr_geometry.h:1292
OGRCurvePolygon::getNumInteriorRings
int getNumInteriorRings() const
Fetch the number of internal rings.
Definition: ogrcurvepolygon.cpp:242
OGRLinearRing
Concrete representation of a closed ring.
Definition: ogr_geometry.h:684
OGRPoint::setM
void setM(double mIn)
Set m.
Definition: ogr_geometry.h:388
OGRPolygon::exportToWkt
virtual OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const CPL_OVERRIDE
Convert a geometry into well known text format.
Definition: ogrpolygon.cpp:614
OGRGeometry::operator=
OGRGeometry & operator=(const OGRGeometry &other)
Assignment operator.
Definition: ogrgeometry.cpp:141
OGRSimpleCurve::getNumPoints
virtual int getNumPoints() const CPL_OVERRIDE
Fetch vertex count.
Definition: ogr_geometry.h:552
OGRMultiSurface::PointOnSurface
virtual OGRErr PointOnSurface(OGRPoint *poPoint) const
This method relates to the SFCOM IMultiSurface::get_PointOnSurface() method.
Definition: ogrmultisurface.cpp:299
OGRMultiCurve::isCompatibleSubType
virtual OGRBoolean isCompatibleSubType(OGRwkbGeometryType) const CPL_OVERRIDE
Returns whether a geometry of the specified geometry type can be a member of this collection...
Definition: ogrmulticurve.cpp:137
OGRSimpleCurve::importFromWkt
virtual OGRErr importFromWkt(char **) CPL_OVERRIDE
Assign geometry from well known text data.
Definition: ogrlinestring.cpp:1674
OGRCurve::get_IsClosed
virtual int get_IsClosed() const
Return TRUE if curve is closed.
Definition: ogrcurve.cpp:95
OGRGeometry::getCurveGeometry
virtual OGRGeometry * getCurveGeometry(const char *const *papszOptions=NULL) const CPL_WARN_UNUSED_RESULT
Return curve version of this geometry.
Definition: ogrgeometry.cpp:3116
OGRGeometryCollection::isCompatibleSubType
virtual OGRBoolean isCompatibleSubType(OGRwkbGeometryType) const
Returns whether a geometry of the specified geometry type can be a member of this collection...
Definition: ogrgeometrycollection.cpp:1288
OGRMultiCurve::getGeometryName
virtual const char * getGeometryName() const CPL_OVERRIDE
Fetch WKT name for geometry type.
Definition: ogrmulticurve.cpp:127
OGRMultiSurface
A collection of non-overlapping OGRSurface.
Definition: ogr_geometry.h:1391
OGRCurve::get_Length
virtual double get_Length() const =0
Returns the length of the curve.
OGRSimpleCurve::WkbSize
virtual int WkbSize() const CPL_OVERRIDE
Returns size of related binary representation.
Definition: ogrlinestring.cpp:195
OGRCurve::StartPoint
virtual void StartPoint(OGRPoint *) const =0
Return the curve start point.
OGRFromOGCGeomType
OGRwkbGeometryType OGRFromOGCGeomType(const char *pszGeomType)
Map OGCgeometry format type to corresponding OGR constants.
Definition: ogrgeometry.cpp:2257
OGRSimpleCurve::operator=
OGRSimpleCurve & operator=(const OGRSimpleCurve &other)
Assignment operator.
Definition: ogrlinestring.cpp:99
OGRCurvePolygon::segmentize
virtual void segmentize(double dfMaxLength) CPL_OVERRIDE
Modify the geometry such it has no segment longer then the given distance.
Definition: ogrcurvepolygon.cpp:712
OGRMultiSurface::hasCurveGeometry
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const CPL_OVERRIDE
Returns if this geometry is or has curve geometry.
Definition: ogrmultisurface.cpp:278
OGRCurve::get_Area
virtual double get_Area() const =0
Get the area of the (closed) curve.
OGRPolyhedralSurface::addGeometryDirectly
OGRErr addGeometryDirectly(OGRGeometry *poNewGeom)
Add a geometry directly to the container.
Definition: ogrpolyhedralsurface.cpp:872
OGRCompoundCurve
Utility class to store a collection of curves.
Definition: ogr_geometry.h:906
OGRRawPoint
Simple container for a position.
Definition: ogr_geometry.h:47
OGRwkbGeometryType
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:312
OGRCurvePolygon::swapXY
virtual void swapXY() CPL_OVERRIDE
Swap x and y coordinates.
Definition: ogrcurvepolygon.cpp:726
OGRCurvePolygon::getGeometryType
virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE
Fetch geometry type.
Definition: ogrcurvepolygon.cpp:142
OGRTriangulatedSurface::addGeometry
virtual OGRErr addGeometry(const OGRGeometry *) CPL_OVERRIDE
Add a new geometry to a collection.
Definition: ogrtriangulatedsurface.cpp:184
OGRCurvePolygon::importFromWkb
virtual OGRErr importFromWkb(unsigned char *, int=-1, OGRwkbVariant=wkbVariantOldOgc) CPL_OVERRIDE
Assign geometry from well known binary data.
Definition: ogrcurvepolygon.cpp:448
OGRPolyhedralSurface::~OGRPolyhedralSurface
virtual ~OGRPolyhedralSurface()
Destructor.
Definition: ogrpolyhedralsurface.cpp:74
OGRMultiSurface::operator=
OGRMultiSurface & operator=(const OGRMultiSurface &other)
Assignment operator.
Definition: ogrmultisurface.cpp:88
OGRCurve::ContainsPoint
virtual int ContainsPoint(const OGRPoint *p) const
Returns if a point is contained in a (closed) curve.
Definition: ogrcurve.cpp:429
OGRPointIterator
Interface for a point iterator.
Definition: ogr_geometry.h:415
OGRTriangulatedSurface
TriangulatedSurface class.
Definition: ogr_geometry.h:1567
OGRMultiCurve
A collection of OGRCurve.
Definition: ogr_geometry.h:1647
OGRSurface::PointOnSurface
virtual OGRErr PointOnSurface(OGRPoint *poPoint) const =0
This method relates to the SFCOM ISurface::get_PointOnSurface() method.
OGRSurface
Abstract base class for 2 dimensional objects like polygons or curve polygons.
Definition: ogr_geometry.h:1014
OGRMultiLineString
A collection of OGRLineString.
Definition: ogr_geometry.h:1689
OGRCompoundCurve::get_AreaOfCurveSegments
virtual double get_AreaOfCurveSegments() const CPL_OVERRIDE
Return area of curve segments.
Definition: ogrcompoundcurve.cpp:870
OGRGeometry
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:118
OGRGeometry::empty
virtual void empty()=0
Clear geometry information.
OGRGeometry::segmentize
virtual void segmentize(double dfMaxLength)
Modify the geometry such it has no segment longer then the given distance.
Definition: ogrgeometry.cpp:804
OGRPoint::getZ
double getZ() const
Return z.
Definition: ogr_geometry.h:366
OGRPoint::setX
void setX(double xIn)
Set x.
Definition: ogr_geometry.h:375
OGRGeometry::IsMeasured
OGRBoolean IsMeasured() const
Definition: ogr_geometry.h:187
sfcgal_geometry_t
void sfcgal_geometry_t
SFCGAL geometry type.
Definition: ogr_geometry.h:67
OGRGeometry::IsValid
virtual OGRBoolean IsValid() const
Test if the geometry is valid.
Definition: ogrgeometry.cpp:2028
OGRCurve::CastToLinearRing
static OGRLinearRing * CastToLinearRing(OGRCurve *poCurve)
Cast to linear ring.
Definition: ogrcurve.cpp:408
OGRSurface::get_Area
virtual double get_Area() const =0
Get the area of the surface object.
OGRTriangle::operator=
OGRTriangle & operator=(const OGRTriangle &other)
Assignment operator.
Definition: ogrtriangle.cpp:143
OGRGeometry::Intersects
virtual OGRBoolean Intersects(const OGRGeometry *) const
Do these features intersect?
Definition: ogrgeometry.cpp:515
OGRPolyhedralSurface::operator=
OGRPolyhedralSurface & operator=(const OGRPolyhedralSurface &other)
Assignment operator.
Definition: ogrpolyhedralsurface.cpp:87
OGRDestroyPreparedGeometry
void OGRDestroyPreparedGeometry(OGRPreparedGeometry *poPreparedGeom)
Destroys a prepared geometry.
Definition: ogrgeometry.cpp:5792
GEOSGeom
struct GEOSGeom_t * GEOSGeom
GEOS geometry type.
Definition: ogr_geometry.h:63
OGRSimpleCurve::transform
virtual OGRErr transform(OGRCoordinateTransformation *poCT) CPL_OVERRIDE
Apply arbitrary coordinate transformation to geometry.
Definition: ogrlinestring.cpp:2340
OGRLineString::operator=
OGRLineString & operator=(const OGRLineString &other)
Assignment operator.
Definition: ogrlinestring.cpp:2653
OGRPolygon::getGeometryType
virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE
Fetch geometry type.
Definition: ogrpolygon.cpp:106
OGRCurvePolygon::getLinearGeometry
virtual OGRGeometry * getLinearGeometry(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=NULL) const CPL_OVERRIDE
Return, possibly approximate, non-curve version of this geometry.
Definition: ogrcurvepolygon.cpp:587
OGRPoint::setZ
void setZ(double zIn)
Set z.
Definition: ogr_geometry.h:383
OGRPolyhedralSurface::removeGeometry
OGRErr removeGeometry(int iIndex, int bDelete=TRUE)
Remove a geometry from the container.
Definition: ogrpolyhedralsurface.cpp:1073
OGRMultiCurve::exportToWkt
virtual OGRErr exportToWkt(char **, OGRwkbVariant=wkbVariantOldOgc) const CPL_OVERRIDE
Convert a geometry into well known text format.
Definition: ogrmulticurve.cpp:182
OGRSimpleCurve::clone
virtual OGRGeometry * clone() const CPL_OVERRIDE
Make a copy of this object.
Definition: ogrlinestring.cpp:126
OGRCompoundCurve::get_Area
virtual double get_Area() const CPL_OVERRIDE
Get the area of the (closed) curve.
Definition: ogrcompoundcurve.cpp:830
ogr_core.h
Core portability services for cross-platform OGR code.
OGRGeometry::getDimension
virtual int getDimension() const =0
Get the dimension of this object.
OGRPreparedGeometryIntersects
int OGRPreparedGeometryIntersects(const OGRPreparedGeometry *poPreparedGeom, const OGRGeometry *poOtherGeom)
Returns whether a prepared geometry intersects with a geometry.
Definition: ogrgeometry.cpp:5814
OGRCurvePolygon
Concrete class representing curve polygons.
Definition: ogr_geometry.h:1048
OGRCurvePolygon::transform
virtual OGRErr transform(OGRCoordinateTransformation *poCT) CPL_OVERRIDE
Apply arbitrary coordinate transformation to geometry.
Definition: ogrcurvepolygon.cpp:653
OGRPolyhedralSurface
PolyhedralSurface class.
Definition: ogr_geometry.h:1484
OGRSimpleCurve::exportToWkb
virtual OGRErr exportToWkb(OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOldOgc) const CPL_OVERRIDE
Convert a geometry into well known binary format.
Definition: ogrlinestring.cpp:1580
OGRPolygon::CurvePolyToPoly
virtual OGRPolygon * CurvePolyToPoly(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=NULL) const CPL_OVERRIDE
Return a polygon from a curve polygon.
Definition: ogrpolygon.cpp:802
OGRGeometryCollection::importFromWkt
virtual OGRErr importFromWkt(char **) CPL_OVERRIDE
Assign geometry from well known text data.
Definition: ogrgeometrycollection.cpp:788
OGRPoint::setY
void setY(double yIn)
Set y.
Definition: ogr_geometry.h:379
OGRCurvePolygon::IsEmpty
virtual OGRBoolean IsEmpty() const CPL_OVERRIDE
Returns TRUE (non-zero) if the object has no points.
Definition: ogrcurvepolygon.cpp:703
OGRSpatialReference
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:132
OGRCurve::get_AreaOfCurveSegments
virtual double get_AreaOfCurveSegments() const =0
Get the area of the purely curve portions of a (closed) curve.
OGRPreparedGeometry
struct _OGRPreparedGeometry OGRPreparedGeometry
Prepared geometry API (needs GEOS >= 3.1.0)
Definition: ogr_geometry.h:1796
OGRGeometryCollection::getDimension
virtual int getDimension() const CPL_OVERRIDE
Get the dimension of this object.
Definition: ogrgeometrycollection.cpp:194
wkbVariantOldOgc
Old-style 99-402 extended dimension (Z) WKB types.
Definition: ogr_core.h:420
OGRCurvePolygon::OGRCurvePolygon
OGRCurvePolygon()
Create an empty curve polygon.
Definition: ogrcurvepolygon.cpp:52
OGRCurve::CurveToLine
virtual OGRLineString * CurveToLine(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=NULL) const =0
Return a linestring from a curve geometry.
OGRCreatePreparedGeometry
OGRPreparedGeometry * OGRCreatePreparedGeometry(const OGRGeometry *poGeom)
Creates a prepared geometry.
Definition: ogrgeometry.cpp:5756
OGRPolyhedralSurface::addGeometry
virtual OGRErr addGeometry(const OGRGeometry *)
Add a new geometry to a collection.
Definition: ogrpolyhedralsurface.cpp:836
OGRCurvePolygon::hasCurveGeometry
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const CPL_OVERRIDE
Returns if this geometry is or has curve geometry.
Definition: ogrcurvepolygon.cpp:572
OGRSimpleCurve::getEnvelope
virtual void getEnvelope(OGREnvelope *psEnvelope) const CPL_OVERRIDE
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure...
Definition: ogrlinestring.cpp:2237
OGRCurvePolygon::addRingDirectly
virtual OGRErr addRingDirectly(OGRCurve *)
Add a ring to a polygon.
Definition: ogrcurvepolygon.cpp:397
OGRPoint
Point class.
Definition: ogr_geometry.h:322
OGRCurvePolygon::PointOnSurface
virtual OGRErr PointOnSurface(OGRPoint *poPoint) const CPL_OVERRIDE
This method relates to the SFCOM ISurface::get_PointOnSurface() method.
Definition: ogrcurvepolygon.cpp:597
OGRwkbVariant
OGRwkbVariant
Output variants of WKB we support.
Definition: ogr_core.h:418
OGRGeometry::WkbSize
virtual int WkbSize() const =0
Returns size of related binary representation.
OGRGeometry::getEnvelope
virtual void getEnvelope(OGREnvelope *psEnvelope) const =0
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure...
OGRGeometryCollection::operator=
OGRGeometryCollection & operator=(const OGRGeometryCollection &other)
Assignment operator.
Definition: ogrgeometrycollection.cpp:110
OGRCurvePolygon::setCoordinateDimension
virtual void setCoordinateDimension(int nDimension) CPL_OVERRIDE
Set the coordinate dimension.
Definition: ogrcurvepolygon.cpp:683
OGRSimpleCurve::importFromWkb
virtual OGRErr importFromWkb(unsigned char *, int=-1, OGRwkbVariant=wkbVariantOldOgc) CPL_OVERRIDE
Assign geometry from well known binary data.
Definition: ogrlinestring.cpp:1470
OGRGeometry::getLinearGeometry
virtual OGRGeometry * getLinearGeometry(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=NULL) const CPL_WARN_UNUSED_RESULT
Return, possibly approximate, non-curve version of this geometry.
Definition: ogrgeometry.cpp:3081
OGRPoint::getX
double getX() const
Return x.
Definition: ogr_geometry.h:362
OGRPolygon
Concrete class representing polygons.
Definition: ogr_geometry.h:1159
OGRSimpleCurve
Abstract curve base class for OGRLineString and OGRCircularString.
Definition: ogr_geometry.h:491
OGRGeometry::exportToWkt
virtual OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const =0
Convert a geometry into well known text format.
GEOSContextHandle_t
struct GEOSContextHandle_HS * GEOSContextHandle_t
GEOS context handle type.
Definition: ogr_geometry.h:65
OGRCurve::getNumPoints
virtual int getNumPoints() const =0
Return the number of points of a curve geometry.
OGRPolyhedralSurface::getGeometryName
virtual const char * getGeometryName() const CPL_OVERRIDE
Fetch WKT name for geometry type.
Definition: ogrpolyhedralsurface.cpp:102
OGRSimpleCurve::segmentize
virtual void segmentize(double dfMaxLength) CPL_OVERRIDE
Modify the geometry such it has no segment longer then the given distance.
Definition: ogrlinestring.cpp:2461
OGRGeometry::Contains
virtual OGRBoolean Contains(const OGRGeometry *) const
Test for containment.
Definition: ogrgeometry.cpp:4812
OGRCurvePolygon::Equals
virtual OGRBoolean Equals(OGRGeometry *) const CPL_OVERRIDE
Returns TRUE if two geometries are equivalent.
Definition: ogrcurvepolygon.cpp:627
OGRRawPoint::OGRRawPoint
OGRRawPoint(double xIn, double yIn)
Constructor.
Definition: ogr_geometry.h:54
OGRCurvePolygon::flattenTo2D
virtual void flattenTo2D() CPL_OVERRIDE
Convert geometry to strictly 2D.
Definition: ogrcurvepolygon.cpp:169
OGRSimpleCurve::getX
double getX(int i) const
Get X at vertex.
Definition: ogr_geometry.h:554
OGRCoordinateTransformation
Interface for transforming between coordinate systems.
Definition: ogr_spatialref.h:591
OGRCompoundCurve::getNumPoints
virtual int getNumPoints() const CPL_OVERRIDE
Return the number of points of a curve geometry.
Definition: ogrcompoundcurve.cpp:668
OGRPolyhedralSurface::CastToMultiPolygon
static OGRMultiPolygon * CastToMultiPolygon(OGRPolyhedralSurface *poPS)
Casts the OGRPolyhedralSurface to an OGRMultiPolygon.
Definition: ogrpolyhedralsurface.cpp:815
OGRPolyhedralSurface::getGeometryType
virtual OGRwkbGeometryType getGeometryType() const CPL_OVERRIDE
Returns the WKB Type of PolyhedralSurface.
Definition: ogrpolyhedralsurface.cpp:116
OGRCurve::CastToCompoundCurve
static OGRCompoundCurve * CastToCompoundCurve(OGRCurve *puCurve)
Cast to compound curve.
Definition: ogrcurve.cpp:355
OGRPolyhedralSurface::getNumGeometries
int getNumGeometries() const
Fetch number of geometries in PolyhedralSurface.
Definition: ogrpolyhedralsurface.cpp:914
OGRPreparedGeometryContains
int OGRPreparedGeometryContains(const OGRPreparedGeometry *poPreparedGeom, const OGRGeometry *poOtherGeom)
Returns whether a prepared geometry contains a geometry.
Definition: ogrgeometry.cpp:5844
OGRCurvePolygon::CurvePolyToPoly
virtual OGRPolygon * CurvePolyToPoly(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=NULL) const
Return a polygon from a curve polygon.
Definition: ogrcurvepolygon.cpp:553
OGRCurvePolygon::addRing
virtual OGRErr addRing(OGRCurve *)
Add a ring to a polygon.
Definition: ogrcurvepolygon.cpp:338
OGRCurve::getPointIterator
virtual OGRPointIterator * getPointIterator() const =0
Returns a point iterator over the curve.
OGRCurvePolygon::operator=
OGRCurvePolygon & operator=(const OGRCurvePolygon &other)
Assignment operator.
Definition: ogrcurvepolygon.cpp:91
OGRTriangle
Triangle class.
Definition: ogr_geometry.h:1244
OGRPolygon::operator=
OGRPolygon & operator=(const OGRPolygon &other)
Assignment operator.
Definition: ogrpolygon.cpp:93
OGRCurve::CastToLineString
static OGRLineString * CastToLineString(OGRCurve *poCurve)
Cast to linestring.
Definition: ogrcurve.cpp:386
OGRGeometry::transform
virtual OGRErr transform(OGRCoordinateTransformation *poCT)=0
Apply arbitrary coordinate transformation to geometry.
OGRCompoundCurve::getPointIterator
virtual OGRPointIterator * getPointIterator() const CPL_OVERRIDE
Returns a point iterator over the curve.
Definition: ogrcompoundcurve.cpp:726
OGRSimpleCurve::exportToWkt
virtual OGRErr exportToWkt(char **ppszDstText, OGRwkbVariant=wkbVariantOldOgc) const CPL_OVERRIDE
Convert a geometry into well known text format.
Definition: ogrlinestring.cpp:1796
OGRErr
int OGRErr
Simple container for a bounding region.
Definition: ogr_core.h:285
OGRPolygon::WkbSize
virtual int WkbSize() const CPL_OVERRIDE
Returns size of related binary representation.
Definition: ogrpolygon.cpp:299
OGRCurvePolygon::set3D
virtual void set3D(OGRBoolean bIs3D) CPL_OVERRIDE
Add or remove the Z coordinate dimension.
Definition: ogrcurvepolygon.cpp:689
OGRCurvePolygon::getEnvelope
virtual void getEnvelope(OGREnvelope *psEnvelope) const CPL_OVERRIDE
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure...
Definition: ogrcurvepolygon.cpp:607
OGRCurvePolygon::setMeasured
virtual void setMeasured(OGRBoolean bIsMeasured) CPL_OVERRIDE
Add or remove the M coordinate dimension.
Definition: ogrcurvepolygon.cpp:694
OGRMultiSurface::exportToWkt
virtual OGRErr exportToWkt(char **, OGRwkbVariant=wkbVariantOldOgc) const CPL_OVERRIDE
Convert a geometry into well known text format.
Definition: ogrmultisurface.cpp:267
OGRToOGCGeomType
const char * OGRToOGCGeomType(OGRwkbGeometryType eGeomType)
Map OGR geometry format constants to corresponding OGC geometry type.
Definition: ogrgeometry.cpp:2330
OGRMultiPoint
A collection of OGRPoint.
Definition: ogr_geometry.h:1606
OGRPolygon::hasCurveGeometry
virtual OGRBoolean hasCurveGeometry(int bLookForNonLinear=FALSE) const CPL_OVERRIDE
Returns if this geometry is or has curve geometry.
Definition: ogrpolygon.cpp:813
OGRMultiSurface::getGeometryName
virtual const char * getGeometryName() const CPL_OVERRIDE
Fetch WKT name for geometry type.
Definition: ogrmultisurface.cpp:128
OGRCompoundCurve::EndPoint
virtual void EndPoint(OGRPoint *) const CPL_OVERRIDE
Return the curve end point.
Definition: ogrcompoundcurve.cpp:298
OGRCurve::IsConvex
virtual OGRBoolean IsConvex() const
Returns if a (closed) curve forms a convex shape.
Definition: ogrcurve.cpp:309
OGRCurvePolygon::getInteriorRingCurve
OGRCurve * getInteriorRingCurve(int)
Fetch reference to indicated internal ring.
Definition: ogrcurvepolygon.cpp:270
OGRGeometry::IsEmpty
virtual OGRBoolean IsEmpty() const =0
Returns TRUE (non-zero) if the object has no points.
OGRCompoundCurve::CurveToLine
virtual OGRLineString * CurveToLine(double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=NULL) const CPL_OVERRIDE
Return a linestring from a curve geometry.
Definition: ogrcompoundcurve.cpp:367
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:999
OGRCurvePolygon::empty
virtual void empty() CPL_OVERRIDE
Clear geometry information.
Definition: ogrcurvepolygon.cpp:132
OGRPolyhedralSurface::getGeometryRef
OGRGeometry * getGeometryRef(int i)
Fetch geometry from container.
Definition: ogrpolyhedralsurface.cpp:936
OGRSimpleCurve::getY
double getY(int i) const
Get Y at vertex.
Definition: ogr_geometry.h:555

Generated for GDAL by 1.8.9.1.