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

Generated for GDAL by 1.7.1.