- Main Page
- Related Pages
- Classes
- Files
- Directories

- File List
- File Members

# ogr_geometry.h

Go to the documentation of this file.

    00001 /******************************************************************************
    00002  * $Id: ogr_geometry.h 25450 2013-01-04 23:15:38Z rouault $
    00003  *
    00004  * Project:  OpenGIS Simple Features Reference Implementation
    00005  * Purpose:  Classes for manipulating simple features that is not specific
    00006  *           to a particular interface technology.
    00007  * Author:   Frank Warmerdam, warmerdam@pobox.com
    00008  *
    00009  ******************************************************************************
    00010  * Copyright (c) 1999, Frank Warmerdam
    00011  *
    00012  * Permission is hereby granted, free of charge, to any person obtaining a
    00013  * copy of this software and associated documentation files (the "Software"),
    00014  * to deal in the Software without restriction, including without limitation
    00015  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
    00016  * and/or sell copies of the Software, and to permit persons to whom the
    00017  * Software is furnished to do so, subject to the following conditions:
    00018  *
    00019  * The above copyright notice and this permission notice shall be included
    00020  * in all copies or substantial portions of the Software.
    00021  *
    00022  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
    00023  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00024  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
    00025  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    00026  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    00027  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    00028  * DEALINGS IN THE SOFTWARE.
    00029  ****************************************************************************/
    00030
    00031 #ifndef _OGR_GEOMETRY_H_INCLUDED
    00032 #define _OGR_GEOMETRY_H_INCLUDED
    00033
    00034 #include "ogr_core.h"
    00035 #include "ogr_spatialref.h"
    00036
    00046 class OGRRawPoint
    00047 {
    00048   public:
    00049           OGRRawPoint()
    00050           {
    00051                   x = y = 0.0;
    00052           }
    00053     double      x;
    00054     double      y;
    00055 };
    00056
    00057 typedef struct GEOSGeom_t *GEOSGeom;
    00058
    00059 /************************************************************************/
    00060 /*                             OGRGeometry                              */
    00061 /************************************************************************/
    00062
    00063 class OGRPoint;
    00064
    00077 class CPL_DLL OGRGeometry
    00078 {
    00079   private:
    00080     OGRSpatialReference * poSRS;                // may be NULL
    00081
    00082   protected:
    00083     int                   nCoordDimension;
    00084
    00085   public:
    00086                 OGRGeometry();
    00087     virtual     ~OGRGeometry();
    00088
    00089     // standard IGeometry
    00090     virtual int getDimension() const = 0;
    00091     virtual int getCoordinateDimension() const;
    00092     virtual OGRBoolean  IsEmpty() const = 0;
    00093     virtual OGRBoolean  IsValid() const;
    00094     virtual OGRBoolean  IsSimple() const;
    00095     virtual OGRBoolean  IsRing() const;
    00096     virtual void        empty() = 0;
    00097     virtual OGRGeometry *clone() const = 0;
    00098     virtual void getEnvelope( OGREnvelope * psEnvelope ) const = 0;
    00099     virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const = 0;
    00100
    00101     // IWks Interface
    00102     virtual int WkbSize() const = 0;
    00103     virtual OGRErr importFromWkb( unsigned char *, int=-1 )=0;
    00104     virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * ) const = 0;
    00105     virtual OGRErr importFromWkt( char ** ppszInput ) = 0;
    00106     virtual OGRErr exportToWkt( char ** ppszDstText ) const = 0;
    00107
    00108     // non-standard
    00109     virtual OGRwkbGeometryType getGeometryType() const = 0;
    00110     virtual const char *getGeometryName() const = 0;
    00111     virtual void   dumpReadable( FILE *, const char * = NULL, char** papszOptions = NULL ) const;
    00112     virtual void   flattenTo2D() = 0;
    00113     virtual char * exportToGML( const char* const * papszOptions = NULL ) const;
    00114         virtual char * exportToKML() const;
    00115     virtual char * exportToJson() const;
    00116     virtual GEOSGeom exportToGEOS() const;
    00117     virtual void closeRings();
    00118
    00119     virtual void setCoordinateDimension( int nDimension );
    00120
    00121     void    assignSpatialReference( OGRSpatialReference * poSR );
    00122     OGRSpatialReference *getSpatialReference( void ) const { return poSRS; }
    00123
    00124     virtual OGRErr  transform( OGRCoordinateTransformation *poCT ) = 0;
    00125     OGRErr  transformTo( OGRSpatialReference *poSR );
    00126
    00127     virtual void segmentize(double dfMaxLength);
    00128
    00129     // ISpatialRelation
    00130     virtual OGRBoolean  Intersects( OGRGeometry * ) const;
    00131     virtual OGRBoolean  Equals( OGRGeometry * ) const = 0;
    00132     virtual OGRBoolean  Disjoint( const OGRGeometry * ) const;
    00133     virtual OGRBoolean  Touches( const OGRGeometry * ) const;
    00134     virtual OGRBoolean  Crosses( const OGRGeometry * ) const;
    00135     virtual OGRBoolean  Within( const OGRGeometry * ) const;
    00136     virtual OGRBoolean  Contains( const OGRGeometry * ) const;
    00137     virtual OGRBoolean  Overlaps( const OGRGeometry * ) const;
    00138 //    virtual OGRBoolean  Relate( const OGRGeometry *, const char * ) const;
    00139
    00140     virtual OGRGeometry *Boundary() const;
    00141     virtual double  Distance( const OGRGeometry * ) const;
    00142     virtual OGRGeometry *ConvexHull() const;
    00143     virtual OGRGeometry *Buffer( double dfDist, int nQuadSegs = 30 ) const;
    00144     virtual OGRGeometry *Intersection( const OGRGeometry *) const;
    00145     virtual OGRGeometry *Union( const OGRGeometry * ) const;
    00146     virtual OGRGeometry *UnionCascaded() const;
    00147     virtual OGRGeometry *Difference( const OGRGeometry * ) const;
    00148     virtual OGRGeometry *SymDifference( const OGRGeometry * ) const;
    00149     virtual OGRErr       Centroid( OGRPoint * poPoint ) const;
    00150     virtual OGRGeometry *Simplify(double dTolerance) const;
    00151     OGRGeometry *SimplifyPreserveTopology(double dTolerance) const;
    00152
    00153     virtual OGRGeometry *Polygonize() const;
    00154
    00155     // backward compatibility to non-standard method names.
    00156     OGRBoolean  Intersect( OGRGeometry * ) const CPL_WARN_DEPRECATED("Non standard method. Use Intersects() instead");
    00157     OGRBoolean  Equal( OGRGeometry * ) const CPL_WARN_DEPRECATED("Non standard method. Use Equals() instead");
    00158     virtual OGRGeometry *SymmetricDifference( const OGRGeometry * ) const CPL_WARN_DEPRECATED("Non standard method. Use SymDifference() instead");
    00159     virtual OGRGeometry *getBoundary() const CPL_WARN_DEPRECATED("Non standard method. Use Boundary() instead");
    00160
    00161     // Special HACK for DB2 7.2 support
    00162     static int bGenerate_DB2_V72_BYTE_ORDER;
    00163
    00164     virtual void        swapXY();
    00165 };
    00166
    00167 /************************************************************************/
    00168 /*                               OGRPoint                               */
    00169 /************************************************************************/
    00170
    00177 class CPL_DLL OGRPoint : public OGRGeometry
    00178 {
    00179     double      x;
    00180     double      y;
    00181     double      z;
    00182
    00183   public:
    00184                 OGRPoint();
    00185                 OGRPoint( double x, double y );
    00186                 OGRPoint( double x, double y, double z );
    00187     virtual     ~OGRPoint();
    00188
    00189     // IWks Interface
    00190     virtual int WkbSize() const;
    00191     virtual OGRErr importFromWkb( unsigned char *, int=-1 );
    00192     virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * ) const;
    00193     virtual OGRErr importFromWkt( char ** );
    00194     virtual OGRErr exportToWkt( char ** ppszDstText ) const;
    00195
    00196     // IGeometry
    00197     virtual int getDimension() const;
    00198     virtual OGRGeometry *clone() const;
    00199     virtual void empty();
    00200     virtual void getEnvelope( OGREnvelope * psEnvelope ) const;
    00201     virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const;
    00202     virtual OGRBoolean  IsEmpty() const;
    00203
    00204     // IPoint
    00205     double      getX() const { return x; }
    00206     double      getY() const { return y; }
    00207     double      getZ() const { return z; }
    00208
    00209     // Non standard
    00210     virtual void setCoordinateDimension( int nDimension );
    00211     void        setX( double xIn ) { x = xIn; if (nCoordDimension == 0) nCoordDimension = 2; }
    00212     void        setY( double yIn ) { y = yIn; if (nCoordDimension == 0) nCoordDimension = 2; }
    00213     void        setZ( double zIn ) { z = zIn; nCoordDimension=3; }
    00214
    00215     // ISpatialRelation
    00216     virtual OGRBoolean  Equals( OGRGeometry * ) const;
    00217
    00218     // Non standard from OGRGeometry
    00219     virtual const char *getGeometryName() const;
    00220     virtual OGRwkbGeometryType getGeometryType() const;
    00221     virtual OGRErr  transform( OGRCoordinateTransformation *poCT );
    00222     virtual void flattenTo2D();
    00223
    00224     virtual void        swapXY();
    00225 };
    00226
    00227 /************************************************************************/
    00228 /*                               OGRCurve                               */
    00229 /************************************************************************/
    00230
    00235 class CPL_DLL OGRCurve : public OGRGeometry
    00236 {
    00237   public:
    00238             OGRCurve();
    00239     virtual ~OGRCurve();
    00240     // ICurve methods
    00241     virtual double get_Length() const = 0;
    00242     virtual void StartPoint(OGRPoint *) const = 0;
    00243     virtual void EndPoint(OGRPoint *) const = 0;
    00244     virtual int  get_IsClosed() const;
    00245     virtual void Value( double, OGRPoint * ) const = 0;
    00246
    00247 };
    00248
    00249 /************************************************************************/
    00250 /*                            OGRLineString                             */
    00251 /************************************************************************/
    00252
    00257 class CPL_DLL OGRLineString : public OGRCurve
    00258 {
    00259   protected:
    00260     int         nPointCount;
    00261     OGRRawPoint *paoPoints;
    00262     double      *padfZ;
    00263
    00264     void        Make3D();
    00265     void        Make2D();
    00266
    00267   public:
    00268                 OGRLineString();
    00269     virtual     ~OGRLineString();
    00270
    00271     // IWks Interface
    00272     virtual int WkbSize() const;
    00273     virtual OGRErr importFromWkb( unsigned char *, int = -1 );
    00274     virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * ) const;
    00275     virtual OGRErr importFromWkt( char ** );
    00276     virtual OGRErr exportToWkt( char ** ppszDstText ) const;
    00277
    00278     // IGeometry interface
    00279     virtual int getDimension() const;
    00280     virtual OGRGeometry *clone() const;
    00281     virtual void empty();
    00282     virtual void getEnvelope( OGREnvelope * psEnvelope ) const;
    00283     virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const;
    00284     virtual OGRBoolean  IsEmpty() const;
    00285
    00286     // ICurve methods
    00287     virtual double get_Length() const;
    00288     virtual void StartPoint(OGRPoint *) const;
    00289     virtual void EndPoint(OGRPoint *) const;
    00290     virtual void Value( double, OGRPoint * ) const;
    00291
    00292     // ILineString methods
    00293     int         getNumPoints() const { return nPointCount; }
    00294     void        getPoint( int, OGRPoint * ) const;
    00295     double      getX( int i ) const { return paoPoints[i].x; }
    00296     double      getY( int i ) const { return paoPoints[i].y; }
    00297     double      getZ( int i ) const;
    00298
    00299     // ISpatialRelation
    00300     virtual OGRBoolean  Equals( OGRGeometry * ) const;
    00301
    00302     // non standard.
    00303     virtual void setCoordinateDimension( int nDimension );
    00304     void        setNumPoints( int );
    00305     void        setPoint( int, OGRPoint * );
    00306     void        setPoint( int, double, double );
    00307     void        setPoint( int, double, double, double );
    00308     void        setPoints( int, OGRRawPoint *, double * = NULL );
    00309     void        setPoints( int, double * padfX, double * padfY,
    00310                            double *padfZ = NULL );
    00311     void        addPoint( OGRPoint * );
    00312     void        addPoint( double, double );
    00313     void        addPoint( double, double, double );
    00314
    00315     void        getPoints( OGRRawPoint *, double * = NULL ) const;
    00316     void        getPoints( void* pabyX, int nXStride,
    00317                            void* pabyY, int nYStride,
    00318                            void* pabyZ = NULL, int nZStride = 0 ) const;
    00319
    00320     void        addSubLineString( const OGRLineString *,
    00321                                   int nStartVertex = 0, int nEndVertex = -1 );
    00322     void        reversePoints( void );
    00323
    00324     // non-standard from OGRGeometry
    00325     virtual OGRwkbGeometryType getGeometryType() const;
    00326     virtual const char *getGeometryName() const;
    00327     virtual OGRErr  transform( OGRCoordinateTransformation *poCT );
    00328     virtual void flattenTo2D();
    00329     virtual void segmentize(double dfMaxLength);
    00330
    00331     virtual void        swapXY();
    00332 };
    00333
    00334 /************************************************************************/
    00335 /*                            OGRLinearRing                             */
    00336 /************************************************************************/
    00337
    00356 class CPL_DLL OGRLinearRing : public OGRLineString
    00357 {
    00358   private:
    00359     friend class OGRPolygon;
    00360
    00361     // These are not IWks compatible ... just a convenience for OGRPolygon.
    00362     virtual int _WkbSize( int b3D ) const;
    00363     virtual OGRErr _importFromWkb( OGRwkbByteOrder, int b3D,
    00364                                    unsigned char *, int=-1 );
    00365     virtual OGRErr _exportToWkb( OGRwkbByteOrder, int b3D,
    00366                                  unsigned char * ) const;
    00367
    00368   public:
    00369                         OGRLinearRing();
    00370                         OGRLinearRing( OGRLinearRing * );
    00371                         ~OGRLinearRing();
    00372
    00373     // Non standard.
    00374     virtual const char *getGeometryName() const;
    00375     virtual OGRGeometry *clone() const;
    00376     virtual int isClockwise() const;
    00377     virtual void reverseWindingOrder();
    00378     virtual void closeRings();
    00379     virtual double get_Area() const;
    00380     OGRBoolean isPointInRing(const OGRPoint* pt, int bTestEnvelope = TRUE) const;
    00381     OGRBoolean isPointOnRingBoundary(const OGRPoint* pt, int bTestEnvelope = TRUE) const;
    00382
    00383     // IWks Interface - Note this isnt really a first class object
    00384     // for the purposes of WKB form.  These methods always fail since this
    00385     // object cant be serialized on its own.
    00386     virtual int WkbSize() const;
    00387     virtual OGRErr importFromWkb( unsigned char *, int=-1 );
    00388     virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * ) const;
    00389 };
    00390
    00391 /************************************************************************/
    00392 /*                              OGRSurface                              */
    00393 /************************************************************************/
    00394
    00399 class CPL_DLL OGRSurface : public OGRGeometry
    00400 {
    00401   public:
    00402     virtual double      get_Area() const = 0;
    00403     virtual OGRErr      PointOnSurface( OGRPoint * poPoint ) const = 0;
    00404 };
    00405
    00406 /************************************************************************/
    00407 /*                              OGRPolygon                              */
    00408 /************************************************************************/
    00409
    00419 class CPL_DLL OGRPolygon : public OGRSurface
    00420 {
    00421     int         nRingCount;
    00422     OGRLinearRing **papoRings;
    00423
    00424   public:
    00425                 OGRPolygon();
    00426     virtual     ~OGRPolygon();
    00427
    00428     // Non standard (OGRGeometry).
    00429     virtual const char *getGeometryName() const;
    00430     virtual OGRwkbGeometryType getGeometryType() const;
    00431     virtual OGRGeometry *clone() const;
    00432     virtual void empty();
    00433     virtual OGRErr  transform( OGRCoordinateTransformation *poCT );
    00434     virtual void flattenTo2D();
    00435     virtual OGRBoolean  IsEmpty() const;
    00436     virtual void segmentize(double dfMaxLength);
    00437
    00438     // ISurface Interface
    00439     virtual double      get_Area() const;
    00440     virtual int         PointOnSurface( OGRPoint * poPoint ) const;
    00441
    00442     // IWks Interface
    00443     virtual int WkbSize() const;
    00444     virtual OGRErr importFromWkb( unsigned char *, int = -1 );
    00445     virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * ) const;
    00446     virtual OGRErr importFromWkt( char ** );
    00447     virtual OGRErr exportToWkt( char ** ppszDstText ) const;
    00448
    00449     // IGeometry
    00450     virtual int getDimension() const;
    00451     virtual void getEnvelope( OGREnvelope * psEnvelope ) const;
    00452     virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const;
    00453
    00454     // ISpatialRelation
    00455     virtual OGRBoolean  Equals( OGRGeometry * ) const;
    00456
    00457     // Non standard
    00458     virtual void setCoordinateDimension( int nDimension );
    00459
    00460     void        addRing( OGRLinearRing * );
    00461     void        addRingDirectly( OGRLinearRing * );
    00462
    00463     OGRLinearRing *getExteriorRing();
    00464     const OGRLinearRing *getExteriorRing() const;
    00465     int         getNumInteriorRings() const;
    00466     OGRLinearRing *getInteriorRing( int );
    00467     const OGRLinearRing *getInteriorRing( int ) const;
    00468
    00469     OGRBoolean IsPointOnSurface( const OGRPoint * ) const;
    00470
    00471     virtual void closeRings();
    00472
    00473     virtual void        swapXY();
    00474 };
    00475
    00476 /************************************************************************/
    00477 /*                        OGRGeometryCollection                         */
    00478 /************************************************************************/
    00479
    00487 class CPL_DLL OGRGeometryCollection : public OGRGeometry
    00488 {
    00489     int         nGeomCount;
    00490     OGRGeometry **papoGeoms;
    00491
    00492     OGRErr      importFromWkbInternal( unsigned char * pabyData, int nSize, int nRecLevel );
    00493     OGRErr      importFromWktInternal( char **ppszInput, int nRecLevel );
    00494
    00495   public:
    00496                 OGRGeometryCollection();
    00497     virtual     ~OGRGeometryCollection();
    00498
    00499     // Non standard (OGRGeometry).
    00500     virtual const char *getGeometryName() const;
    00501     virtual OGRwkbGeometryType getGeometryType() const;
    00502     virtual OGRGeometry *clone() const;
    00503     virtual void empty();
    00504     virtual OGRErr  transform( OGRCoordinateTransformation *poCT );
    00505     virtual void flattenTo2D();
    00506     virtual OGRBoolean  IsEmpty() const;
    00507     virtual void segmentize(double dfMaxLength);
    00508
    00509     // IWks Interface
    00510     virtual int WkbSize() const;
    00511     virtual OGRErr importFromWkb( unsigned char *, int = -1 );
    00512     virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * ) const;
    00513     virtual OGRErr importFromWkt( char ** );
    00514     virtual OGRErr exportToWkt( char ** ppszDstText ) const;
    00515
    00516     virtual double get_Length() const;
    00517     virtual double get_Area() const;
    00518
    00519     // IGeometry methods
    00520     virtual int getDimension() const;
    00521     virtual void getEnvelope( OGREnvelope * psEnvelope ) const;
    00522     virtual void getEnvelope( OGREnvelope3D * psEnvelope ) const;
    00523
    00524     // IGeometryCollection
    00525     int         getNumGeometries() const;
    00526     OGRGeometry *getGeometryRef( int );
    00527     const OGRGeometry *getGeometryRef( int ) const;
    00528
    00529     // ISpatialRelation
    00530     virtual OGRBoolean  Equals( OGRGeometry * ) const;
    00531
    00532     // Non standard
    00533     virtual void setCoordinateDimension( int nDimension );
    00534     virtual OGRErr addGeometry( const OGRGeometry * );
    00535     virtual OGRErr addGeometryDirectly( OGRGeometry * );
    00536     virtual OGRErr removeGeometry( int iIndex, int bDelete = TRUE );
    00537
    00538     void closeRings();
    00539
    00540     virtual void        swapXY();
    00541 };
    00542
    00543 /************************************************************************/
    00544 /*                           OGRMultiPolygon                            */
    00545 /************************************************************************/
    00546
    00554 class CPL_DLL OGRMultiPolygon : public OGRGeometryCollection
    00555 {
    00556   public:
    00557             OGRMultiPolygon();
    00558     // Non standard (OGRGeometry).
    00559     virtual const char *getGeometryName() const;
    00560     virtual OGRwkbGeometryType getGeometryType() const;
    00561     virtual OGRGeometry *clone() const;
    00562     virtual OGRErr importFromWkt( char ** );
    00563     virtual OGRErr exportToWkt( char ** ) const;
    00564
    00565     // IGeometry methods
    00566     virtual int getDimension() const;
    00567
    00568     // Non standard
    00569     virtual OGRErr addGeometryDirectly( OGRGeometry * );
    00570
    00571     virtual double  get_Area() const;
    00572 };
    00573
    00574 /************************************************************************/
    00575 /*                            OGRMultiPoint                             */
    00576 /************************************************************************/
    00577
    00582 class CPL_DLL OGRMultiPoint : public OGRGeometryCollection
    00583 {
    00584   private:
    00585     OGRErr  importFromWkt_Bracketed( char **, int bHasM, int bHasZ );
    00586
    00587   public:
    00588             OGRMultiPoint();
    00589     // Non standard (OGRGeometry).
    00590     virtual const char *getGeometryName() const;
    00591     virtual OGRwkbGeometryType getGeometryType() const;
    00592     virtual OGRGeometry *clone() const;
    00593     virtual OGRErr importFromWkt( char ** );
    00594     virtual OGRErr exportToWkt( char ** ) const;
    00595
    00596     // IGeometry methods
    00597     virtual int getDimension() const;
    00598
    00599     // Non standard
    00600     virtual OGRErr addGeometryDirectly( OGRGeometry * );
    00601 };
    00602
    00603 /************************************************************************/
    00604 /*                          OGRMultiLineString                          */
    00605 /************************************************************************/
    00606
    00611 class CPL_DLL OGRMultiLineString : public OGRGeometryCollection
    00612 {
    00613   public:
    00614             OGRMultiLineString();
    00615             ~OGRMultiLineString();
    00616     // Non standard (OGRGeometry).
    00617     virtual const char *getGeometryName() const;
    00618     virtual OGRwkbGeometryType getGeometryType() const;
    00619     virtual OGRGeometry *clone() const;
    00620     virtual OGRErr importFromWkt( char ** );
    00621     virtual OGRErr exportToWkt( char ** ) const;
    00622
    00623     // IGeometry methods
    00624     virtual int getDimension() const;
    00625
    00626     // Non standard
    00627     virtual OGRErr addGeometryDirectly( OGRGeometry * );
    00628 };
    00629
    00630
    00631 /************************************************************************/
    00632 /*                          OGRGeometryFactory                          */
    00633 /************************************************************************/
    00634
    00639 class CPL_DLL OGRGeometryFactory
    00640 {
    00641     static OGRErr createFromFgfInternal( unsigned char *pabyData,
    00642                                          OGRSpatialReference * poSR,
    00643                                          OGRGeometry **ppoReturn,
    00644                                          int nBytes,
    00645                                          int *pnBytesConsumed,
    00646                                          int nRecLevel );
    00647   public:
    00648     static OGRErr createFromWkb( unsigned char *, OGRSpatialReference *,
    00649                                  OGRGeometry **, int = -1 );
    00650     static OGRErr createFromWkt( char **, OGRSpatialReference *,
    00651                                  OGRGeometry ** );
    00652     static OGRErr createFromFgf( unsigned char *, OGRSpatialReference *,
    00653                                  OGRGeometry **, int = -1, int * = NULL );
    00654     static OGRGeometry *createFromGML( const char * );
    00655     static OGRGeometry *createFromGEOS( GEOSGeom );
    00656
    00657     static void   destroyGeometry( OGRGeometry * );
    00658     static OGRGeometry *createGeometry( OGRwkbGeometryType );
    00659
    00660     static OGRGeometry * forceToPolygon( OGRGeometry * );
    00661     static OGRGeometry * forceToLineString( OGRGeometry *, bool bOnlyInOrder = true );
    00662     static OGRGeometry * forceToMultiPolygon( OGRGeometry * );
    00663     static OGRGeometry * forceToMultiPoint( OGRGeometry * );
    00664     static OGRGeometry * forceToMultiLineString( OGRGeometry * );
    00665
    00666     static OGRGeometry * organizePolygons( OGRGeometry **papoPolygons,
    00667                                            int nPolygonCount,
    00668                                            int *pbResultValidGeometry,
    00669                                            const char **papszOptions = NULL);
    00670
    00671     static void *getGEOSGeometryFactory();
    00672
    00673     static int haveGEOS();
    00674
    00675     static OGRGeometry* transformWithOptions( const OGRGeometry* poSrcGeom,
    00676                                               OGRCoordinateTransformation *poCT,
    00677                                               char** papszOptions );
    00678
    00679     static OGRGeometry*
    00680         approximateArcAngles( double dfX, double dfY, double dfZ,
    00681                               double dfPrimaryRadius, double dfSecondaryAxis,
    00682                               double dfRotation,
    00683                               double dfStartAngle, double dfEndAngle,
    00684                               double dfMaxAngleStepSizeDegrees );
    00685 };
    00686
    00687 OGRwkbGeometryType CPL_DLL OGRFromOGCGeomType( const char *pszGeomType );
    00688 const char CPL_DLL * OGRToOGCGeomType( OGRwkbGeometryType eGeomType );
    00689
    00690 /* Prepared geometry API (needs GEOS >= 3.1.0) */
    00691 typedef struct _OGRPreparedGeometry OGRPreparedGeometry;
    00692 int OGRHasPreparedGeometrySupport();
    00693 OGRPreparedGeometry* OGRCreatePreparedGeometry( const OGRGeometry* poGeom );
    00694 void OGRDestroyPreparedGeometry( OGRPreparedGeometry* poPreparedGeom );
    00695 int OGRPreparedGeometryIntersects( const OGRPreparedGeometry* poPreparedGeom,
    00696                                    const OGRGeometry* poOtherGeom );
    00697
    00698 #endif /* ndef _OGR_GEOMETRY_H_INCLUDED */

Generated for GDAL by 1.7.1.