summaryrefslogtreecommitdiff
path: root/navit/map
diff options
context:
space:
mode:
authormdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-04-13 13:11:58 +0000
committermdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-04-13 13:11:58 +0000
commit6c59120cc1f157cab774bdd44f18df389e10cd09 (patch)
tree30b22cc1ae7f80c1e81b8859680601cbce0d23b4 /navit/map
parent29fc40a073e5f00a190d1ae4970f48f726cd980c (diff)
downloadnavit-6c59120cc1f157cab774bdd44f18df389e10cd09.tar.gz
Fix:map_binfile:Fix house number search regression introduced with 5436. Increase default house number search area to make it suitable for small streets.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5437 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/map')
-rw-r--r--navit/map/binfile/binfile.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/navit/map/binfile/binfile.c b/navit/map/binfile/binfile.c
index 6d948e91b..8d27f59a5 100644
--- a/navit/map/binfile/binfile.c
+++ b/navit/map/binfile/binfile.c
@@ -2004,7 +2004,7 @@ binmap_search_street_by_estimate(struct map_priv *map, struct item *town, struct
static struct map_rect_priv *
binmap_search_housenumber_by_estimate(struct map_priv *map, struct coord *c, struct map_selection *sel)
{
- int size = 20;
+ int size = 400;
sel->u.c_rect.lu.x = c->x-size;
sel->u.c_rect.lu.y = c->y+size;
sel->u.c_rect.rl.x = c->x+size;
@@ -2012,7 +2012,6 @@ binmap_search_housenumber_by_estimate(struct map_priv *map, struct coord *c, str
sel->range = item_range_all;
sel->order = 18;
- //sel->next = NULL;
return map_rect_new_binfile(map, sel);
}
@@ -2217,6 +2216,7 @@ binmap_search_get_item(struct map_search_priv *map_search)
for (;;) {
while ((it = map_rect_get_item_binfile(map_search->mr))) {
+ int has_house_number=0;
switch (map_search->search.type) {
case attr_town_name:
case attr_district_name:
@@ -2283,19 +2283,15 @@ binmap_search_get_item(struct map_search_priv *map_search)
}
break;
case attr_house_number:
- if ((it->type == type_house_number)||(it->type == type_house_number_interpolation_even)
- ||(it->type == type_house_number_interpolation_odd)
- ||(it->type == type_house_number_interpolation_all)
- )
+ has_house_number=binfile_attr_get(it->priv_data, attr_house_number, &at);
+ if (has_house_number || (it->type == type_house_number)
+ || (it->type == type_house_number_interpolation_even) || (it->type == type_house_number_interpolation_odd)
+ || (it->type == type_house_number_interpolation_all) )
{
- // is it a housenumber?
- if (binfile_attr_get(it->priv_data, attr_house_number, &at))
+ if (has_house_number)
{
- // match housenumber to our string
if (!case_cmp(at.u.str, map_search->search.u.str, map_search->partial))
{
- //binfile_attr_get(it->priv_data, attr_street_name, &at);
- //dbg(0,"hnnn B1 street_name=%s",at.u.str);
if (!duplicate(map_search, it, attr_house_number))
{
binfile_attr_rewind(it->priv_data);
@@ -2305,6 +2301,7 @@ binmap_search_get_item(struct map_search_priv *map_search)
} else
return it;
} else if(map_search->mode==2 && map_search->parent_name && item_is_street(*it) && binfile_attr_get(it->priv_data, attr_street_name, &at) && !strcmp(at.u.str, map_search->parent_name) ) {
+ /* If matching street segment found, prepare to expand house number search region +100m around each way point */
struct coord c;
while(item_coord_get(it,&c,1)) {
c.x-=100;
@@ -2321,6 +2318,7 @@ binmap_search_get_item(struct map_search_priv *map_search)
}
}
if(map_search->search.type==attr_house_number && map_search->mode==2 && map_search->parent_name) {
+ /* For unindexed house number search, check if street segments extending possible housenumber locations were found */
if(map_search->ms.u.c_rect.lu.x!=map_search->rect_new.lu.x || map_search->ms.u.c_rect.lu.y!=map_search->rect_new.lu.y ||
map_search->ms.u.c_rect.rl.x!=map_search->rect_new.rl.x || map_search->ms.u.c_rect.rl.y!=map_search->rect_new.rl.y) {
map_search->ms.u.c_rect=map_search->rect_new;