OGR
ogr_geometry.h
Go to the documentation of this file.
1 /******************************************************************************
2  * $Id: ogr_geometry.h 25450 2013-01-04 23:15:38Z rouault $
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  *
12  * Permission is hereby granted, free of charge, to any person obtaining a
13  * copy of this software and associated documentation files (the "Software"),
14  * to deal in the Software without restriction, including without limitation
15  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16  * and/or sell copies of the Software, and to permit persons to whom the
17  * Software is furnished to do so, subject to the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be included
20  * in all copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28  * DEALINGS IN THE SOFTWARE.
29  ****************************************************************************/
30 
31 #ifndef _OGR_GEOMETRY_H_INCLUDED
32 #define _OGR_GEOMETRY_H_INCLUDED
33 
34 #include "ogr_core.h"
35 #include "ogr_spatialref.h"
36 
47 {
48  public:
49  OGRRawPoint()
50  {
51  x = y = 0.0;
52  }
53  double x;
54  double y;
55 };
56 
57 typedef struct GEOSGeom_t *GEOSGeom;
58 
59 /************************************************************************/
60 /* OGRGeometry */
61 /************************************************************************/
62 
63 class OGRPoint;
64 
77 class CPL_DLL OGRGeometry
78 {
79  private:
80  OGRSpatialReference * poSRS; // may be NULL
81 
82  protected:
83  int nCoordDimension;
84 
85  public:
86  OGRGeometry();
87  virtual ~OGRGeometry();
88 
89  // standard IGeometry
90  virtual int getDimension() const = 0;
91  virtual int getCoordinateDimension() const;
92  virtual OGRBoolean IsEmpty() const = 0;
93  virtual OGRBoolean IsValid() const;
94  virtual OGRBoolean IsSimple() const;
95  virtual OGRBoolean IsRing() const;
96  virtual void empty() = 0;
97  virtual OGRGeometry *clone() const = 0;
98  virtual void getEnvelope( OGREnvelope * psEnvelope ) const = 0;
99  virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const = 0;
100 
101  // IWks Interface
102  virtual int WkbSize() const = 0;
103  virtual OGRErr importFromWkb( unsigned char *, int=-1 )=0;
104  virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * ) const = 0;
105  virtual OGRErr importFromWkt( char ** ppszInput ) = 0;
106  virtual OGRErr exportToWkt( char ** ppszDstText ) const = 0;
107 
108  // non-standard
109  virtual OGRwkbGeometryType getGeometryType() const = 0;
110  virtual const char *getGeometryName() const = 0;
111  virtual void dumpReadable( FILE *, const char * = NULL, char** papszOptions = NULL ) const;
112  virtual void flattenTo2D() = 0;
113  virtual char * exportToGML( const char* const * papszOptions = NULL ) const;
114  virtual char * exportToKML() const;
115  virtual char * exportToJson() const;
116  virtual GEOSGeom exportToGEOS() const;
117  virtual void closeRings();
118 
119  virtual void setCoordinateDimension( int nDimension );
120 
121  void assignSpatialReference( OGRSpatialReference * poSR );
122  OGRSpatialReference *getSpatialReference( void ) const { return poSRS; }
123 
124  virtual OGRErr transform( OGRCoordinateTransformation *poCT ) = 0;
125  OGRErr transformTo( OGRSpatialReference *poSR );
126 
127  virtual void segmentize(double dfMaxLength);
128 
129  // ISpatialRelation
130  virtual OGRBoolean Intersects( OGRGeometry * ) const;
131  virtual OGRBoolean Equals( OGRGeometry * ) const = 0;
132  virtual OGRBoolean Disjoint( const OGRGeometry * ) const;
133  virtual OGRBoolean Touches( const OGRGeometry * ) const;
134  virtual OGRBoolean Crosses( const OGRGeometry * ) const;
135  virtual OGRBoolean Within( const OGRGeometry * ) const;
136  virtual OGRBoolean Contains( const OGRGeometry * ) const;
137  virtual OGRBoolean Overlaps( const OGRGeometry * ) const;
138 // virtual OGRBoolean Relate( const OGRGeometry *, const char * ) const;
139 
140  virtual OGRGeometry *Boundary() const;
141  virtual double Distance( const OGRGeometry * ) const;
142  virtual OGRGeometry *ConvexHull() const;
143  virtual OGRGeometry *Buffer( double dfDist, int nQuadSegs = 30 ) const;
144  virtual OGRGeometry *Intersection( const OGRGeometry *) const;
145  virtual OGRGeometry *Union( const OGRGeometry * ) const;
146  virtual OGRGeometry *UnionCascaded() const;
147  virtual OGRGeometry *Difference( const OGRGeometry * ) const;
148  virtual OGRGeometry *SymDifference( const OGRGeometry * ) const;
149  virtual OGRErr Centroid( OGRPoint * poPoint ) const;
150  virtual OGRGeometry *Simplify(double dTolerance) const;
151  OGRGeometry *SimplifyPreserveTopology(double dTolerance) const;
152 
153  virtual OGRGeometry *Polygonize() const;
154 
155  // backward compatibility to non-standard method names.
156  OGRBoolean Intersect( OGRGeometry * ) const CPL_WARN_DEPRECATED("Non standard method. Use Intersects() instead");
157  OGRBoolean Equal( OGRGeometry * ) const CPL_WARN_DEPRECATED("Non standard method. Use Equals() instead");
158  virtual OGRGeometry *SymmetricDifference( const OGRGeometry * ) const CPL_WARN_DEPRECATED("Non standard method. Use SymDifference() instead");
159  virtual OGRGeometry *getBoundary() const CPL_WARN_DEPRECATED("Non standard method. Use Boundary() instead");
160 
161  // Special HACK for DB2 7.2 support
162  static int bGenerate_DB2_V72_BYTE_ORDER;
163 
164  virtual void swapXY();
165 };
166 
167 /************************************************************************/
168 /* OGRPoint */
169 /************************************************************************/
170 
177 class CPL_DLL OGRPoint : public OGRGeometry
178 {
179  double x;
180  double y;
181  double z;
182 
183  public:
184  OGRPoint();
185  OGRPoint( double x, double y );
186  OGRPoint( double x, double y, double z );
187  virtual ~OGRPoint();
188 
189  // IWks Interface
190  virtual int WkbSize() const;
191  virtual OGRErr importFromWkb( unsigned char *, int=-1 );
192  virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * ) const;
193  virtual OGRErr importFromWkt( char ** );
194  virtual OGRErr exportToWkt( char ** ppszDstText ) const;
195 
196  // IGeometry
197  virtual int getDimension() const;
198  virtual OGRGeometry *clone() const;
199  virtual void empty();
200  virtual void getEnvelope( OGREnvelope * psEnvelope ) const;
201  virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const;
202  virtual OGRBoolean IsEmpty() const;
203 
204  // IPoint
205  double getX() const { return x; }
206  double getY() const { return y; }
207  double getZ() const { return z; }
208 
209  // Non standard
210  virtual void setCoordinateDimension( int nDimension );
211  void setX( double xIn ) { x = xIn; if (nCoordDimension == 0) nCoordDimension = 2; }
212  void setY( double yIn ) { y = yIn; if (nCoordDimension == 0) nCoordDimension = 2; }
213  void setZ( double zIn ) { z = zIn; nCoordDimension=3; }
214 
215  // ISpatialRelation
216  virtual OGRBoolean Equals( OGRGeometry * ) const;
217 
218  // Non standard from OGRGeometry
219  virtual const char *getGeometryName() const;
220  virtual OGRwkbGeometryType getGeometryType() const;
221  virtual OGRErr transform( OGRCoordinateTransformation *poCT );
222  virtual void flattenTo2D();
223 
224  virtual void swapXY();
225 };
226 
227 /************************************************************************/
228 /* OGRCurve */
229 /************************************************************************/
230 
235 class CPL_DLL OGRCurve : public OGRGeometry
236 {
237  public:
238  OGRCurve();
239  virtual ~OGRCurve();
240  // ICurve methods
241  virtual double get_Length() const = 0;
242  virtual void StartPoint(OGRPoint *) const = 0;
243  virtual void EndPoint(OGRPoint *) const = 0;
244  virtual int get_IsClosed() const;
245  virtual void Value( double, OGRPoint * ) const = 0;
246 
247 };
248 
249 /************************************************************************/
250 /* OGRLineString */
251 /************************************************************************/
252 
257 class CPL_DLL OGRLineString : public OGRCurve
258 {
259  protected:
260  int nPointCount;
261  OGRRawPoint *paoPoints;
262  double *padfZ;
263 
264  void Make3D();
265  void Make2D();
266 
267  public:
268  OGRLineString();
269  virtual ~OGRLineString();
270 
271  // IWks Interface
272  virtual int WkbSize() const;
273  virtual OGRErr importFromWkb( unsigned char *, int = -1 );
274  virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * ) const;
275  virtual OGRErr importFromWkt( char ** );
276  virtual OGRErr exportToWkt( char ** ppszDstText ) const;
277 
278  // IGeometry interface
279  virtual int getDimension() const;
280  virtual OGRGeometry *clone() const;
281  virtual void empty();
282  virtual void getEnvelope( OGREnvelope * psEnvelope ) const;
283  virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const;
284  virtual OGRBoolean IsEmpty() const;
285 
286  // ICurve methods
287  virtual double get_Length() const;
288  virtual void StartPoint(OGRPoint *) const;
289  virtual void EndPoint(OGRPoint *) const;
290  virtual void Value( double, OGRPoint * ) const;
291 
292  // ILineString methods
293  int getNumPoints() const { return nPointCount; }
294  void getPoint( int, OGRPoint * ) const;
295  double getX( int i ) const { return paoPoints[i].x; }
296  double getY( int i ) const { return paoPoints[i].y; }
297  double getZ( int i ) const;
298 
299  // ISpatialRelation
300  virtual OGRBoolean Equals( OGRGeometry * ) const;
301 
302  // non standard.
303  virtual void setCoordinateDimension( int nDimension );
304  void setNumPoints( int );
305  void setPoint( int, OGRPoint * );
306  void setPoint( int, double, double );
307  void setPoint( int, double, double, double );
308  void setPoints( int, OGRRawPoint *, double * = NULL );
309  void setPoints( int, double * padfX, double * padfY,
310  double *padfZ = NULL );
311  void addPoint( OGRPoint * );
312  void addPoint( double, double );
313  void addPoint( double, double, double );
314 
315  void getPoints( OGRRawPoint *, double * = NULL ) const;
316  void getPoints( void* pabyX, int nXStride,
317  void* pabyY, int nYStride,
318  void* pabyZ = NULL, int nZStride = 0 ) const;
319 
320  void addSubLineString( const OGRLineString *,
321  int nStartVertex = 0, int nEndVertex = -1 );
322  void reversePoints( void );
323 
324  // non-standard from OGRGeometry
325  virtual OGRwkbGeometryType getGeometryType() const;
326  virtual const char *getGeometryName() const;
327  virtual OGRErr transform( OGRCoordinateTransformation *poCT );
328  virtual void flattenTo2D();
329  virtual void segmentize(double dfMaxLength);
330 
331  virtual void swapXY();
332 };
333 
334 /************************************************************************/
335 /* OGRLinearRing */
336 /************************************************************************/
337 
356 class CPL_DLL OGRLinearRing : public OGRLineString
357 {
358  private:
359  friend class OGRPolygon;
360 
361  // These are not IWks compatible ... just a convenience for OGRPolygon.
362  virtual int _WkbSize( int b3D ) const;
363  virtual OGRErr _importFromWkb( OGRwkbByteOrder, int b3D,
364  unsigned char *, int=-1 );
365  virtual OGRErr _exportToWkb( OGRwkbByteOrder, int b3D,
366  unsigned char * ) const;
367 
368  public:
369  OGRLinearRing();
371  ~OGRLinearRing();
372 
373  // Non standard.
374  virtual const char *getGeometryName() const;
375  virtual OGRGeometry *clone() const;
376  virtual int isClockwise() const;
377  virtual void reverseWindingOrder();
378  virtual void closeRings();
379  virtual double get_Area() const;
380  OGRBoolean isPointInRing(const OGRPoint* pt, int bTestEnvelope = TRUE) const;
381  OGRBoolean isPointOnRingBoundary(const OGRPoint* pt, int bTestEnvelope = TRUE) const;
382 
383  // IWks Interface - Note this isnt really a first class object
384  // for the purposes of WKB form. These methods always fail since this
385  // object cant be serialized on its own.
386  virtual int WkbSize() const;
387  virtual OGRErr importFromWkb( unsigned char *, int=-1 );
388  virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * ) const;
389 };
390 
391 /************************************************************************/
392 /* OGRSurface */
393 /************************************************************************/
394 
399 class CPL_DLL OGRSurface : public OGRGeometry
400 {
401  public:
402  virtual double get_Area() const = 0;
403  virtual OGRErr PointOnSurface( OGRPoint * poPoint ) const = 0;
404 };
405 
406 /************************************************************************/
407 /* OGRPolygon */
408 /************************************************************************/
409 
419 class CPL_DLL OGRPolygon : public OGRSurface
420 {
421  int nRingCount;
422  OGRLinearRing **papoRings;
423 
424  public:
425  OGRPolygon();
426  virtual ~OGRPolygon();
427 
428  // Non standard (OGRGeometry).
429  virtual const char *getGeometryName() const;
430  virtual OGRwkbGeometryType getGeometryType() const;
431  virtual OGRGeometry *clone() const;
432  virtual void empty();
433  virtual OGRErr transform( OGRCoordinateTransformation *poCT );
434  virtual void flattenTo2D();
435  virtual OGRBoolean IsEmpty() const;
436  virtual void segmentize(double dfMaxLength);
437 
438  // ISurface Interface
439  virtual double get_Area() const;
440  virtual int PointOnSurface( OGRPoint * poPoint ) const;
441 
442  // IWks Interface
443  virtual int WkbSize() const;
444  virtual OGRErr importFromWkb( unsigned char *, int = -1 );
445  virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * ) const;
446  virtual OGRErr importFromWkt( char ** );
447  virtual OGRErr exportToWkt( char ** ppszDstText ) const;
448 
449  // IGeometry
450  virtual int getDimension() const;
451  virtual void getEnvelope( OGREnvelope * psEnvelope ) const;
452  virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const;
453 
454  // ISpatialRelation
455  virtual OGRBoolean Equals( OGRGeometry * ) const;
456 
457  // Non standard
458  virtual void setCoordinateDimension( int nDimension );
459 
460  void addRing( OGRLinearRing * );
461  void addRingDirectly( OGRLinearRing * );
462 
463  OGRLinearRing *getExteriorRing();
464  const OGRLinearRing *getExteriorRing() const;
465  int getNumInteriorRings() const;
466  OGRLinearRing *getInteriorRing( int );
467  const OGRLinearRing *getInteriorRing( int ) const;
468 
469  OGRBoolean IsPointOnSurface( const OGRPoint * ) const;
470 
471  virtual void closeRings();
472 
473  virtual void swapXY();
474 };
475 
476 /************************************************************************/
477 /* OGRGeometryCollection */
478 /************************************************************************/
479 
487 class CPL_DLL OGRGeometryCollection : public OGRGeometry
488 {
489  int nGeomCount;
490  OGRGeometry **papoGeoms;
491 
492  OGRErr importFromWkbInternal( unsigned char * pabyData, int nSize, int nRecLevel );
493  OGRErr importFromWktInternal( char **ppszInput, int nRecLevel );
494 
495  public:
497  virtual ~OGRGeometryCollection();
498 
499  // Non standard (OGRGeometry).
500  virtual const char *getGeometryName() const;
501  virtual OGRwkbGeometryType getGeometryType() const;
502  virtual OGRGeometry *clone() const;
503  virtual void empty();
504  virtual OGRErr transform( OGRCoordinateTransformation *poCT );
505  virtual void flattenTo2D();
506  virtual OGRBoolean IsEmpty() const;
507  virtual void segmentize(double dfMaxLength);
508 
509  // IWks Interface
510  virtual int WkbSize() const;
511  virtual OGRErr importFromWkb( unsigned char *, int = -1 );
512  virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * ) const;
513  virtual OGRErr importFromWkt( char ** );
514  virtual OGRErr exportToWkt( char ** ppszDstText ) const;
515 
516  virtual double get_Length() const;
517  virtual double get_Area() const;
518 
519  // IGeometry methods
520  virtual int getDimension() const;
521  virtual void getEnvelope( OGREnvelope * psEnvelope ) const;
522  virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const;
523 
524  // IGeometryCollection
525  int getNumGeometries() const;
526  OGRGeometry *getGeometryRef( int );
527  const OGRGeometry *getGeometryRef( int ) const;
528 
529  // ISpatialRelation
530  virtual OGRBoolean Equals( OGRGeometry * ) const;
531 
532  // Non standard
533  virtual void setCoordinateDimension( int nDimension );
534  virtual OGRErr addGeometry( const OGRGeometry * );
535  virtual OGRErr addGeometryDirectly( OGRGeometry * );
536  virtual OGRErr removeGeometry( int iIndex, int bDelete = TRUE );
537 
538  void closeRings();
539 
540  virtual void swapXY();
541 };
542 
543 /************************************************************************/
544 /* OGRMultiPolygon */
545 /************************************************************************/
546 
555 {
556  public:
557  OGRMultiPolygon();
558  // Non standard (OGRGeometry).
559  virtual const char *getGeometryName() const;
560  virtual OGRwkbGeometryType getGeometryType() const;
561  virtual OGRGeometry *clone() const;
562  virtual OGRErr importFromWkt( char ** );
563  virtual OGRErr exportToWkt( char ** ) const;
564 
565  // IGeometry methods
566  virtual int getDimension() const;
567 
568  // Non standard
569  virtual OGRErr addGeometryDirectly( OGRGeometry * );
570 
571  virtual double get_Area() const;
572 };
573 
574 /************************************************************************/
575 /* OGRMultiPoint */
576 /************************************************************************/
577 
582 class CPL_DLL OGRMultiPoint : public OGRGeometryCollection
583 {
584  private:
585  OGRErr importFromWkt_Bracketed( char **, int bHasM, int bHasZ );
586 
587  public:
588  OGRMultiPoint();
589  // Non standard (OGRGeometry).
590  virtual const char *getGeometryName() const;
591  virtual OGRwkbGeometryType getGeometryType() const;
592  virtual OGRGeometry *clone() const;
593  virtual OGRErr importFromWkt( char ** );
594  virtual OGRErr exportToWkt( char ** ) const;
595 
596  // IGeometry methods
597  virtual int getDimension() const;
598 
599  // Non standard
600  virtual OGRErr addGeometryDirectly( OGRGeometry * );
601 };
602 
603 /************************************************************************/
604 /* OGRMultiLineString */
605 /************************************************************************/
606 
612 {
613  public:
616  // Non standard (OGRGeometry).
617  virtual const char *getGeometryName() const;
618  virtual OGRwkbGeometryType getGeometryType() const;
619  virtual OGRGeometry *clone() const;
620  virtual OGRErr importFromWkt( char ** );
621  virtual OGRErr exportToWkt( char ** ) const;
622 
623  // IGeometry methods
624  virtual int getDimension() const;
625 
626  // Non standard
627  virtual OGRErr addGeometryDirectly( OGRGeometry * );
628 };
629 
630 
631 /************************************************************************/
632 /* OGRGeometryFactory */
633 /************************************************************************/
634 
639 class CPL_DLL OGRGeometryFactory
640 {
641  static OGRErr createFromFgfInternal( unsigned char *pabyData,
642  OGRSpatialReference * poSR,
643  OGRGeometry **ppoReturn,
644  int nBytes,
645  int *pnBytesConsumed,
646  int nRecLevel );
647  public:
648  static OGRErr createFromWkb( unsigned char *, OGRSpatialReference *,
649  OGRGeometry **, int = -1 );
650  static OGRErr createFromWkt( char **, OGRSpatialReference *,
651  OGRGeometry ** );
652  static OGRErr createFromFgf( unsigned char *, OGRSpatialReference *,
653  OGRGeometry **, int = -1, int * = NULL );
654  static OGRGeometry *createFromGML( const char * );
655  static OGRGeometry *createFromGEOS( GEOSGeom );
656 
657  static void destroyGeometry( OGRGeometry * );
658  static OGRGeometry *createGeometry( OGRwkbGeometryType );
659 
660  static OGRGeometry * forceToPolygon( OGRGeometry * );
661  static OGRGeometry * forceToLineString( OGRGeometry *, bool bOnlyInOrder = true );
662  static OGRGeometry * forceToMultiPolygon( OGRGeometry * );
663  static OGRGeometry * forceToMultiPoint( OGRGeometry * );
664  static OGRGeometry * forceToMultiLineString( OGRGeometry * );
665 
666  static OGRGeometry * organizePolygons( OGRGeometry **papoPolygons,
667  int nPolygonCount,
668  int *pbResultValidGeometry,
669  const char **papszOptions = NULL);
670 
671  static void *getGEOSGeometryFactory();
672 
673  static int haveGEOS();
674 
675  static OGRGeometry* transformWithOptions( const OGRGeometry* poSrcGeom,
677  char** papszOptions );
678 
679  static OGRGeometry*
680  approximateArcAngles( double dfX, double dfY, double dfZ,
681  double dfPrimaryRadius, double dfSecondaryAxis,
682  double dfRotation,
683  double dfStartAngle, double dfEndAngle,
684  double dfMaxAngleStepSizeDegrees );
685 };
686 
687 OGRwkbGeometryType CPL_DLL OGRFromOGCGeomType( const char *pszGeomType );
688 const char CPL_DLL * OGRToOGCGeomType( OGRwkbGeometryType eGeomType );
689 
690 /* Prepared geometry API (needs GEOS >= 3.1.0) */
691 typedef struct _OGRPreparedGeometry OGRPreparedGeometry;
692 int OGRHasPreparedGeometrySupport();
693 OGRPreparedGeometry* OGRCreatePreparedGeometry( const OGRGeometry* poGeom );
694 void OGRDestroyPreparedGeometry( OGRPreparedGeometry* poPreparedGeom );
695 int OGRPreparedGeometryIntersects( const OGRPreparedGeometry* poPreparedGeom,
696  const OGRGeometry* poOtherGeom );
697 
698 #endif /* ndef _OGR_GEOMETRY_H_INCLUDED */
virtual void Value(double, OGRPoint *) const =0
Fetch point at given distance along curve.
virtual void closeRings()
Force rings to be closed.
Definition: ogrgeometry.cpp:3383
virtual OGRwkbGeometryType getGeometryType() const =0
Fetch geometry type.
virtual void setCoordinateDimension(int nDimension)
Set the coordinate dimension.
Definition: ogrgeometry.cpp:706
virtual OGRErr importFromWkb(unsigned char *, int=-1)
Assign geometry from well known binary data.
Definition: ogrlinestring.cpp:808
virtual OGRErr exportToWkb(OGRwkbByteOrder, unsigned char *) const
Convert a geometry into well known binary format.
Definition: ogrlinestring.cpp:928
Definition: ogr_geometry.h:257
virtual OGRErr importFromWkt(char **ppszInput)=0
Assign geometry from well known text data.
double getY() const
Fetch Y coordinate.
Definition: ogr_geometry.h:206
virtual OGRGeometry * clone() const =0
Make a copy of this object.
virtual void swapXY()
Swap x and y coordinates.
Definition: ogrgeometry.cpp:3945
Definition: ogr_geometry.h:639
virtual const char * getGeometryName() const =0
Fetch WKT name for geometry type.
virtual OGRErr exportToWkt(char **ppszDstText) const
Convert a geometry into well known text format.
Definition: ogrgeometrycollection.cpp:779
int getNumPoints() const
Fetch vertex count.
Definition: ogr_geometry.h:293
virtual void EndPoint(OGRPoint *) const =0
Return the curve end point.
Definition: ogr_geometry.h:554
virtual OGRBoolean Equals(OGRGeometry *) const =0
Returns TRUE if two geometries are equivalent.
virtual void flattenTo2D()=0
Convert geometry to strictly 2D. In a sense this converts all Z coordinates to 0.0.
Definition: ogr_geometry.h:235
Definition: ogr_geometry.h:487
Definition: ogr_geometry.h:356
virtual OGRGeometry * clone() const
Make a copy of this object.
Definition: ogrgeometrycollection.cpp:86
virtual int getDimension() const
Get the dimension of this object.
Definition: ogrgeometrycollection.cpp:119
virtual double get_Length() const =0
Returns the length of the curve.
virtual void StartPoint(OGRPoint *) const =0
Return the curve start point.
Definition: ogr_geometry.h:46
OGRwkbGeometryType
Definition: ogr_core.h:297
virtual OGRwkbGeometryType getGeometryType() const
Fetch geometry type.
Definition: ogrgeometrycollection.cpp:106
virtual OGRErr PointOnSurface(OGRPoint *poPoint) const =0
This method relates to the SFCOM ISurface::get_PointOnSurface() method.
Definition: ogr_geometry.h:399
Definition: ogr_geometry.h:611
Definition: ogr_geometry.h:77
double getY(int i) const
Get Y at vertex.
Definition: ogr_geometry.h:296
virtual void empty()=0
Clear geometry information. This restores the geometry to it's initial state after construction...
virtual void segmentize(double dfMaxLength)
Modify the geometry such it has no segment longer then the given distance.
Definition: ogrgeometry.cpp:583
double getZ() const
Fetch Z coordinate.
Definition: ogr_geometry.h:207
void setX(double xIn)
Assign point X coordinate.
Definition: ogr_geometry.h:211
virtual OGRErr importFromWkt(char **)
Assign geometry from well known text data.
Definition: ogrgeometrycollection.cpp:766
virtual OGRErr addGeometryDirectly(OGRGeometry *)
Add a geometry directly to the container.
Definition: ogrgeometrycollection.cpp:281
virtual double get_Area() const =0
Get the area of the surface object.
void setZ(double zIn)
Assign point Z coordinate. Calling this method will force the geometry coordinate dimension to 3D (wk...
Definition: ogr_geometry.h:213
virtual int getDimension() const =0
Get the dimension of this object.
virtual OGRErr exportToWkt(char **ppszDstText) const =0
Convert a geometry into well known text format.
virtual const char * getGeometryName() const
Fetch WKT name for geometry type.
Definition: ogrlinestring.cpp:92
virtual OGRErr exportToWkb(OGRwkbByteOrder, unsigned char *) const =0
Convert a geometry into well known binary format.
virtual OGRErr importFromWkb(unsigned char *, int=-1)=0
Assign geometry from well known binary data.
void setY(double yIn)
Assign point Y coordinate.
Definition: ogr_geometry.h:212
Definition: ogr_spatialref.h:128
Definition: ogr_core.h:151
Definition: ogr_geometry.h:177
virtual int WkbSize() const =0
Returns size of related binary representation.
virtual void getEnvelope(OGREnvelope *psEnvelope) const =0
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure...
double getX() const
Fetch X coordinate.
Definition: ogr_geometry.h:205
virtual double get_Area() const
Compute area of polygon.
Definition: ogrpolygon.cpp:1039
virtual int WkbSize() const
Returns size of related binary representation.
Definition: ogrlinestring.cpp:157
Definition: ogr_geometry.h:419
Definition: ogr_core.h:47
Definition: ogr_spatialref.h:568
OGRSpatialReference * getSpatialReference(void) const
Returns spatial reference system for object.
Definition: ogr_geometry.h:122
virtual OGRErr transform(OGRCoordinateTransformation *poCT)=0
Apply arbitrary coordinate transformation to geometry.
virtual OGRGeometry * clone() const
Make a copy of this object.
Definition: ogrlinestring.cpp:102
virtual const char * getGeometryName() const
Fetch WKT name for geometry type.
Definition: ogrgeometrycollection.cpp:155
virtual double get_Area() const
Compute area of geometry collection.
Definition: ogrgeometrycollection.cpp:1091
Definition: ogr_geometry.h:582
double getX(int i) const
Get X at vertex.
Definition: ogr_geometry.h:295
virtual OGRBoolean IsEmpty() const =0
Returns TRUE (non-zero) if the object has no points.

Generated for GDAL by doxygen 1.8.8.