Ticket #523 (new defect/bug)

Opened 2 years ago

Last modified 15 months ago

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

osm-diffs Download (7.5 KB) - added by https://www.google.com/accounts/o8/id?id=aitoawlcfzrwh8br1pgoscgz76hhgg9m1ltch5m 2 years ago.
Patch that includes a fix for this problem

Change History

Changed 2 years ago by https://www.google.com/accounts/o8/id?id=aitoawlcfzrwh8br1pgoscgz76hhgg9m1ltch5m

Patch that includes a fix for this problem

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.

comment:2 Changed 15 months ago by https://wiki.navit-project.org/index.php/user:korrosa

Is this still an issue?

comment:3 Changed 15 months ago by https://wiki.navit-project.org/index.php/user:troy_rollo

I am not in a position to test this at the moment, but checking the source code suggests the problem is still there as I see no relevant change to either file.

Note: See TracTickets for help on using tickets.