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

Generated on Thu Mar 25 08:13:25 2004 for OGR by doxygen 1.3.6-20040222