summaryrefslogtreecommitdiff
path: root/navit/maptool/osm.c
diff options
context:
space:
mode:
authorStefan Wildemann <gta04@metalstrolche.de>2019-08-01 00:32:04 +0200
committerStefan Wildemann <gta04@metalstrolche.de>2019-08-01 00:32:04 +0200
commitfa45f14cde72efe75a2c43cccbcb773e8fd3f2cc (patch)
tree02fc1dce710110cc211254891add79b42309b92e /navit/maptool/osm.c
parent8061e9b1e4a82368d8acf626179f9e657fea4664 (diff)
downloadnavit-fa45f14cde72efe75a2c43cccbcb773e8fd3f2cc.tar.gz
Move multipolygons to own tempfile, simplify filtering
Note: the simpler filtering results in bigger disk space required. But we cannot filter unknown streets early anymore, as they may be required for polygon processing
Diffstat (limited to 'navit/maptool/osm.c')
-rw-r--r--navit/maptool/osm.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/navit/maptool/osm.c b/navit/maptool/osm.c
index 6eab6a903..fa5bde9b1 100644
--- a/navit/maptool/osm.c
+++ b/navit/maptool/osm.c
@@ -1615,27 +1615,28 @@ void osm_end_relation(struct maptool_osm *osm) {
in_relation=0;
- if(attr_longest_match(attr_mapping_rel2poly_place, attr_mapping_rel2poly_place_count, &type, 1)) {
- tmp_item_bin->type=type;
+ fprintf(stderr,"relation_type=%s\n", relation_type);
+ if((!g_strcmp0(relation_type, "multipolygon")) && (!boundary)) {
+ if(attr_longest_match(attr_mapping_way, attr_mapping_way_count, &type, 1)) {
+ tmp_item_bin->type = type;
+ } else {
+ type=type_none;
+ tmp_item_bin->type=type;
+ }
} else {
- type=type_none;
- tmp_item_bin->type=type;
+ if(attr_longest_match(attr_mapping_rel2poly_place, attr_mapping_rel2poly_place_count, &type, 1)) {
+ tmp_item_bin->type=type;
+ } else {
+ type=type_none;
+ tmp_item_bin->type=type;
+ }
}
- fprintf(stderr,"relation_type=%s\n", relation_type);
if ((!g_strcmp0(relation_type, "multipolygon")) && (!boundary)) {
item_bin_add_attr_string(tmp_item_bin, attr_label, attr_strings[attr_string_label]);
item_bin_write(tmp_item_bin, osm->multipolygons);
}
- /*TODO: check if this was a bug: Previously attr_longest_match always failed, because
- * item_is_poly_place never matched causing attr_mapping_rel2poly_place to be empty.
- * Since I don't know what happenes if type suddenly is != type_none, I force the
- * old behaviour here */
- type=type_none;
- tmp_item_bin->type=type;
-
-
if ((!g_strcmp0(relation_type, "multipolygon") || !g_strcmp0(relation_type, "boundary"))
&& (boundary || type!=type_none)) {
item_bin_write(tmp_item_bin, osm->boundaries);
@@ -1758,8 +1759,6 @@ void osm_end_way(struct maptool_osm *osm) {
add_flags=0;
if (types[i] == type_none)
continue;
- if (ignore_unknown && (types[i] == type_street_unkn || types[i] == type_point_unkn))
- continue;
if (types[i] != type_street_unkn) {
if(types[i]<type_area)
count_lines++;
@@ -1849,8 +1848,6 @@ void osm_end_node(struct maptool_osm *osm) {
for (i = 0 ; i < count ; i++) {
if (types[i] == type_none)
continue;
- if (ignore_unknown && (types[i] == type_street_unkn || types[i] == type_point_unkn))
- continue;
item_bin=init_item(types[i]);
if (item_is_town(*item_bin) && attr_strings[attr_string_population])
item_bin_set_type_by_population(item_bin, atoi(attr_strings[attr_string_population]));