1 : /******************************************************************************
2 : * $Id: ogr_geometry.h 19398 2010-04-13 18:34:32Z rouault $
3 : *
4 : * Project: OpenGIS Simple Features Reference Implementation
5 : * Purpose: Classes for manipulating simple features that is not specific
6 : * to a particular interface technology.
7 : * Author: Frank Warmerdam, warmerdam@pobox.com
8 : *
9 : ******************************************************************************
10 : * Copyright (c) 1999, Frank Warmerdam
11 : *
12 : * Permission is hereby granted, free of charge, to any person obtaining a
13 : * copy of this software and associated documentation files (the "Software"),
14 : * to deal in the Software without restriction, including without limitation
15 : * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 : * and/or sell copies of the Software, and to permit persons to whom the
17 : * Software is furnished to do so, subject to the following conditions:
18 : *
19 : * The above copyright notice and this permission notice shall be included
20 : * in all copies or substantial portions of the Software.
21 : *
22 : * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 : * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 : * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 : * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 : * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27 : * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28 : * DEALINGS IN THE SOFTWARE.
29 : ****************************************************************************/
30 :
31 : #ifndef _OGR_GEOMETRY_H_INCLUDED
32 : #define _OGR_GEOMETRY_H_INCLUDED
33 :
34 : #include "ogr_core.h"
35 : #include "ogr_spatialref.h"
36 :
37 : /**
38 : * \file ogr_geometry.h
39 : *
40 : * Simple feature geometry classes.
41 : */
42 :
43 : /**
44 : * Simple container for a position.
45 : */
46 : class OGRRawPoint
47 : {
48 : public:
49 22 : OGRRawPoint()
50 : {
51 22 : x = y = 0.0;
52 22 : }
53 : double x;
54 : double y;
55 : };
56 :
57 : typedef struct GEOSGeom_t *GEOSGeom;
58 :
59 : /************************************************************************/
60 : /* OGRGeometry */
61 : /************************************************************************/
62 :
63 : class OGRPoint;
64 :
65 : /**
66 : * Abstract base class for all geometry classes.
67 : *
68 : * Note that the family of spatial analysis methods (Equal(), Disjoint(), ...,
69 : * ConvexHull(), Buffer(), ...) are not implemented at ths time. Some other
70 : * required and optional geometry methods have also been omitted at this
71 : * time.
72 : *
73 : * Some spatial analysis methods require that OGR is built on the GEOS library
74 : * to work properly. The precise meaning of methods that describe spatial relationships
75 : * between geometries is described in the SFCOM, or other simple features interface
76 : * specifications, like "OpenGISĀ® Implementation Specification for
77 : * Geographic information - Simple feature access - Part 1: Common architecture"
78 : * (<a href="http://www.opengeospatial.org/standards/sfa">OGC 06-103r3</a>)
79 : *
80 : */
81 :
82 : class CPL_DLL OGRGeometry
83 227 : {
84 : private:
85 : OGRSpatialReference * poSRS; // may be NULL
86 :
87 : protected:
88 : int nCoordDimension;
89 :
90 : public:
91 : OGRGeometry();
92 : virtual ~OGRGeometry();
93 :
94 : // standard IGeometry
95 : virtual int getDimension() const = 0;
96 : virtual int getCoordinateDimension() const;
97 : virtual OGRBoolean IsEmpty() const = 0;
98 : virtual OGRBoolean IsValid() const;
99 : virtual OGRBoolean IsSimple() const;
100 : virtual OGRBoolean IsRing() const;
101 : virtual void empty() = 0;
102 : virtual OGRGeometry *clone() const = 0;
103 : virtual void getEnvelope( OGREnvelope * psEnvelope ) const = 0;
104 :
105 : // IWks Interface
106 : virtual int WkbSize() const = 0;
107 : virtual OGRErr importFromWkb( unsigned char *, int=-1 )=0;
108 : virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * ) const = 0;
109 : virtual OGRErr importFromWkt( char ** ppszInput ) = 0;
110 : virtual OGRErr exportToWkt( char ** ppszDstText ) const = 0;
111 :
112 : // non-standard
113 : virtual OGRwkbGeometryType getGeometryType() const = 0;
114 : virtual const char *getGeometryName() const = 0;
115 : virtual void dumpReadable( FILE *, const char * = NULL, char** papszOptions = NULL ) const;
116 : virtual void flattenTo2D() = 0;
117 : virtual char * exportToGML() const;
118 : virtual char * exportToKML() const;
119 : virtual char * exportToJson() const;
120 : virtual GEOSGeom exportToGEOS() const;
121 : virtual void closeRings();
122 :
123 : virtual void setCoordinateDimension( int nDimension );
124 :
125 : void assignSpatialReference( OGRSpatialReference * poSR );
126 19502 : OGRSpatialReference *getSpatialReference( void ) const { return poSRS; }
127 :
128 : virtual OGRErr transform( OGRCoordinateTransformation *poCT ) = 0;
129 : OGRErr transformTo( OGRSpatialReference *poSR );
130 :
131 : virtual void segmentize(double dfMaxLength);
132 :
133 : // ISpatialRelation
134 : virtual OGRBoolean Intersects( OGRGeometry * ) const;
135 : virtual OGRBoolean Equals( OGRGeometry * ) const = 0;
136 : virtual OGRBoolean Disjoint( const OGRGeometry * ) const;
137 : virtual OGRBoolean Touches( const OGRGeometry * ) const;
138 : virtual OGRBoolean Crosses( const OGRGeometry * ) const;
139 : virtual OGRBoolean Within( const OGRGeometry * ) const;
140 : virtual OGRBoolean Contains( const OGRGeometry * ) const;
141 : virtual OGRBoolean Overlaps( const OGRGeometry * ) const;
142 : // virtual OGRBoolean Relate( const OGRGeometry *, const char * ) const;
143 :
144 : virtual OGRGeometry *getBoundary() const;
145 : virtual double Distance( const OGRGeometry * ) const;
146 : virtual OGRGeometry *ConvexHull() const;
147 : virtual OGRGeometry *Buffer( double dfDist, int nQuadSegs = 30 ) const;
148 : virtual OGRGeometry *Intersection( const OGRGeometry *) const;
149 : virtual OGRGeometry *Union( const OGRGeometry * ) const;
150 : virtual OGRGeometry *Difference( const OGRGeometry * ) const;
151 : virtual OGRGeometry *SymmetricDifference( const OGRGeometry * ) const;
152 : virtual OGRErr Centroid( OGRPoint * poPoint ) const;
153 :
154 : // backward compatibility methods.
155 : OGRBoolean Intersect( OGRGeometry * ) const;
156 : OGRBoolean Equal( OGRGeometry * ) const;
157 :
158 : // Special HACK for DB2 7.2 support
159 : static int bGenerate_DB2_V72_BYTE_ORDER;
160 : };
161 :
162 : /************************************************************************/
163 : /* OGRPoint */
164 : /************************************************************************/
165 :
166 : /**
167 : * Point class.
168 : *
169 : * Implements SFCOM IPoint methods.
170 : */
171 :
172 : class CPL_DLL OGRPoint : public OGRGeometry
173 227 : {
174 : double x;
175 : double y;
176 : double z;
177 :
178 : public:
179 : OGRPoint();
180 : OGRPoint( double x, double y );
181 : OGRPoint( double x, double y, double z );
182 : virtual ~OGRPoint();
183 :
184 : // IWks Interface
185 : virtual int WkbSize() const;
186 : virtual OGRErr importFromWkb( unsigned char *, int=-1 );
187 : virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * ) const;
188 : virtual OGRErr importFromWkt( char ** );
189 : virtual OGRErr exportToWkt( char ** ppszDstText ) const;
190 :
191 : // IGeometry
192 : virtual int getDimension() const;
193 : virtual OGRGeometry *clone() const;
194 : virtual void empty();
195 : virtual void getEnvelope( OGREnvelope * psEnvelope ) const;
196 : virtual OGRBoolean IsEmpty() const;
197 :
198 : // IPoint
199 31090 : double getX() const { return x; }
200 30806 : double getY() const { return y; }
201 29760 : double getZ() const { return z; }
202 :
203 : // Non standard
204 : virtual void setCoordinateDimension( int nDimension );
205 748 : void setX( double xIn ) { x = xIn; if (nCoordDimension == 0) nCoordDimension = 2; }
206 748 : void setY( double yIn ) { y = yIn; if (nCoordDimension == 0) nCoordDimension = 2; }
207 113 : void setZ( double zIn ) { z = zIn; nCoordDimension=3; }
208 :
209 : // ISpatialRelation
210 : virtual OGRBoolean Equals( OGRGeometry * ) const;
211 :
212 : // Non standard from OGRGeometry
213 : virtual const char *getGeometryName() const;
214 : virtual OGRwkbGeometryType getGeometryType() const;
215 : virtual OGRErr transform( OGRCoordinateTransformation *poCT );
216 : virtual void flattenTo2D();
217 : };
218 :
219 : /************************************************************************/
220 : /* OGRCurve */
221 : /************************************************************************/
222 :
223 : /**
224 : * Abstract curve base class.
225 : */
226 :
227 : class CPL_DLL OGRCurve : public OGRGeometry
228 : {
229 : public:
230 : OGRCurve();
231 : virtual ~OGRCurve();
232 : // ICurve methods
233 : virtual double get_Length() const = 0;
234 : virtual void StartPoint(OGRPoint *) const = 0;
235 : virtual void EndPoint(OGRPoint *) const = 0;
236 : virtual int get_IsClosed() const;
237 : virtual void Value( double, OGRPoint * ) const = 0;
238 :
239 : };
240 :
241 : /************************************************************************/
242 : /* OGRLineString */
243 : /************************************************************************/
244 :
245 : /**
246 : * Concrete representation of a multi-vertex line.
247 : */
248 :
249 : class CPL_DLL OGRLineString : public OGRCurve
250 : {
251 : protected:
252 : int nPointCount;
253 : OGRRawPoint *paoPoints;
254 : double *padfZ;
255 :
256 : void Make3D();
257 : void Make2D();
258 :
259 : public:
260 : OGRLineString();
261 : virtual ~OGRLineString();
262 :
263 : // IWks Interface
264 : virtual int WkbSize() const;
265 : virtual OGRErr importFromWkb( unsigned char *, int = -1 );
266 : virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * ) const;
267 : virtual OGRErr importFromWkt( char ** );
268 : virtual OGRErr exportToWkt( char ** ppszDstText ) const;
269 :
270 : // IGeometry interface
271 : virtual int getDimension() const;
272 : virtual OGRGeometry *clone() const;
273 : virtual void empty();
274 : virtual void getEnvelope( OGREnvelope * psEnvelope ) const;
275 : virtual OGRBoolean IsEmpty() const;
276 :
277 : // ICurve methods
278 : virtual double get_Length() const;
279 : virtual void StartPoint(OGRPoint *) const;
280 : virtual void EndPoint(OGRPoint *) const;
281 : virtual void Value( double, OGRPoint * ) const;
282 :
283 : // ILineString methods
284 44921 : int getNumPoints() const { return nPointCount; }
285 : void getPoint( int, OGRPoint * ) const;
286 235950 : double getX( int i ) const { return paoPoints[i].x; }
287 237303 : double getY( int i ) const { return paoPoints[i].y; }
288 : double getZ( int i ) const;
289 :
290 : // ISpatialRelation
291 : virtual OGRBoolean Equals( OGRGeometry * ) const;
292 :
293 : // non standard.
294 : virtual void setCoordinateDimension( int nDimension );
295 : void setNumPoints( int );
296 : void setPoint( int, OGRPoint * );
297 : void setPoint( int, double, double );
298 : void setPoint( int, double, double, double );
299 : void setPoints( int, OGRRawPoint *, double * = NULL );
300 : void setPoints( int, double * padfX, double * padfY,
301 : double *padfZ = NULL );
302 : void addPoint( OGRPoint * );
303 : void addPoint( double, double );
304 : void addPoint( double, double, double );
305 :
306 : void getPoints( OGRRawPoint *, double * = NULL ) const;
307 :
308 : void addSubLineString( const OGRLineString *,
309 : int nStartVertex = 0, int nEndVertex = -1 );
310 :
311 : // non-standard from OGRGeometry
312 : virtual OGRwkbGeometryType getGeometryType() const;
313 : virtual const char *getGeometryName() const;
314 : virtual OGRErr transform( OGRCoordinateTransformation *poCT );
315 : virtual void flattenTo2D();
316 : virtual void segmentize(double dfMaxLength);
317 : };
318 :
319 : /************************************************************************/
320 : /* OGRLinearRing */
321 : /************************************************************************/
322 :
323 : /**
324 : * Concrete representation of a closed ring.
325 : *
326 : * This class is functionally equivelent to an OGRLineString, but has a
327 : * separate identity to maintain alignment with the OpenGIS simple feature
328 : * data model. It exists to serve as a component of an OGRPolygon.
329 : *
330 : * The OGRLinearRing has no corresponding free standing well known binary
331 : * representation, so importFromWkb() and exportToWkb() will not actually
332 : * work. There is a non-standard GDAL WKT representation though.
333 : *
334 : * Because OGRLinearRing is not a "proper" free standing simple features
335 : * object, it cannot be directly used on a feature via SetGeometry(), and
336 : * cannot genearally be used with GEOS for operations like Intersects().
337 : * Instead the polygon should be used, or the OGRLinearRing should be
338 : * converted to an OGRLineString for such operations.
339 : */
340 :
341 : class CPL_DLL OGRLinearRing : public OGRLineString
342 : {
343 : private:
344 : friend class OGRPolygon;
345 :
346 : // These are not IWks compatible ... just a convenience for OGRPolygon.
347 : virtual int _WkbSize( int b3D ) const;
348 : virtual OGRErr _importFromWkb( OGRwkbByteOrder, int b3D,
349 : unsigned char *, int=-1 );
350 : virtual OGRErr _exportToWkb( OGRwkbByteOrder, int b3D,
351 : unsigned char * ) const;
352 :
353 : public:
354 : OGRLinearRing();
355 : OGRLinearRing( OGRLinearRing * );
356 : ~OGRLinearRing();
357 :
358 : // Non standard.
359 : virtual const char *getGeometryName() const;
360 : virtual OGRGeometry *clone() const;
361 : virtual int isClockwise() const;
362 : virtual void reverseWindingOrder();
363 : virtual void closeRings();
364 : virtual double get_Area() const;
365 : OGRBoolean isPointInRing(const OGRPoint* pt, int bTestEnvelope = TRUE) const;
366 : OGRBoolean isPointOnRingBoundary(const OGRPoint* pt, int bTestEnvelope = TRUE) const;
367 :
368 : // IWks Interface - Note this isnt really a first class object
369 : // for the purposes of WKB form. These methods always fail since this
370 : // object cant be serialized on its own.
371 : virtual int WkbSize() const;
372 : virtual OGRErr importFromWkb( unsigned char *, int=-1 );
373 : virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * ) const;
374 : };
375 :
376 : /************************************************************************/
377 : /* OGRSurface */
378 : /************************************************************************/
379 :
380 : /**
381 : * Abstract base class for 2 dimensional objects like polygons.
382 : */
383 :
384 : class CPL_DLL OGRSurface : public OGRGeometry
385 10200 : {
386 : public:
387 : virtual double get_Area() const = 0;
388 : virtual OGRErr PointOnSurface( OGRPoint * poPoint ) const = 0;
389 : };
390 :
391 : /************************************************************************/
392 : /* OGRPolygon */
393 : /************************************************************************/
394 :
395 : /**
396 : * Concrete class representing polygons.
397 : *
398 : * Note that the OpenGIS simple features polygons consist of one outer
399 : * ring, and zero or more inner rings. A polygon cannot represent disconnected
400 : * regions (such as multiple islands in a political body). The
401 : * OGRMultiPolygon must be used for this.
402 : */
403 :
404 : class CPL_DLL OGRPolygon : public OGRSurface
405 0 : {
406 : int nRingCount;
407 : OGRLinearRing **papoRings;
408 :
409 : public:
410 : OGRPolygon();
411 : virtual ~OGRPolygon();
412 :
413 : // Non standard (OGRGeometry).
414 : virtual const char *getGeometryName() const;
415 : virtual OGRwkbGeometryType getGeometryType() const;
416 : virtual OGRGeometry *clone() const;
417 : virtual void empty();
418 : virtual OGRErr transform( OGRCoordinateTransformation *poCT );
419 : virtual void flattenTo2D();
420 : virtual OGRBoolean IsEmpty() const;
421 : virtual void segmentize(double dfMaxLength);
422 :
423 : // ISurface Interface
424 : virtual double get_Area() const;
425 : virtual int PointOnSurface( OGRPoint * poPoint ) const;
426 :
427 : // IWks Interface
428 : virtual int WkbSize() const;
429 : virtual OGRErr importFromWkb( unsigned char *, int = -1 );
430 : virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * ) const;
431 : virtual OGRErr importFromWkt( char ** );
432 : virtual OGRErr exportToWkt( char ** ppszDstText ) const;
433 :
434 : // IGeometry
435 : virtual int getDimension() const;
436 : virtual void getEnvelope( OGREnvelope * psEnvelope ) const;
437 :
438 : // ISpatialRelation
439 : virtual OGRBoolean Equals( OGRGeometry * ) const;
440 :
441 : // Non standard
442 : virtual void setCoordinateDimension( int nDimension );
443 :
444 : void addRing( OGRLinearRing * );
445 : void addRingDirectly( OGRLinearRing * );
446 :
447 : OGRLinearRing *getExteriorRing();
448 : const OGRLinearRing *getExteriorRing() const;
449 : int getNumInteriorRings() const;
450 : OGRLinearRing *getInteriorRing( int );
451 : const OGRLinearRing *getInteriorRing( int ) const;
452 :
453 : OGRBoolean IsPointOnSurface( const OGRPoint * ) const;
454 :
455 : virtual void closeRings();
456 : };
457 :
458 : /************************************************************************/
459 : /* OGRGeometryCollection */
460 : /************************************************************************/
461 :
462 : /**
463 : * A collection of 1 or more geometry objects.
464 : *
465 : * All geometries must share a common spatial reference system, and
466 : * Subclasses may impose additional restrictions on the contents.
467 : */
468 :
469 : class CPL_DLL OGRGeometryCollection : public OGRGeometry
470 : {
471 : int nGeomCount;
472 : OGRGeometry **papoGeoms;
473 :
474 : public:
475 : OGRGeometryCollection();
476 : virtual ~OGRGeometryCollection();
477 :
478 : // Non standard (OGRGeometry).
479 : virtual const char *getGeometryName() const;
480 : virtual OGRwkbGeometryType getGeometryType() const;
481 : virtual OGRGeometry *clone() const;
482 : virtual void empty();
483 : virtual OGRErr transform( OGRCoordinateTransformation *poCT );
484 : virtual void flattenTo2D();
485 : virtual OGRBoolean IsEmpty() const;
486 : virtual void segmentize(double dfMaxLength);
487 :
488 : // IWks Interface
489 : virtual int WkbSize() const;
490 : virtual OGRErr importFromWkb( unsigned char *, int = -1 );
491 : virtual OGRErr exportToWkb( OGRwkbByteOrder, unsigned char * ) const;
492 : virtual OGRErr importFromWkt( char ** );
493 : virtual OGRErr exportToWkt( char ** ppszDstText ) const;
494 :
495 : virtual double get_Area() const;
496 :
497 : // IGeometry methods
498 : virtual int getDimension() const;
499 : virtual void getEnvelope( OGREnvelope * psEnvelope ) const;
500 :
501 : // IGeometryCollection
502 : int getNumGeometries() const;
503 : OGRGeometry *getGeometryRef( int );
504 : const OGRGeometry *getGeometryRef( int ) const;
505 :
506 : // ISpatialRelation
507 : virtual OGRBoolean Equals( OGRGeometry * ) const;
508 :
509 : // Non standard
510 : virtual void setCoordinateDimension( int nDimension );
511 : virtual OGRErr addGeometry( const OGRGeometry * );
512 : virtual OGRErr addGeometryDirectly( OGRGeometry * );
513 : virtual OGRErr removeGeometry( int iIndex, int bDelete = TRUE );
514 :
515 : void closeRings();
516 : };
517 :
518 : /************************************************************************/
519 : /* OGRMultiPolygon */
520 : /************************************************************************/
521 :
522 : /**
523 : * A collection of non-overlapping OGRPolygons.
524 : *
525 : * Note that the IMultiSurface class hasn't been modelled, nor have any
526 : * of it's methods.
527 : */
528 :
529 : class CPL_DLL OGRMultiPolygon : public OGRGeometryCollection
530 384 : {
531 : public:
532 : OGRMultiPolygon();
533 : // Non standard (OGRGeometry).
534 : virtual const char *getGeometryName() const;
535 : virtual OGRwkbGeometryType getGeometryType() const;
536 : virtual OGRGeometry *clone() const;
537 : virtual OGRErr importFromWkt( char ** );
538 : virtual OGRErr exportToWkt( char ** ) const;
539 :
540 : // Non standard
541 : virtual OGRErr addGeometryDirectly( OGRGeometry * );
542 :
543 : virtual double get_Area() const;
544 : };
545 :
546 : /************************************************************************/
547 : /* OGRMultiPoint */
548 : /************************************************************************/
549 :
550 : /**
551 : * A collection of OGRPoints.
552 : */
553 :
554 : class CPL_DLL OGRMultiPoint : public OGRGeometryCollection
555 195 : {
556 : private:
557 : OGRErr importFromWkt_Bracketed( char **, int bHasM, int bHasZ );
558 :
559 : public:
560 : OGRMultiPoint();
561 : // Non standard (OGRGeometry).
562 : virtual const char *getGeometryName() const;
563 : virtual OGRwkbGeometryType getGeometryType() const;
564 : virtual OGRGeometry *clone() const;
565 : virtual OGRErr importFromWkt( char ** );
566 : virtual OGRErr exportToWkt( char ** ) const;
567 :
568 : // Non standard
569 : virtual OGRErr addGeometryDirectly( OGRGeometry * );
570 : };
571 :
572 : /************************************************************************/
573 : /* OGRMultiLineString */
574 : /************************************************************************/
575 :
576 : /**
577 : * A collection of OGRLineStrings.
578 : */
579 :
580 : class CPL_DLL OGRMultiLineString : public OGRGeometryCollection
581 : {
582 : public:
583 : OGRMultiLineString();
584 : ~OGRMultiLineString();
585 : // Non standard (OGRGeometry).
586 : virtual const char *getGeometryName() const;
587 : virtual OGRwkbGeometryType getGeometryType() const;
588 : virtual OGRGeometry *clone() const;
589 : virtual OGRErr importFromWkt( char ** );
590 : virtual OGRErr exportToWkt( char ** ) const;
591 :
592 : // Non standard
593 : virtual OGRErr addGeometryDirectly( OGRGeometry * );
594 : };
595 :
596 :
597 : /************************************************************************/
598 : /* OGRGeometryFactory */
599 : /************************************************************************/
600 :
601 : /**
602 : * Create geometry objects from well known text/binary.
603 : */
604 :
605 : class CPL_DLL OGRGeometryFactory
606 : {
607 : public:
608 : static OGRErr createFromWkb( unsigned char *, OGRSpatialReference *,
609 : OGRGeometry **, int = -1 );
610 : static OGRErr createFromWkt( char **, OGRSpatialReference *,
611 : OGRGeometry ** );
612 : static OGRErr createFromFgf( unsigned char *, OGRSpatialReference *,
613 : OGRGeometry **, int = -1, int * = NULL );
614 : static OGRGeometry *createFromGML( const char * );
615 : static OGRGeometry *createFromGEOS( GEOSGeom );
616 :
617 : static void destroyGeometry( OGRGeometry * );
618 : static OGRGeometry *createGeometry( OGRwkbGeometryType );
619 :
620 : static OGRGeometry * forceToPolygon( OGRGeometry * );
621 : static OGRGeometry * forceToMultiPolygon( OGRGeometry * );
622 : static OGRGeometry * forceToMultiPoint( OGRGeometry * );
623 : static OGRGeometry * forceToMultiLineString( OGRGeometry * );
624 :
625 : static OGRGeometry * organizePolygons( OGRGeometry **papoPolygons,
626 : int nPolygonCount,
627 : int *pbResultValidGeometry,
628 : const char **papszOptions = NULL);
629 :
630 : static void *getGEOSGeometryFactory();
631 :
632 : static int haveGEOS();
633 :
634 : static OGRGeometry* transformWithOptions( const OGRGeometry* poSrcGeom,
635 : OGRCoordinateTransformation *poCT,
636 : char** papszOptions );
637 :
638 : static OGRGeometry*
639 : approximateArcAngles( double dfX, double dfY, double dfZ,
640 : double dfPrimaryRadius, double dfSecondaryAxis,
641 : double dfRotation,
642 : double dfStartAngle, double dfEndAngle,
643 : double dfMaxAngleStepSizeDegrees );
644 : };
645 :
646 : #endif /* ndef _OGR_GEOMETRY_H_INCLUDED */
|