+ applied patch from @lightmare - #1325
This commit is contained in:
parent
572f3d3f49
commit
e6e32fcb39
1 changed files with 7 additions and 9 deletions
|
@ -379,12 +379,15 @@ void render_layer_for_grid(const mapnik::Map& map,
|
||||||
throw std::runtime_error(s.str());
|
throw std::runtime_error(s.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert python list to std::vector
|
// convert python list to std::set
|
||||||
|
std::set<std::string> attributes;
|
||||||
boost::python::ssize_t num_fields = boost::python::len(fields);
|
boost::python::ssize_t num_fields = boost::python::len(fields);
|
||||||
for(boost::python::ssize_t i=0; i<num_fields; i++) {
|
for(boost::python::ssize_t i=0; i<num_fields; i++) {
|
||||||
boost::python::extract<std::string> name(fields[i]);
|
boost::python::extract<std::string> name(fields[i]);
|
||||||
if (name.check()) {
|
if (name.check())
|
||||||
|
{
|
||||||
grid.add_property_name(name());
|
grid.add_property_name(name());
|
||||||
|
attributes.insert(name());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -394,8 +397,6 @@ void render_layer_for_grid(const mapnik::Map& map,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy property names
|
|
||||||
std::set<std::string> attributes = grid.property_names();
|
|
||||||
std::string const& key = grid.get_key();
|
std::string const& key = grid.get_key();
|
||||||
|
|
||||||
// if key is special __id__ keyword
|
// if key is special __id__ keyword
|
||||||
|
@ -405,13 +406,10 @@ void render_layer_for_grid(const mapnik::Map& map,
|
||||||
|
|
||||||
// if __id__ is requested to be dumped out
|
// if __id__ is requested to be dumped out
|
||||||
// remove it so that datasource queries will not break
|
// remove it so that datasource queries will not break
|
||||||
if (attributes.find(key) != attributes.end())
|
attributes.erase(key);
|
||||||
{
|
|
||||||
attributes.erase(key);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// if key is not the special __id__ keyword
|
// if key is not the special __id__ keyword
|
||||||
else if (attributes.find(key) == attributes.end())
|
else
|
||||||
{
|
{
|
||||||
// them make sure the datasource query includes this field
|
// them make sure the datasource query includes this field
|
||||||
attributes.insert(key);
|
attributes.insert(key);
|
||||||
|
|
Loading…
Reference in a new issue