Skip to content

Commit

Permalink
Eliminate GEOS 3.0 deprecated header warnings by including individual…
Browse files Browse the repository at this point in the history
… headers instead of deprecated multifile headers.

git-svn-id: http://svn.osgeo.org/qgis/trunk@8098 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski committed Jan 31, 2008
1 parent 0eca462 commit 9b7ec28
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 38 deletions.
33 changes: 33 additions & 0 deletions src/core/qgsgeometry.cpp
Expand Up @@ -23,6 +23,39 @@ email : morb at ozemail dot com dot au
#include "qgspoint.h"
#include "qgsrect.h"

#if GEOS_VERSION_MAJOR < 3
#include <geos/io.h>
#include <geos/opLinemerge.h>
#include <geos/opPolygonize.h>
#include <geos/util.h>
#define GEOS_IO geos
#define GEOS_LINEMERGE geos
#define GEOS_POLYGONIZE geos
#define GEOS_UTIL geos
#define GEOS_SIZE_T int
#define COORD_SEQ_FACTORY DefaultCoordinateSequenceFactory
#else
#include <geos/geom/CoordinateArraySequence.h>
#include <geos/geom/CoordinateArraySequenceFactory.h>
#include <geos/geom/LineString.h>
#include <geos/geom/LinearRing.h>
#include <geos/geom/MultiLineString.h>
#include <geos/geom/MultiPoint.h>
#include <geos/geom/MultiPolygon.h>
#include <geos/geom/Point.h>
#include <geos/geom/Polygon.h>
#include <geos/io/WKTReader.h>
#include <geos/operation/linemerge/LineMerger.h>
#include <geos/operation/polygonize/Polygonizer.h>
#include <geos/util/IllegalArgumentException.h>
#define GEOS_IO geos::io
#define GEOS_LINEMERGE geos::operation::linemerge
#define GEOS_POLYGONIZE geos::operation::polygonize
#define GEOS_UTIL geos::util
#define GEOS_SIZE_T size_t
#define COORD_SEQ_FACTORY CoordinateArraySequenceFactory
#endif

// Set up static GEOS geometry factory
static GEOS_GEOM::GeometryFactory* geosGeometryFactory = new GEOS_GEOM::GeometryFactory();

Expand Down
34 changes: 5 additions & 29 deletions src/core/qgsgeometry.h
Expand Up @@ -17,46 +17,24 @@ email : morb at ozemail dot com dot au
#ifndef QGSGEOMETRY_H
#define QGSGEOMETRY_H

#include <QMultiMap>
#include <QString>
#include <QVector>

#include "qgis.h"

#include <geos.h>
#include <geos/version.h>
#if GEOS_VERSION_MAJOR < 3
#include <geos/geom.h>
#define GEOS_GEOM geos
#define GEOS_IO geos
#define GEOS_LINEMERGE geos
#define GEOS_POLYGONIZE geos
#define GEOS_UTIL geos
#define GEOS_SIZE_T int
#define COORD_SEQ_FACTORY DefaultCoordinateSequenceFactory
#include "geos/opPolygonize.h"
#include "geos/opLinemerge.h"
#else
#include <geos/geom/CoordinateSequence.h>
#include <geos/geom/Geometry.h>
#include <geos/geom/LineString.h>
#define GEOS_GEOM geos::geom
#define GEOS_IO geos::io
#define GEOS_LINEMERGE geos::operation::linemerge
#define GEOS_POLYGONIZE geos::operation::polygonize
#define GEOS_UTIL geos::util
#define GEOS_SIZE_T size_t
#define COORD_SEQ_FACTORY CoordinateArraySequenceFactory
#include "geos/operation/polygonize/Polygonizer.h"
#include "geos/operation/linemerge/LineMerger.h"
#endif

#include "qgspoint.h"

namespace geos
{
class CoordinateSequence;
class Geometry;
class GeometryFactory;
class Polygon;
}


/** polyline is represented as a vector of points */
typedef QVector<QgsPoint> QgsPolyline;

Expand All @@ -72,8 +50,6 @@ typedef QVector<QgsPolyline> QgsMultiPolyline;
/** a collection of QgsPolygons that share a common collection of attributes */
typedef QVector<QgsPolygon> QgsMultiPolygon;

class QgsGeometryVertexIndex;
class QgsPoint;
class QgsRect;

/**
Expand Down
8 changes: 3 additions & 5 deletions src/providers/ogr/qgsogrprovider.h
Expand Up @@ -19,15 +19,13 @@ email : sherman at mrcc.com
#include "qgsrect.h"
#include "qgsvectordataprovider.h"

#include <geos.h>
#include <geos/version.h>
#if GEOS_VERSION_MAJOR < 3
#include <geos/geom.h>
#define GEOS_GEOM geos
#define GEOS_IO geos
#define GEOS_UTIL geos
#else
#include <geos/geom/GeometryFactory.h>
#define GEOS_GEOM geos::geom
#define GEOS_IO geos::io
#define GEOS_UTIL geos::util
#endif

class QgsFeature;
Expand Down
11 changes: 7 additions & 4 deletions src/providers/wfs/qgswfsprovider.h
Expand Up @@ -23,14 +23,17 @@
#include "qgsrect.h"
#include "qgsspatialrefsys.h"
#include "qgsvectordataprovider.h"
#include <geos.h>
#include <indexStrtree.h>
#include <geos/version.h>
#if GEOS_VERSION_MAJOR < 3
#define GEOS_INDEX_STRTREE geos
#include <geos/geom.h>
#include <geos/indexStrtree.h>
#define GEOS_GEOM geos
#define GEOS_INDEX_STRTREE geos
#else
#define GEOS_INDEX_STRTREE geos::index::strtree
#include <geos/geom/Envelope.h>
#include <geos/index/strtree/STRtree.h>
#define GEOS_GEOM geos::geom
#define GEOS_INDEX_STRTREE geos::index::strtree
#endif

class QgsRect;
Expand Down

0 comments on commit 9b7ec28

Please sign in to comment.