Ticket #523 (new defect/bug)
Maptool's osm.c and Navit's binfile.c treat "districts" inconsistently, breaking search
| Reported by: | troy_rollo | Owned by: | Cp15 |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | mapdrivers/OSM | Version: | svn |
| Keywords: | Cc: |
Description
osm.c puts "district" data in the attr_town_* attributes. binfile.c expects to find it in attr_district_* attributes. As a result, the search dialog does not find suburbs, even if they have appropriate is_in tags.
In osm.c:
if (item_is_town(*item_bin) && attr_strings[attr_string_label]) {
...
if (result->file) {
item_bin_init(item_bin, item_bin->type); item_bin_add_coord(item_bin, &ni->c, 1); item_bin_add_attr_string(item_bin, attr_town_postal, postal); item_bin_add_attr_string(item_bin, attr_town_name, attr_strings[attr_string_label]); item_bin_write_match(item_bin, attr_town_name, attr_town_name_match, result->file);
}
...
In binfile.c:
if (item_is_town(*it) && !item_is_district(*it) && map_search->search->type != attr_district_name) {
if (binfile_attr_get(it->priv_data, attr_town_name_match, &at) binfile_attr_get(it->priv_data, attr_town_name, &at)) { if (!ascii_cmp(at.u.str, map_search->search->u.str, map_search->partial) && !duplicate(map_search, it, attr_town_name))
return it;
}
} if (item_is_district(*it) && map_search->search->type != attr_town_name) {
if (binfile_attr_get(it->priv_data, attr_district_name_match, &at) binfile_attr_get(it->priv_data, attr_district_name, &at)) { if (!ascii_cmp(at.u.str, map_search->search->u.str, map_search->partial) && !duplicate(map_search, it, attr_district_name))
return it;
}
}
Attachments
Change History
Changed 2 years ago by https://www.google.com/accounts/o8/id?id=aitoawlcfzrwh8br1pgoscgz76hhgg9m1ltch5m
-
attachment
osm-diffs
added
comment:1 Changed 2 years ago by https://www.google.com/accounts/o8/id?id=aitoawlcfzrwh8br1pgoscgz76hhgg9m1ltch5m
The patch includes a fix for this problem and other problems affecting searching in Australia. Using the Cloudmade extract for Australia, the following command gives a reasonable (but by no means perfect) result:
bzcat australia.osm.bz2 | maptool -z 9 --country=Australia australia.bin
In Australia there are also polygons available for towns and suburbs, which I have not dealt with.

Patch that includes a fix for this problem