Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

ogr_geometry.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  * $Id: ogr_geometry.h,v 1.46 2003/09/11 22:47:54 aamici Exp $
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, warmerda@home.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  * $Log: ogr_geometry.h,v $
00032  * Revision 1.46  2003/09/11 22:47:54  aamici
00033  * add class constructors and destructors where needed in order to
00034  * let the mingw/cygwin binutils produce sensible partially linked objet files
00035  * with 'ld -r'.
00036  *
00037  * Revision 1.45  2003/08/27 15:40:37  warmerda
00038  * added support for generating DB2 V7.2 compatible WKB
00039  *
00040  * Revision 1.44  2003/05/28 19:16:42  warmerda
00041  * fixed up argument names and stuff for docs
00042  *
00043  * Revision 1.43  2003/04/28 15:39:33  warmerda
00044  * ryan added forceToMultiPolyline and forceToMultiPoint
00045  *
00046  * Revision 1.42  2003/03/06 20:29:27  warmerda
00047  * added GML import/export entry points
00048  *
00049  * Revision 1.41  2003/01/14 22:13:35  warmerda
00050  * added isClockwise() method on OGRLinearRing
00051  *
00052  * Revision 1.40  2003/01/08 22:04:11  warmerda
00053  * added forceToPolygon and forceToMultiPolygon methods
00054  *
00055  * Revision 1.39  2003/01/07 16:44:27  warmerda
00056  * added removeGeometry
00057  *
00058  * Revision 1.38  2003/01/02 21:45:23  warmerda
00059  * move OGRBuildPolygonsFromEdges into C API
00060  *
00061  * Revision 1.37  2002/10/25 15:20:50  warmerda
00062  * fixed MULTIPOINT WKT format
00063  *
00064  * Revision 1.36  2002/10/24 20:53:02  warmerda
00065  * expand tabs
00066  *
00067  * Revision 1.35  2002/09/26 18:13:17  warmerda
00068  * moved some defs to ogr_core.h for sharing with ogr_api.h
00069  *
00070  * Revision 1.34  2002/09/11 13:47:17  warmerda
00071  * preliminary set of fixes for 3D WKB enum
00072  *
00073  * Revision 1.33  2002/08/12 15:02:18  warmerda
00074  * added OGRRawPoint and OGREnvelope initializes
00075  *
00076  * Revision 1.32  2002/05/02 19:45:36  warmerda
00077  * added flattenTo2D() method
00078  *
00079  * Revision 1.31  2002/02/22 22:23:38  warmerda
00080  * added tolerances when assembling polygons
00081  *
00082  * Revision 1.30  2002/02/18 21:12:23  warmerda
00083  * added OGRBuildPolygonFromEdges
00084  *
00085  * Revision 1.29  2001/11/01 16:56:08  warmerda
00086  * added createGeometry and destroyGeometry methods
00087  *
00088  * Revision 1.28  2001/09/21 16:24:20  warmerda
00089  * added transform() and transformTo() methods
00090  *
00091  * Revision 1.27  2001/09/04 14:48:34  warmerda
00092  * added some more 2.5D geometry types
00093  *
00094  * Revision 1.26  2001/05/24 18:05:18  warmerda
00095  * substantial fixes to WKT support for MULTIPOINT/LINE/POLYGON
00096  *
00097  * Revision 1.25  2001/02/06 17:10:28  warmerda
00098  * export entry points from DLL
00099  *
00100  * Revision 1.24  2001/01/19 21:10:47  warmerda
00101  * replaced tabs
00102  *
00103  * Revision 1.23  2000/10/17 17:55:26  warmerda
00104  * added comments for byte orders
00105  *
00106  * Revision 1.22  2000/04/26 18:25:55  warmerda
00107  * added missing CPL_DLL attributes
00108  *
00109  * Revision 1.21  2000/03/14 21:38:17  warmerda
00110  * added method to translate geometrytype to name
00111  *
00112  * Revision 1.20  1999/11/18 19:02:20  warmerda
00113  * expanded tabs
00114  *
00115  * Revision 1.19  1999/11/04 16:26:12  warmerda
00116  * Added the addGeometryDirectly() method for containers.
00117  *
00118  * Revision 1.18  1999/09/22 13:19:09  warmerda
00119  * Added the addRingDirectly() method on OGRPolygon.
00120  *
00121  * Revision 1.17  1999/09/13 14:34:07  warmerda
00122  * updated to use wkbZ of 0x8000 instead of 0x80000000
00123  *
00124  * Revision 1.16  1999/09/13 02:27:32  warmerda
00125  * incorporated limited 2.5d support
00126  *
00127  * Revision 1.15  1999/08/29 17:14:29  warmerda
00128  * Added wkbNone.
00129  *
00130  * Revision 1.14  1999/07/27 00:48:11  warmerda
00131  * Added Equal() support
00132  *
00133  * Revision 1.13  1999/07/08 20:26:03  warmerda
00134  * No longer override getGeometryType() on OGRLinearRing.
00135  *
00136  * Revision 1.12  1999/07/07 04:23:07  danmo
00137  * Fixed typo in  #define _OGR_..._H_INCLUDED  line
00138  *
00139  * Revision 1.11  1999/07/06 21:36:46  warmerda
00140  * tenatively added getEnvelope() and Intersect()
00141  *
00142  * Revision 1.10  1999/06/25 20:44:42  warmerda
00143  * implemented assignSpatialReference, carry properly
00144  *
00145  * Revision 1.9  1999/05/31 20:44:11  warmerda
00146  * ogr_geometry.h
00147  *
00148  * Revision 1.8  1999/05/31 15:01:59  warmerda
00149  * OGRCurve now an abstract base class with essentially no implementation.
00150  * Everything moved down to OGRLineString where it belongs.  Also documented
00151  * classes.
00152  *
00153  * Revision 1.7  1999/05/31 11:05:08  warmerda
00154  * added some documentation
00155  *
00156  * Revision 1.6  1999/05/23 05:34:40  warmerda
00157  * added support for clone(), multipolygons and geometry collections
00158  *
00159  * Revision 1.5  1999/05/20 14:35:44  warmerda
00160  * added support for well known text format
00161  *
00162  * Revision 1.4  1999/05/17 14:39:13  warmerda
00163  * Added ICurve, and some other IGeometry and related methods.
00164  *
00165  * Revision 1.3  1999/05/14 13:30:59  warmerda
00166  * added IsEmpty() and IsSimple()
00167  *
00168  * Revision 1.2  1999/03/30 21:21:43  warmerda
00169  * added linearring/polygon support
00170  *
00171  * Revision 1.1  1999/03/29 21:21:10  warmerda
00172  * New
00173  *
00174  */
00175 
00176 #ifndef _OGR_GEOMETRY_H_INCLUDED
00177 #define _OGR_GEOMETRY_H_INCLUDED
00178 
00179 #include "ogr_core.h"
00180 #include "ogr_spatialref.h"
00181 
00191 class OGRRawPoint
00192 {
00193   public:
00194           OGRRawPoint()
00195           {
00196                   x = y = 0.0;
00197           }
00198     double      x;
00199     double      y;
00200 };
00201 
00202 
00203 /************************************************************************/
00204 /*                             OGRGeometry                              */
00205 /************************************************************************/
00206 
00216 class CPL_DLL OGRGeometry
00217 {
00218   private:
00219     OGRSpatialReference * poSRS;                // may be NULL
00220     
00221   public:
00222                 OGRGeometry();
00223     virtual     ~OGRGeometry();
00224                         
00225     // standard IGeometry
00226     virtual int getDimension() = 0;
00227     virtual int getCoordinateDimension() = 0;
00228     virtual OGRBoolean  IsEmpty() { return 0; } 
00229     virtual OGRBoolean  IsSimple() { return 1; }
00230     virtual void        empty() = 0;
00231     virtual OGRGeometry *clone() = 0;
00232     virtual void getEnvelope( OGREnvelope * psEnvelope ) = 0;
00233 
00234     // IWks Interface
00235     virtual int WkbSize() = 0;
00236     virtual OGRErr importFromWkb( unsigned char *, int=-1 )=0;
00237     virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * ) = 0;
00238     virtual OGRErr importFromWkt( char ** ppszInput ) = 0;
00239     virtual OGRErr exportToWkt( char ** ppszDstText ) = 0;
00240     
00241     // non-standard
00242     virtual OGRwkbGeometryType getGeometryType() = 0;
00243     virtual const char *getGeometryName() = 0;
00244     virtual void   dumpReadable( FILE *, const char * = NULL );
00245     virtual void   flattenTo2D() = 0;
00246     virtual char * exportToGML() const;
00247 
00248     void    assignSpatialReference( OGRSpatialReference * poSR );
00249     OGRSpatialReference *getSpatialReference( void ) { return poSRS; }
00250 
00251     virtual OGRErr  transform( OGRCoordinateTransformation *poCT ) = 0;
00252     OGRErr  transformTo( OGRSpatialReference *poSR );
00253 
00254     // ISpatialRelation
00255     virtual OGRBoolean  Intersect( OGRGeometry * );
00256     virtual OGRBoolean  Equal( OGRGeometry * ) = 0;
00257     
00258 #ifdef notdef
00259     
00260     // I presume all these should be virtual?  How many
00261     // should be pure?
00262     OGRGeometry *getBoundary();
00263 
00264     OGRBoolean  Disjoint( OGRGeometry * );
00265     OGRBoolean  Touch( OGRGeometry * );
00266     OGRBoolean  Cross( OGRGeometry * );
00267     OGRBoolean  Within( OGRGeometry * );
00268     OGRBoolean  Contains( OGRGeometry * );
00269     OGRBoolean  Overlap( OGRGeometry * );
00270     OGRBoolean  Relate( OGRGeometry *, const char * );
00271 
00272     double      Distance( OGRGeometry * );
00273     OGRGeometry *Intersection(OGRGeometry *);
00274     OGRGeometry *Buffer( double );
00275     OGRGeometry *ConvexHull();
00276     OGRGeometry *Union( OGRGeometry * );
00277     OGRGeometry *Difference( OGRGeometry * );
00278     OGRGeometry *SymmetricDifference( OGRGeometry * );
00279 #endif    
00280 
00281     // Special HACK for DB2 7.2 support
00282     static int bGenerate_DB2_V72_BYTE_ORDER;
00283 };
00284 
00285 /************************************************************************/
00286 /*                               OGRPoint                               */
00287 /************************************************************************/
00288 
00295 class CPL_DLL OGRPoint : public OGRGeometry
00296 {
00297     double      x;
00298     double      y;
00299     double      z;
00300 
00301   public:
00302                 OGRPoint();
00303                 OGRPoint( double x, double y, double z = 0.0 );
00304     virtual     ~OGRPoint();
00305 
00306     // IWks Interface
00307     virtual int WkbSize();
00308     virtual OGRErr importFromWkb( unsigned char *, int=-1 );
00309     virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * );
00310     virtual OGRErr importFromWkt( char ** );
00311     virtual OGRErr exportToWkt( char ** ppszDstText );
00312     
00313     // IGeometry
00314     virtual int getDimension();
00315     virtual int getCoordinateDimension();
00316     virtual OGRGeometry *clone();
00317     virtual void empty();
00318     virtual void getEnvelope( OGREnvelope * psEnvelope );
00319 
00320     // IPoint
00321     double      getX() { return x; }
00322     double      getY() { return y; }
00323     double      getZ() { return z; }
00324 
00325     // Non standard
00326     void        setX( double xIn ) { x = xIn; }
00327     void        setY( double yIn ) { y = yIn; }
00328     void        setZ( double zIn ) { z = zIn; }
00329 
00330     // ISpatialRelation
00331     virtual OGRBoolean  Equal( OGRGeometry * );
00332     
00333     // Non standard from OGRGeometry
00334     virtual const char *getGeometryName();
00335     virtual OGRwkbGeometryType getGeometryType();
00336     virtual OGRErr  transform( OGRCoordinateTransformation *poCT );
00337     virtual void flattenTo2D();
00338 
00339 };
00340 
00341 /************************************************************************/
00342 /*                               OGRCurve                               */
00343 /************************************************************************/
00344 
00349 class CPL_DLL OGRCurve : public OGRGeometry
00350 {
00351   public:
00352             OGRCurve();
00353     virtual ~OGRCurve();
00354     // ICurve methods
00355     virtual double get_Length() = 0;
00356     virtual void StartPoint(OGRPoint *) = 0;
00357     virtual void EndPoint(OGRPoint *) = 0;
00358     virtual int  get_IsClosed();
00359     virtual void Value( double, OGRPoint * ) = 0;
00360 
00361 };
00362 
00363 /************************************************************************/
00364 /*                            OGRLineString                             */
00365 /************************************************************************/
00366 
00371 class CPL_DLL OGRLineString : public OGRCurve
00372 {
00373   protected:
00374     int         nPointCount;
00375     OGRRawPoint *paoPoints;
00376     double      *padfZ;
00377 
00378     void        Make3D();
00379     void        Make2D();
00380 
00381   public:
00382                 OGRLineString();
00383     virtual     ~OGRLineString();
00384 
00385     // IWks Interface
00386     virtual int WkbSize();
00387     virtual OGRErr importFromWkb( unsigned char *, int = -1 );
00388     virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * );
00389     virtual OGRErr importFromWkt( char ** );
00390     virtual OGRErr exportToWkt( char ** ppszDstText );
00391 
00392     // IGeometry interface
00393     virtual int getDimension();
00394     virtual int getCoordinateDimension();
00395     virtual OGRGeometry *clone();
00396     virtual void empty();
00397     virtual void getEnvelope( OGREnvelope * psEnvelope );
00398 
00399     // ICurve methods
00400     virtual double get_Length();
00401     virtual void StartPoint(OGRPoint *);
00402     virtual void EndPoint(OGRPoint *);
00403     virtual void Value( double, OGRPoint * );
00404     
00405     // ILineString methods
00406     int         getNumPoints() { return nPointCount; }
00407     void        getPoint( int, OGRPoint * );
00408     double      getX( int i ) { return paoPoints[i].x; }
00409     double      getY( int i ) { return paoPoints[i].y; }
00410     double      getZ( int i );
00411 
00412     // ISpatialRelation
00413     virtual OGRBoolean  Equal( OGRGeometry * );
00414     
00415     // non standard.
00416     void        setNumPoints( int );
00417     void        setPoint( int, OGRPoint * );
00418     void        setPoint( int, double, double, double = 0.0 );
00419     void        setPoints( int, OGRRawPoint *, double * = NULL );
00420     void        setPoints( int, double * padfX, double * padfY,
00421                            double *padfZ = NULL );
00422     void        addPoint( OGRPoint * );
00423     void        addPoint( double, double, double = 0.0 );
00424 
00425     // non-standard from OGRGeometry
00426     virtual OGRwkbGeometryType getGeometryType();
00427     virtual const char *getGeometryName();
00428     virtual OGRErr  transform( OGRCoordinateTransformation *poCT );
00429     virtual void flattenTo2D();
00430 
00431 };
00432 
00433 /************************************************************************/
00434 /*                            OGRLinearRing                             */
00435 /*                                                                      */
00436 /*      This is an alias for OGRLineString for now.                     */
00437 /************************************************************************/
00438 
00447 class CPL_DLL OGRLinearRing : public OGRLineString
00448 {
00449   private:
00450     friend class OGRPolygon; 
00451     
00452     // These are not IWks compatible ... just a convenience for OGRPolygon.
00453     virtual int _WkbSize( int b3D );
00454     virtual OGRErr _importFromWkb( OGRwkbByteOrder, int b3D,
00455                                    unsigned char *, int=-1 );
00456     virtual OGRErr _exportToWkb( OGRwkbByteOrder, int b3D, unsigned char * );
00457     
00458   public:
00459                         OGRLinearRing();
00460                         OGRLinearRing( OGRLinearRing * );
00461                         ~OGRLinearRing();
00462 
00463     // Non standard.
00464     virtual const char *getGeometryName();
00465     virtual OGRGeometry *clone();
00466     virtual int isClockwise();
00467     
00468     // IWks Interface - Note this isnt really a first class object
00469     // for the purposes of WKB form.  These methods always fail since this
00470     // object cant be serialized on its own. 
00471     virtual int WkbSize();
00472     virtual OGRErr importFromWkb( unsigned char *, int=-1 );
00473     virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * );
00474 };
00475 
00476 /************************************************************************/
00477 /*                              OGRSurface                              */
00478 /************************************************************************/
00479 
00484 class CPL_DLL OGRSurface : public OGRGeometry
00485 {
00486   public:
00487     virtual double      get_Area() = 0;
00488     virtual OGRErr      Centroid( OGRPoint * poPoint ) = 0;
00489     virtual OGRErr      PointOnSurface( OGRPoint * poPoint ) = 0;
00490 };
00491 
00492 /************************************************************************/
00493 /*                              OGRPolygon                              */
00494 /************************************************************************/
00495 
00505 class CPL_DLL OGRPolygon : public OGRSurface
00506 {
00507     int         nRingCount;
00508     OGRLinearRing **papoRings;
00509     
00510   public:
00511                 OGRPolygon();
00512     virtual     ~OGRPolygon();
00513 
00514     // Non standard (OGRGeometry).
00515     virtual const char *getGeometryName();
00516     virtual OGRwkbGeometryType getGeometryType();
00517     virtual OGRGeometry *clone();
00518     virtual void empty();
00519     virtual OGRErr  transform( OGRCoordinateTransformation *poCT );
00520     virtual void flattenTo2D();
00521     
00522     // ISurface Interface
00523     virtual double      get_Area();
00524     virtual int         Centroid( OGRPoint * poPoint );
00525     virtual int         PointOnSurface( OGRPoint * poPoint );
00526     
00527     // IWks Interface
00528     virtual int WkbSize();
00529     virtual OGRErr importFromWkb( unsigned char *, int = -1 );
00530     virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * );
00531     virtual OGRErr importFromWkt( char ** );
00532     virtual OGRErr exportToWkt( char ** ppszDstText );
00533 
00534     // IGeometry
00535     virtual int getDimension();
00536     virtual int getCoordinateDimension();
00537     virtual void getEnvelope( OGREnvelope * psEnvelope );
00538 
00539     // ISpatialRelation
00540     virtual OGRBoolean  Equal( OGRGeometry * );
00541     
00542     // Non standard
00543     void        addRing( OGRLinearRing * );
00544     void        addRingDirectly( OGRLinearRing * );
00545 
00546     OGRLinearRing *getExteriorRing();
00547     int         getNumInteriorRings();
00548     OGRLinearRing *getInteriorRing( int );
00549         
00550 
00551 };
00552 
00553 /************************************************************************/
00554 /*                        OGRGeometryCollection                         */
00555 /************************************************************************/
00556 
00564 class CPL_DLL OGRGeometryCollection : public OGRGeometry
00565 {
00566     int         nGeomCount;
00567     OGRGeometry **papoGeoms;
00568 
00569     int         nCoordinateDimension;
00570     
00571   public:
00572                 OGRGeometryCollection();
00573     virtual     ~OGRGeometryCollection();
00574 
00575     // Non standard (OGRGeometry).
00576     virtual const char *getGeometryName();
00577     virtual OGRwkbGeometryType getGeometryType();
00578     virtual OGRGeometry *clone();
00579     virtual void empty();
00580     virtual OGRErr  transform( OGRCoordinateTransformation *poCT );
00581     virtual void flattenTo2D();
00582     
00583     // IWks Interface
00584     virtual int WkbSize();
00585     virtual OGRErr importFromWkb( unsigned char *, int = -1 );
00586     virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * );
00587     virtual OGRErr importFromWkt( char ** );
00588     virtual OGRErr exportToWkt( char ** ppszDstText );
00589 
00590     // IGeometry methods
00591     virtual int getDimension();
00592     virtual int getCoordinateDimension();
00593     virtual void getEnvelope( OGREnvelope * psEnvelope );
00594 
00595     // IGeometryCollection
00596     int         getNumGeometries();
00597     OGRGeometry *getGeometryRef( int );
00598 
00599     // ISpatialRelation
00600     virtual OGRBoolean  Equal( OGRGeometry * );
00601     
00602     // Non standard
00603     virtual OGRErr addGeometry( OGRGeometry * );
00604     virtual OGRErr addGeometryDirectly( OGRGeometry * );
00605     virtual OGRErr removeGeometry( int iIndex, int bDelete = TRUE );
00606 };
00607 
00608 /************************************************************************/
00609 /*                           OGRMultiPolygon                            */
00610 /************************************************************************/
00611 
00619 class CPL_DLL OGRMultiPolygon : public OGRGeometryCollection
00620 {
00621   public:
00622             OGRMultiPolygon();
00623     // Non standard (OGRGeometry).
00624     virtual const char *getGeometryName();
00625     virtual OGRwkbGeometryType getGeometryType();
00626     virtual OGRGeometry *clone();
00627     virtual OGRErr importFromWkt( char ** );
00628     virtual OGRErr exportToWkt( char ** );
00629     
00630     // Non standard
00631     virtual OGRErr addGeometryDirectly( OGRGeometry * );
00632 };
00633 
00634 /************************************************************************/
00635 /*                            OGRMultiPoint                             */
00636 /************************************************************************/
00637 
00642 class CPL_DLL OGRMultiPoint : public OGRGeometryCollection
00643 {
00644   private:
00645     OGRErr  importFromWkt_Bracketed( char ** );
00646 
00647   public:
00648             OGRMultiPoint();
00649     // Non standard (OGRGeometry).
00650     virtual const char *getGeometryName();
00651     virtual OGRwkbGeometryType getGeometryType();
00652     virtual OGRGeometry *clone();
00653     virtual OGRErr importFromWkt( char ** );
00654     virtual OGRErr exportToWkt( char ** );
00655     
00656     // Non standard
00657     virtual OGRErr addGeometryDirectly( OGRGeometry * );
00658 };
00659 
00660 /************************************************************************/
00661 /*                          OGRMultiLineString                          */
00662 /************************************************************************/
00663 
00668 class CPL_DLL OGRMultiLineString : public OGRGeometryCollection
00669 {
00670   public:
00671             OGRMultiLineString();
00672             ~OGRMultiLineString();
00673     // Non standard (OGRGeometry).
00674     virtual const char *getGeometryName();
00675     virtual OGRwkbGeometryType getGeometryType();
00676     virtual OGRGeometry *clone();
00677     virtual OGRErr importFromWkt( char ** );
00678     virtual OGRErr exportToWkt( char ** );
00679     
00680     // Non standard
00681     virtual OGRErr addGeometryDirectly( OGRGeometry * );
00682 };
00683 
00684 
00685 /************************************************************************/
00686 /*                          OGRGeometryFactory                          */
00687 /************************************************************************/
00688 
00693 class CPL_DLL OGRGeometryFactory
00694 {
00695   public:
00696     static OGRErr createFromWkb( unsigned char *, OGRSpatialReference *,
00697                                  OGRGeometry **, int = -1 );
00698     static OGRErr createFromWkt( char **, OGRSpatialReference *,
00699                                  OGRGeometry ** );
00700     static OGRGeometry *createFromGML( const char * );
00701 
00702     static void   destroyGeometry( OGRGeometry * );
00703     static OGRGeometry *createGeometry( OGRwkbGeometryType );
00704 
00705     static OGRGeometry * forceToPolygon( OGRGeometry * );
00706     static OGRGeometry * forceToMultiPolygon( OGRGeometry * );
00707     static OGRGeometry * forceToMultiPoint( OGRGeometry * );
00708     static OGRGeometry * forceToMultiLineString( OGRGeometry * );
00709 };
00710 
00711 #endif /* ndef _OGR_GEOMETRY_H_INCLUDED */

Generated on Thu Nov 13 00:06:20 2003 for OGR by doxygen 1.3.4