OGR
ogr_geometry.h
Go to the documentation of this file.
1 /******************************************************************************
2  * $Id: ogr_geometry.h 27088 2014-03-24 23:18:08Z bishop $
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 
48 {
49  public:
50  OGRRawPoint()
51  {
52  x = y = 0.0;
53  }
54  double x;
55  double y;
56 };
57 
58 typedef struct GEOSGeom_t *GEOSGeom;
59 typedef struct GEOSContextHandle_HS *GEOSContextHandle_t;
60 
61 /************************************************************************/
62 /* OGRGeometry */
63 /************************************************************************/
64 
65 class OGRPoint;
66 
79 class CPL_DLL OGRGeometry
80 {
81  private:
82  OGRSpatialReference * poSRS; // may be NULL
83 
84  protected:
85  int nCoordDimension;
86  int getIsoGeometryType() const;
87 
88  public:
89  OGRGeometry();
90  virtual ~OGRGeometry();
91 
92  // standard IGeometry
93  virtual int getDimension() const = 0;
94  virtual int getCoordinateDimension() const;
95  virtual OGRBoolean IsEmpty() const = 0;
96  virtual OGRBoolean IsValid() const;
97  virtual OGRBoolean IsSimple() const;
98  virtual OGRBoolean IsRing() const;
99  virtual void empty() = 0;
100  virtual OGRGeometry *clone() const = 0;
101  virtual void getEnvelope( OGREnvelope * psEnvelope ) const = 0;
102  virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const = 0;
103 
104  // IWks Interface
105  virtual int WkbSize() const = 0;
106  virtual OGRErr importFromWkb( unsigned char *, int=-1 )=0;
107  virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOgc ) const = 0;
108  virtual OGRErr importFromWkt( char ** ppszInput ) = 0;
109  virtual OGRErr exportToWkt( char ** ppszDstText ) const = 0;
110 
111  // non-standard
112  virtual OGRwkbGeometryType getGeometryType() const = 0;
113  virtual const char *getGeometryName() const = 0;
114  virtual void dumpReadable( FILE *, const char * = NULL, char** papszOptions = NULL ) const;
115  virtual void flattenTo2D() = 0;
116  virtual char * exportToGML( const char* const * papszOptions = NULL ) const;
117  virtual char * exportToKML() const;
118  virtual char * exportToJson() const;
119 
120  static GEOSContextHandle_t createGEOSContext();
121  static void freeGEOSContext(GEOSContextHandle_t hGEOSCtxt);
122  virtual GEOSGeom exportToGEOS(GEOSContextHandle_t hGEOSCtxt) const;
123 
124  virtual void closeRings();
125 
126  virtual void setCoordinateDimension( int nDimension );
127 
128  void assignSpatialReference( OGRSpatialReference * poSR );
129  OGRSpatialReference *getSpatialReference( void ) const { return poSRS; }
130 
131  virtual OGRErr transform( OGRCoordinateTransformation *poCT ) = 0;
132  OGRErr transformTo( OGRSpatialReference *poSR );
133 
134  virtual void segmentize(double dfMaxLength);
135 
136  // ISpatialRelation
137  virtual OGRBoolean Intersects( OGRGeometry * ) const;
138  virtual OGRBoolean Equals( OGRGeometry * ) const = 0;
139  virtual OGRBoolean Disjoint( const OGRGeometry * ) const;
140  virtual OGRBoolean Touches( const OGRGeometry * ) const;
141  virtual OGRBoolean Crosses( const OGRGeometry * ) const;
142  virtual OGRBoolean Within( const OGRGeometry * ) const;
143  virtual OGRBoolean Contains( const OGRGeometry * ) const;
144  virtual OGRBoolean Overlaps( const OGRGeometry * ) const;
145 // virtual OGRBoolean Relate( const OGRGeometry *, const char * ) const;
146 
147  virtual OGRGeometry *Boundary() const;
148  virtual double Distance( const OGRGeometry * ) const;
149  virtual OGRGeometry *ConvexHull() const;
150  virtual OGRGeometry *Buffer( double dfDist, int nQuadSegs = 30 ) const;
151  virtual OGRGeometry *Intersection( const OGRGeometry *) const;
152  virtual OGRGeometry *Union( const OGRGeometry * ) const;
153  virtual OGRGeometry *UnionCascaded() const;
154  virtual OGRGeometry *Difference( const OGRGeometry * ) const;
155  virtual OGRGeometry *SymDifference( const OGRGeometry * ) const;
156  virtual OGRErr Centroid( OGRPoint * poPoint ) const;
157  virtual OGRGeometry *Simplify(double dTolerance) const;
158  OGRGeometry *SimplifyPreserveTopology(double dTolerance) const;
159 
160  virtual OGRGeometry *Polygonize() const;
161 
162  // backward compatibility to non-standard method names.
163  OGRBoolean Intersect( OGRGeometry * ) const CPL_WARN_DEPRECATED("Non standard method. Use Intersects() instead");
164  OGRBoolean Equal( OGRGeometry * ) const CPL_WARN_DEPRECATED("Non standard method. Use Equals() instead");
165  virtual OGRGeometry *SymmetricDifference( const OGRGeometry * ) const CPL_WARN_DEPRECATED("Non standard method. Use SymDifference() instead");
166  virtual OGRGeometry *getBoundary() const CPL_WARN_DEPRECATED("Non standard method. Use Boundary() instead");
167 
168  // Special HACK for DB2 7.2 support
169  static int bGenerate_DB2_V72_BYTE_ORDER;
170 
171  virtual void swapXY();
172 };
173 
174 /************************************************************************/
175 /* OGRPoint */
176 /************************************************************************/
177 
184 class CPL_DLL OGRPoint : public OGRGeometry
185 {
186  double x;
187  double y;
188  double z;
189 
190  public:
191  OGRPoint();
192  OGRPoint( double x, double y );
193  OGRPoint( double x, double y, double z );
194  virtual ~OGRPoint();
195 
196  // IWks Interface
197  virtual int WkbSize() const;
198  virtual OGRErr importFromWkb( unsigned char *, int=-1 );
199  virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOgc ) const;
200  virtual OGRErr importFromWkt( char ** );
201  virtual OGRErr exportToWkt( char ** ppszDstText ) const;
202 
203  // IGeometry
204  virtual int getDimension() const;
205  virtual OGRGeometry *clone() const;
206  virtual void empty();
207  virtual void getEnvelope( OGREnvelope * psEnvelope ) const;
208  virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const;
209  virtual OGRBoolean IsEmpty() const;
210 
211  // IPoint
212  double getX() const { return x; }
213  double getY() const { return y; }
214  double getZ() const { return z; }
215 
216  // Non standard
217  virtual void setCoordinateDimension( int nDimension );
218  void setX( double xIn ) { x = xIn; if (nCoordDimension == 0) nCoordDimension = 2; }
219  void setY( double yIn ) { y = yIn; if (nCoordDimension == 0) nCoordDimension = 2; }
220  void setZ( double zIn ) { z = zIn; nCoordDimension=3; }
221 
222  // ISpatialRelation
223  virtual OGRBoolean Equals( OGRGeometry * ) const;
224 
225  // Non standard from OGRGeometry
226  virtual const char *getGeometryName() const;
227  virtual OGRwkbGeometryType getGeometryType() const;
228  virtual OGRErr transform( OGRCoordinateTransformation *poCT );
229  virtual void flattenTo2D();
230 
231  virtual void swapXY();
232 };
233 
234 /************************************************************************/
235 /* OGRCurve */
236 /************************************************************************/
237 
242 class CPL_DLL OGRCurve : public OGRGeometry
243 {
244  public:
245  OGRCurve();
246  virtual ~OGRCurve();
247  // ICurve methods
248  virtual double get_Length() const = 0;
249  virtual void StartPoint(OGRPoint *) const = 0;
250  virtual void EndPoint(OGRPoint *) const = 0;
251  virtual int get_IsClosed() const;
252  virtual void Value( double, OGRPoint * ) const = 0;
253 
254 };
255 
256 /************************************************************************/
257 /* OGRLineString */
258 /************************************************************************/
259 
264 class CPL_DLL OGRLineString : public OGRCurve
265 {
266  protected:
267  int nPointCount;
268  OGRRawPoint *paoPoints;
269  double *padfZ;
270 
271  void Make3D();
272  void Make2D();
273 
274  public:
275  OGRLineString();
276  virtual ~OGRLineString();
277 
278  // IWks Interface
279  virtual int WkbSize() const;
280  virtual OGRErr importFromWkb( unsigned char *, int = -1 );
281  virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOgc ) const;
282  virtual OGRErr importFromWkt( char ** );
283  virtual OGRErr exportToWkt( char ** ppszDstText ) const;
284 
285  // IGeometry interface
286  virtual int getDimension() const;
287  virtual OGRGeometry *clone() const;
288  virtual void empty();
289  virtual void getEnvelope( OGREnvelope * psEnvelope ) const;
290  virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const;
291  virtual OGRBoolean IsEmpty() const;
292 
293  // ICurve methods
294  virtual double get_Length() const;
295  virtual void StartPoint(OGRPoint *) const;
296  virtual void EndPoint(OGRPoint *) const;
297  virtual void Value( double, OGRPoint * ) const;
298  virtual double Project(const OGRPoint *) const;
299  virtual OGRLineString* getSubLine(double, double, int) const;
300 
301  // ILineString methods
302  int getNumPoints() const { return nPointCount; }
303  void getPoint( int, OGRPoint * ) const;
304  double getX( int i ) const { return paoPoints[i].x; }
305  double getY( int i ) const { return paoPoints[i].y; }
306  double getZ( int i ) const;
307 
308  // ISpatialRelation
309  virtual OGRBoolean Equals( OGRGeometry * ) const;
310 
311  // non standard.
312  virtual void setCoordinateDimension( int nDimension );
313  void setNumPoints( int nNewPointCount, int bZeroizeNewContent = TRUE );
314  void setPoint( int, OGRPoint * );
315  void setPoint( int, double, double );
316  void setZ( int, double );
317  void setPoint( int, double, double, double );
318  void setPoints( int, OGRRawPoint *, double * = NULL );
319  void setPoints( int, double * padfX, double * padfY,
320  double *padfZ = NULL );
321  void addPoint( OGRPoint * );
322  void addPoint( double, double );
323  void addPoint( double, double, double );
324 
325  void getPoints( OGRRawPoint *, double * = NULL ) const;
326  void getPoints( void* pabyX, int nXStride,
327  void* pabyY, int nYStride,
328  void* pabyZ = NULL, int nZStride = 0 ) const;
329 
330  void addSubLineString( const OGRLineString *,
331  int nStartVertex = 0, int nEndVertex = -1 );
332  void reversePoints( void );
333 
334  // non-standard from OGRGeometry
335  virtual OGRwkbGeometryType getGeometryType() const;
336  virtual const char *getGeometryName() const;
337  virtual OGRErr transform( OGRCoordinateTransformation *poCT );
338  virtual void flattenTo2D();
339  virtual void segmentize(double dfMaxLength);
340 
341  virtual void swapXY();
342 };
343 
344 /************************************************************************/
345 /* OGRLinearRing */
346 /************************************************************************/
347 
366 class CPL_DLL OGRLinearRing : public OGRLineString
367 {
368  private:
369  friend class OGRPolygon;
370 
371  // These are not IWks compatible ... just a convenience for OGRPolygon.
372  virtual int _WkbSize( int b3D ) const;
373  virtual OGRErr _importFromWkb( OGRwkbByteOrder, int b3D,
374  unsigned char *, int=-1 );
375  virtual OGRErr _exportToWkb( OGRwkbByteOrder, int b3D,
376  unsigned char * ) const;
377 
378  public:
379  OGRLinearRing();
381  ~OGRLinearRing();
382 
383  // Non standard.
384  virtual const char *getGeometryName() const;
385  virtual OGRGeometry *clone() const;
386  virtual int isClockwise() const;
387  virtual void reverseWindingOrder();
388  virtual void closeRings();
389  virtual double get_Area() const;
390  OGRBoolean isPointInRing(const OGRPoint* pt, int bTestEnvelope = TRUE) const;
391  OGRBoolean isPointOnRingBoundary(const OGRPoint* pt, int bTestEnvelope = TRUE) const;
392 
393  // IWks Interface - Note this isnt really a first class object
394  // for the purposes of WKB form. These methods always fail since this
395  // object cant be serialized on its own.
396  virtual int WkbSize() const;
397  virtual OGRErr importFromWkb( unsigned char *, int=-1 );
398  virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOgc ) const;
399 };
400 
401 /************************************************************************/
402 /* OGRSurface */
403 /************************************************************************/
404 
409 class CPL_DLL OGRSurface : public OGRGeometry
410 {
411  public:
412  virtual double get_Area() const = 0;
413  virtual OGRErr PointOnSurface( OGRPoint * poPoint ) const = 0;
414 };
415 
416 /************************************************************************/
417 /* OGRPolygon */
418 /************************************************************************/
419 
429 class CPL_DLL OGRPolygon : public OGRSurface
430 {
431  int nRingCount;
432  OGRLinearRing **papoRings;
433 
434  public:
435  OGRPolygon();
436  virtual ~OGRPolygon();
437 
438  // Non standard (OGRGeometry).
439  virtual const char *getGeometryName() const;
440  virtual OGRwkbGeometryType getGeometryType() const;
441  virtual OGRGeometry *clone() const;
442  virtual void empty();
443  virtual OGRErr transform( OGRCoordinateTransformation *poCT );
444  virtual void flattenTo2D();
445  virtual OGRBoolean IsEmpty() const;
446  virtual void segmentize(double dfMaxLength);
447 
448  // ISurface Interface
449  virtual double get_Area() const;
450  virtual int PointOnSurface( OGRPoint * poPoint ) const;
451 
452  // IWks Interface
453  virtual int WkbSize() const;
454  virtual OGRErr importFromWkb( unsigned char *, int = -1 );
455  virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOgc ) const;
456  virtual OGRErr importFromWkt( char ** );
457  virtual OGRErr exportToWkt( char ** ppszDstText ) const;
458 
459  // IGeometry
460  virtual int getDimension() const;
461  virtual void getEnvelope( OGREnvelope * psEnvelope ) const;
462  virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const;
463 
464  // ISpatialRelation
465  virtual OGRBoolean Equals( OGRGeometry * ) const;
466 
467  // Non standard
468  virtual void setCoordinateDimension( int nDimension );
469 
470  void addRing( OGRLinearRing * );
471  void addRingDirectly( OGRLinearRing * );
472 
473  OGRLinearRing *getExteriorRing();
474  const OGRLinearRing *getExteriorRing() const;
475  int getNumInteriorRings() const;
476  OGRLinearRing *getInteriorRing( int );
477  const OGRLinearRing *getInteriorRing( int ) const;
478 
479  OGRLinearRing *stealExteriorRing();
480  OGRLinearRing *stealInteriorRing(int);
481 
482  OGRBoolean IsPointOnSurface( const OGRPoint * ) const;
483 
484  virtual void closeRings();
485 
486  virtual void swapXY();
487 };
488 
489 /************************************************************************/
490 /* OGRGeometryCollection */
491 /************************************************************************/
492 
500 class CPL_DLL OGRGeometryCollection : public OGRGeometry
501 {
502  int nGeomCount;
503  OGRGeometry **papoGeoms;
504 
505  OGRErr importFromWkbInternal( unsigned char * pabyData, int nSize, int nRecLevel );
506  OGRErr importFromWktInternal( char **ppszInput, int nRecLevel );
507 
508  public:
510  virtual ~OGRGeometryCollection();
511 
512  // Non standard (OGRGeometry).
513  virtual const char *getGeometryName() const;
514  virtual OGRwkbGeometryType getGeometryType() const;
515  virtual OGRGeometry *clone() const;
516  virtual void empty();
517  virtual OGRErr transform( OGRCoordinateTransformation *poCT );
518  virtual void flattenTo2D();
519  virtual OGRBoolean IsEmpty() const;
520  virtual void segmentize(double dfMaxLength);
521 
522  // IWks Interface
523  virtual int WkbSize() const;
524  virtual OGRErr importFromWkb( unsigned char *, int = -1 );
525  virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOgc ) const;
526  virtual OGRErr importFromWkt( char ** );
527  virtual OGRErr exportToWkt( char ** ppszDstText ) const;
528 
529  virtual double get_Length() const;
530  virtual double get_Area() const;
531 
532  // IGeometry methods
533  virtual int getDimension() const;
534  virtual void getEnvelope( OGREnvelope * psEnvelope ) const;
535  virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const;
536 
537  // IGeometryCollection
538  int getNumGeometries() const;
539  OGRGeometry *getGeometryRef( int );
540  const OGRGeometry *getGeometryRef( int ) const;
541 
542  // ISpatialRelation
543  virtual OGRBoolean Equals( OGRGeometry * ) const;
544 
545  // Non standard
546  virtual void setCoordinateDimension( int nDimension );
547  virtual OGRErr addGeometry( const OGRGeometry * );
548  virtual OGRErr addGeometryDirectly( OGRGeometry * );
549  virtual OGRErr removeGeometry( int iIndex, int bDelete = TRUE );
550 
551  void closeRings();
552 
553  virtual void swapXY();
554 };
555 
556 /************************************************************************/
557 /* OGRMultiPolygon */
558 /************************************************************************/
559 
568 {
569  public:
570  OGRMultiPolygon();
571  // Non standard (OGRGeometry).
572  virtual const char *getGeometryName() const;
573  virtual OGRwkbGeometryType getGeometryType() const;
574  virtual OGRGeometry *clone() const;
575  virtual OGRErr importFromWkt( char ** );
576  virtual OGRErr exportToWkt( char ** ) const;
577 
578  // IGeometry methods
579  virtual int getDimension() const;
580 
581  // Non standard
582  virtual OGRErr addGeometryDirectly( OGRGeometry * );
583 
584  virtual double get_Area() const;
585 };
586 
587 /************************************************************************/
588 /* OGRMultiPoint */
589 /************************************************************************/
590 
595 class CPL_DLL OGRMultiPoint : public OGRGeometryCollection
596 {
597  private:
598  OGRErr importFromWkt_Bracketed( char **, int bHasM, int bHasZ );
599 
600  public:
601  OGRMultiPoint();
602  // Non standard (OGRGeometry).
603  virtual const char *getGeometryName() const;
604  virtual OGRwkbGeometryType getGeometryType() const;
605  virtual OGRGeometry *clone() const;
606  virtual OGRErr importFromWkt( char ** );
607  virtual OGRErr exportToWkt( char ** ) const;
608 
609  // IGeometry methods
610  virtual int getDimension() const;
611 
612  // Non standard
613  virtual OGRErr addGeometryDirectly( OGRGeometry * );
614 };
615 
616 /************************************************************************/
617 /* OGRMultiLineString */
618 /************************************************************************/
619 
625 {
626  public:
629  // Non standard (OGRGeometry).
630  virtual const char *getGeometryName() const;
631  virtual OGRwkbGeometryType getGeometryType() const;
632  virtual OGRGeometry *clone() const;
633  virtual OGRErr importFromWkt( char ** );
634  virtual OGRErr exportToWkt( char ** ) const;
635 
636  // IGeometry methods
637  virtual int getDimension() const;
638 
639  // Non standard
640  virtual OGRErr addGeometryDirectly( OGRGeometry * );
641 };
642 
643 
644 /************************************************************************/
645 /* OGRGeometryFactory */
646 /************************************************************************/
647 
652 class CPL_DLL OGRGeometryFactory
653 {
654  static OGRErr createFromFgfInternal( unsigned char *pabyData,
655  OGRSpatialReference * poSR,
656  OGRGeometry **ppoReturn,
657  int nBytes,
658  int *pnBytesConsumed,
659  int nRecLevel );
660  public:
661  static OGRErr createFromWkb( unsigned char *, OGRSpatialReference *,
662  OGRGeometry **, int = -1 );
663  static OGRErr createFromWkt( char **, OGRSpatialReference *,
664  OGRGeometry ** );
665  static OGRErr createFromFgf( unsigned char *, OGRSpatialReference *,
666  OGRGeometry **, int = -1, int * = NULL );
667  static OGRGeometry *createFromGML( const char * );
668  static OGRGeometry *createFromGEOS( GEOSContextHandle_t hGEOSCtxt, GEOSGeom );
669 
670  static void destroyGeometry( OGRGeometry * );
671  static OGRGeometry *createGeometry( OGRwkbGeometryType );
672 
673  static OGRGeometry * forceToPolygon( OGRGeometry * );
674  static OGRGeometry * forceToLineString( OGRGeometry *, bool bOnlyInOrder = true );
675  static OGRGeometry * forceToMultiPolygon( OGRGeometry * );
676  static OGRGeometry * forceToMultiPoint( OGRGeometry * );
677  static OGRGeometry * forceToMultiLineString( OGRGeometry * );
678 
679  static OGRGeometry * organizePolygons( OGRGeometry **papoPolygons,
680  int nPolygonCount,
681  int *pbResultValidGeometry,
682  const char **papszOptions = NULL);
683  static int haveGEOS();
684 
685  static OGRGeometry* transformWithOptions( const OGRGeometry* poSrcGeom,
687  char** papszOptions );
688 
689  static OGRGeometry*
690  approximateArcAngles( double dfX, double dfY, double dfZ,
691  double dfPrimaryRadius, double dfSecondaryAxis,
692  double dfRotation,
693  double dfStartAngle, double dfEndAngle,
694  double dfMaxAngleStepSizeDegrees );
695 };
696 
697 OGRwkbGeometryType CPL_DLL OGRFromOGCGeomType( const char *pszGeomType );
698 const char CPL_DLL * OGRToOGCGeomType( OGRwkbGeometryType eGeomType );
699 
700 /* Prepared geometry API (needs GEOS >= 3.1.0) */
701 typedef struct _OGRPreparedGeometry OGRPreparedGeometry;
702 int OGRHasPreparedGeometrySupport();
703 OGRPreparedGeometry* OGRCreatePreparedGeometry( const OGRGeometry* poGeom );
704 void OGRDestroyPreparedGeometry( OGRPreparedGeometry* poPreparedGeom );
705 int OGRPreparedGeometryIntersects( const OGRPreparedGeometry* poPreparedGeom,
706  const OGRGeometry* poOtherGeom );
707 
708 #endif /* ndef _OGR_GEOMETRY_H_INCLUDED */
virtual void closeRings()
Force rings to be closed.
Definition: ogrpolygon.cpp:1065
Definition: ogr_geometry.h:264
double getY() const
Fetch Y coordinate.
Definition: ogr_geometry.h:213
virtual OGRErr exportToWkb(OGRwkbByteOrder, unsigned char *, OGRwkbVariant=wkbVariantOgc) const
Convert a geometry into well known binary format.
Definition: ogrpolygon.cpp:497
Definition: ogr_geometry.h:652
int getNumPoints() const
Fetch vertex count.
Definition: ogr_geometry.h:302
Definition: ogr_geometry.h:567
Definition: ogr_geometry.h:242
Definition: ogr_geometry.h:500
Definition: ogr_geometry.h:366
virtual int WkbSize() const
Returns size of related binary representation.
Definition: ogrpolygon.cpp:361
Definition: ogr_geometry.h:47
OGRwkbGeometryType
Definition: ogr_core.h:308
Definition: ogr_geometry.h:409
Definition: ogr_geometry.h:624
Definition: ogr_geometry.h:79
double getY(int i) const
Get Y at vertex.
Definition: ogr_geometry.h:305
double getZ() const
Fetch Z coordinate.
Definition: ogr_geometry.h:214
void setX(double xIn)
Assign point X coordinate.
Definition: ogr_geometry.h:218
void setZ(double zIn)
Assign point Z coordinate. Calling this method will force the geometry coordinate dimension to 3D (wk...
Definition: ogr_geometry.h:220
virtual OGRGeometry * clone() const
Make a copy of this object.
Definition: ogrpolygon.cpp:67
Definition: ogr_core.h:342
void setY(double yIn)
Assign point Y coordinate.
Definition: ogr_geometry.h:219
Definition: ogr_spatialref.h:129
virtual OGRErr importFromWkb(unsigned char *, int=-1)
Assign geometry from well known binary data.
Definition: ogrpolygon.cpp:382
Definition: ogr_core.h:162
Definition: ogr_geometry.h:184
OGRwkbVariant
Definition: ogr_core.h:340
double getX() const
Fetch X coordinate.
Definition: ogr_geometry.h:212
virtual double get_Area() const
Compute area of polygon.
Definition: ogrpolygon.cpp:1085
Definition: ogr_geometry.h:429
Definition: ogr_core.h:48
Definition: ogr_spatialref.h:569
OGRSpatialReference * getSpatialReference(void) const
Returns spatial reference system for object.
Definition: ogr_geometry.h:129
virtual const char * getGeometryName() const
Fetch WKT name for geometry type.
Definition: ogrpolygon.cpp:144
Definition: ogr_geometry.h:595
double getX(int i) const
Get X at vertex.
Definition: ogr_geometry.h:304

Generated for GDAL by doxygen 1.8.11.