diff --git a/plugins/input/shape/shape_datasource.cpp b/plugins/input/shape/shape_datasource.cpp index 6a0c4b507..891584c47 100644 --- a/plugins/input/shape/shape_datasource.cpp +++ b/plugins/input/shape/shape_datasource.cpp @@ -252,7 +252,8 @@ featureset_ptr shape_datasource::features(const query& q) const (new shape_index_featureset(filter, *shape_, q.property_names(), - desc_.get_encoding())); + desc_.get_encoding(), + shape_name_)); } else { @@ -289,7 +290,8 @@ featureset_ptr shape_datasource::features_at_point(coord2d const& pt) const (new shape_index_featureset(filter, *shape_, names, - desc_.get_encoding())); + desc_.get_encoding(), + shape_name_)); } else { diff --git a/plugins/input/shape/shape_featureset.cpp b/plugins/input/shape/shape_featureset.cpp index ebe3c5c58..563ee3a4e 100644 --- a/plugins/input/shape/shape_featureset.cpp +++ b/plugins/input/shape/shape_featureset.cpp @@ -24,6 +24,9 @@ // mapnik #include +// boost +#include + // stl #include @@ -34,13 +37,13 @@ using mapnik::feature_factory; template shape_featureset::shape_featureset(const filterT& filter, - const std::string& shape_file, + const std::string& shape_name, const std::set& attribute_names, std::string const& encoding, long file_length ) : filter_(filter), //shape_type_(shape_io::shape_null), - shape_(shape_file, false), + shape_(shape_name, false), query_ext_(), tr_(new transcoder(encoding)), file_length_(file_length), @@ -65,12 +68,14 @@ shape_featureset::shape_featureset(const filterT& filter, { std::ostringstream s; - s << "error no attribute by the name of '" << *pos << "'" - << ", available attributes are:"; + s << "no attribute '" << *pos << "' in '" + << shape_name << "'. Valid attributes are: "; + std::vector list; for (int i=0;i // boost +#include #include // stl @@ -41,7 +42,8 @@ template shape_index_featureset::shape_index_featureset(const filterT& filter, shape_io& shape, const std::set& attribute_names, - std::string const& encoding) + std::string const& encoding, + std::string const& shape_name) : filter_(filter), //shape_type_(0), shape_(shape), @@ -86,12 +88,14 @@ shape_index_featureset::shape_index_featureset(const filterT& filter, { std::ostringstream s; - s << "error no attribute by the name of '" << *pos << "'" - << ", available attributes are:"; + s << "no attribute '" << *pos << "' in '" + << shape_name << "'. Valid attributes are: "; + std::vector list; for (int i=0;i& attribute_names, - std::string const& encoding); + std::string const& encoding, + std::string const& shape_name); virtual ~shape_index_featureset(); feature_ptr next(); private: diff --git a/plugins/input/shape/shape_io.hpp b/plugins/input/shape/shape_io.hpp index 50b64a675..378b21d97 100644 --- a/plugins/input/shape/shape_io.hpp +++ b/plugins/input/shape/shape_io.hpp @@ -80,6 +80,7 @@ public: { return (index_ && index_->is_open()); } + void move_to(int id); int type() const; const box2d& current_extent() const;