Skip to content
Permalink
Browse files

Eliminate GEOS 3.0 deprecated header warnings by including individual…

… 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 9b7ec28674a3cf1ae8b7decfb1bc980da117100a
Showing with 48 additions and 38 deletions.
  1. +33 −0 src/core/qgsgeometry.cpp
  2. +5 −29 src/core/qgsgeometry.h
  3. +3 −5 src/providers/ogr/qgsogrprovider.h
  4. +7 −4 src/providers/wfs/qgswfsprovider.h
@@ -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();

@@ -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;

@@ -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;

/**
@@ -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;
@@ -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;

0 comments on commit 9b7ec28

Please sign in to comment.