From c4edd2bd5984a4e528b8522688aeaf400fe3ea9d Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 20 Nov 2011 14:43:22 -0800 Subject: [PATCH] backport postgis 2.x fix to mapnik 2.0.x series branch - refs #956 --- plugins/input/postgis/postgis_datasource.cpp | 18 ++---------------- plugins/input/postgis/postgis_datasource.hpp | 2 -- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/plugins/input/postgis/postgis_datasource.cpp b/plugins/input/postgis/postgis_datasource.cpp index b02dc9c17..21952af53 100644 --- a/plugins/input/postgis/postgis_datasource.cpp +++ b/plugins/input/postgis/postgis_datasource.cpp @@ -83,8 +83,6 @@ postgis_datasource::postgis_datasource(parameters const& params, bool bind) persist_connection_(*params_.get("persist_connection",true)), extent_from_subquery_(*params_.get("extent_from_subquery",false)), // params below are for testing purposes only (will likely be removed at any time) - force2d_(*params_.get("force_2d",false)), - st_(*params_.get("st_prefix",false)), intersect_min_scale_(*params_.get("intersect_min_scale",0)), intersect_max_scale_(*params_.get("intersect_max_scale",0)) //show_queries_(*params_.get("show_queries",false)) @@ -495,13 +493,7 @@ featureset_ptr postgis_datasource::features(const query& q) const } std::ostringstream s; - s << "SELECT "; - if (st_) - s << "ST_"; - if (force2d_) - s << "AsBinary(ST_Force_2D(\"" << geometryColumn_ << "\")) AS geom"; - else - s << "AsBinary(\"" << geometryColumn_ << "\") AS geom"; + s << "SELECT ST_AsBinary(\"" << geometryColumn_ << "\") AS geom"; if (!key_field_.empty()) mapnik::quote_attr(s,key_field_); @@ -571,13 +563,7 @@ featureset_ptr postgis_datasource::features_at_point(coord2d const& pt) const } - s << "SELECT "; - if (st_) - s << "ST_"; - if (force2d_) - s << "AsBinary(ST_Force_2D(\"" << geometryColumn_ << "\")) AS geom"; - else - s << "AsBinary(\"" << geometryColumn_ << "\") AS geom"; + s << "SELECT AsBinary(\"" << geometryColumn_ << "\") AS geom"; if (!key_field_.empty()) mapnik::quote_attr(s,key_field_); diff --git a/plugins/input/postgis/postgis_datasource.hpp b/plugins/input/postgis/postgis_datasource.hpp index eade5781f..229cf3a36 100644 --- a/plugins/input/postgis/postgis_datasource.hpp +++ b/plugins/input/postgis/postgis_datasource.hpp @@ -75,8 +75,6 @@ class postgis_datasource : public datasource bool persist_connection_; bool extent_from_subquery_; // params below are for testing purposes only (will likely be removed at any time) - bool force2d_; - bool st_; int intersect_min_scale_; int intersect_max_scale_; //bool show_queries_;