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

Generated on Tue Mar 15 07:12:56 2005 for OGR by  doxygen 1.4.0