+ lets postgis return geometry in native byte order

(wkb reader can handle both 'NDR' and 'XDR')
This commit is contained in:
Artem Pavlenko 2010-03-08 11:55:24 +00:00
parent c3a0b1a72f
commit bce0dab02a

View file

@ -46,12 +46,6 @@
#include <sstream>
#include <iomanip>
#ifndef MAPNIK_BIG_ENDIAN
#define WKB_ENCODING "NDR"
#else
#define WKB_ENCODING "XDR"
#endif
#define FMAX std::numeric_limits<double>::max()
DATASOURCE_PLUGIN(postgis_datasource)
@ -475,7 +469,7 @@ featureset_ptr postgis_datasource::features(const query& q) const
}
std::ostringstream s;
s << "SELECT AsBinary(\"" << geometryColumn_ << "\",'" << WKB_ENCODING << "') AS geom";
s << "SELECT AsBinary(\"" << geometryColumn_ << "\") AS geom";
std::set<std::string> const& props=q.property_names();
std::set<std::string>::const_iterator pos=props.begin();
std::set<std::string>::const_iterator end=props.end();
@ -521,7 +515,7 @@ featureset_ptr postgis_datasource::features_at_point(coord2d const& pt) const
throw mapnik::datasource_exception(s_error.str());
}
s << "SELECT AsBinary(\"" << geometryColumn_ << "\",'" << WKB_ENCODING << "') AS geom";
s << "SELECT AsBinary(\"" << geometryColumn_ << "\") AS geom";
std::vector<attribute_descriptor>::const_iterator itr = desc_.get_descriptors().begin();
std::vector<attribute_descriptor>::const_iterator end = desc_.get_descriptors().end();