diff --git a/plugins/input/osm/osm.cpp b/plugins/input/osm/osm.cpp index 52661da3b..0525024ff 100644 --- a/plugins/input/osm/osm.cpp +++ b/plugins/input/osm/osm.cpp @@ -251,6 +251,11 @@ bounds osm_way::get_bounds() bool osm_way::is_polygon() { + if (keyvals.find("building") != keyvals.end()) + { + return true; + } + for (unsigned int count = 0; count < ptypes.ptypes.size(); ++count) { if (keyvals.find(ptypes.ptypes[count].first) != keyvals.end() && diff --git a/plugins/input/osm/osm.h b/plugins/input/osm/osm.h index 9cdd0ad20..8efd99d27 100644 --- a/plugins/input/osm/osm.h +++ b/plugins/input/osm/osm.h @@ -54,8 +54,9 @@ public: ptypes.push_back(std::pair("natural", "heath")); ptypes.push_back(std::pair("natural", "marsh")); ptypes.push_back(std::pair("military", "danger_area")); - ptypes.push_back(std::pair("landuse","forest")); - ptypes.push_back(std::pair("landuse","industrial")); + ptypes.push_back(std::pair("landuse", "forest")); + ptypes.push_back(std::pair("landuse", "industrial")); + ptypes.push_back(std::pair("leisure", "park")); } }; diff --git a/plugins/input/osm/osm_featureset.cpp b/plugins/input/osm/osm_featureset.cpp index e40fd9dea..568384f2d 100644 --- a/plugins/input/osm/osm_featureset.cpp +++ b/plugins/input/osm/osm_featureset.cpp @@ -45,7 +45,6 @@ osm_featureset::osm_featureset(const filterT& filter, : filter_(filter), query_ext_(), tr_(new transcoder(encoding)), - feature_id_(1), dataset_ (dataset), attribute_names_ (attribute_names), ctx_(boost::make_shared()) @@ -62,8 +61,7 @@ feature_ptr osm_featureset::next() if (!cur_item) return feature_ptr(); if (dataset_->current_item_is_node()) { - feature = feature_factory::create(ctx_, feature_id_); - ++feature_id_; + feature = feature_factory::create(ctx_, cur_item->id); double lat = static_cast(cur_item)->lat; double lon = static_cast(cur_item)->lon; geometry_type* point = new geometry_type(mapnik::Point); @@ -83,8 +81,7 @@ feature_ptr osm_featureset::next() } if (!cur_item) return feature_ptr(); - feature = feature_factory::create(ctx_, feature_id_); - ++feature_id_; + feature = feature_factory::create(ctx_, cur_item->id); geometry_type* geom; if (static_cast(cur_item)->is_polygon()) { diff --git a/plugins/input/osm/osm_featureset.hpp b/plugins/input/osm/osm_featureset.hpp index 5e50c0214..bf9510ed9 100644 --- a/plugins/input/osm/osm_featureset.hpp +++ b/plugins/input/osm/osm_featureset.hpp @@ -61,7 +61,6 @@ private: std::vector attr_ids_; mutable box2d feature_ext_; mutable int total_geom_size; - mutable int feature_id_; osm_dataset *dataset_; std::set attribute_names_; mapnik::context_ptr ctx_; diff --git a/plugins/input/osm/osmparser.cpp b/plugins/input/osm/osmparser.cpp index 198bea858..f2b39cf51 100644 --- a/plugins/input/osm/osmparser.cpp +++ b/plugins/input/osm/osmparser.cpp @@ -66,16 +66,6 @@ void osmparser::startElement(xmlTextReaderPtr reader, const xmlChar *name) assert(xid); way->id = atol((char*)xid); cur_item = way; - // Prevent ways with no name being assigned a name of "0" - cur_item->keyvals["name"] = ""; - - // HACK: allows comparison with "" in the XML file. Otherwise it - // doesn't work. Only do for the most crucial tags for Freemap's - // purposes. TODO investigate why this is - cur_item->keyvals["width"] = ""; - cur_item->keyvals["horse"] = ""; - cur_item->keyvals["foot"] = ""; - cur_item->keyvals["bicycle"] = ""; xmlFree(xid); } else if (xmlStrEqual(name,BAD_CAST "nd"))