update to use new feature_impl interface
This commit is contained in:
parent
78a286cad1
commit
b89aee13fd
1 changed files with 8 additions and 13 deletions
|
@ -105,26 +105,22 @@ void metawriter_json_stream::write_properties(Feature const& feature, metawriter
|
||||||
{
|
{
|
||||||
*f_ << "}," << //Close coordinates object
|
*f_ << "}," << //Close coordinates object
|
||||||
"\n \"properties\": {";
|
"\n \"properties\": {";
|
||||||
// FIXME
|
|
||||||
/*
|
|
||||||
std::map<std::string, value> const &fprops = feature.props();
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
BOOST_FOREACH(std::string p, properties)
|
BOOST_FOREACH(std::string const& p, properties)
|
||||||
{
|
{
|
||||||
std::map<std::string, value>::const_iterator itr = fprops.find(p);
|
if (feature.has_key(p))
|
||||||
std::string text;
|
|
||||||
if (itr != fprops.end())
|
|
||||||
{
|
{
|
||||||
// Skip empty props
|
mapnik::value const& val = feature.get(p);
|
||||||
if(itr->second.to_string().size() == 0) continue; // ignore empty
|
std::string str = val.to_string();
|
||||||
|
if (str.size() == 0) continue; // ignore empty attributes
|
||||||
|
|
||||||
//Property found
|
//Property found
|
||||||
text = boost::replace_all_copy(boost::replace_all_copy(itr->second.to_string(), "\\", "\\\\"), "\"", "\\\"");
|
std::string text = boost::replace_all_copy(boost::replace_all_copy(str, "\\", "\\\\"), "\"", "\\\"");
|
||||||
if (i++) *f_ << ",";
|
if (i++) *f_ << ",";
|
||||||
*f_ << "\n \"" << p << "\":\"" << text << "\"";
|
*f_ << "\n \"" << p << "\":\"" << text << "\"";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
*f_ << "\n} }";
|
*f_ << "\n} }";
|
||||||
}
|
}
|
||||||
|
@ -332,8 +328,7 @@ metawriter_json::metawriter_json(metawriter_properties dflt_properties, path_exp
|
||||||
|
|
||||||
void metawriter_json::start(metawriter_property_map const& properties)
|
void metawriter_json::start(metawriter_property_map const& properties)
|
||||||
{
|
{
|
||||||
filename_ =
|
filename_ = path_processor<metawriter_property_map>::evaluate(*fn_, properties);
|
||||||
path_processor<metawriter_property_map>::evaluate(*fn_, properties);
|
|
||||||
#ifdef MAPNIK_DEBUG
|
#ifdef MAPNIK_DEBUG
|
||||||
std::clog << "Metawriter JSON: filename=" << filename_ << "\n";
|
std::clog << "Metawriter JSON: filename=" << filename_ << "\n";
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue