diff options
author | mdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2013-04-10 20:12:13 +0000 |
---|---|---|
committer | mdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2013-04-10 20:12:13 +0000 |
commit | 1edc0b017540e9ea6e1c07e2c7118902e8bf7ba6 (patch) | |
tree | 5db7fd7c72d0300cfe0e1c4fc2dae44a497ee34c | |
parent | 682be4f94711245763cae7ac1fa43a67261be4a9 (diff) | |
download | navit-1edc0b017540e9ea6e1c07e2c7118902e8bf7ba6.tar.gz |
Fix:core:In the street search, return middle point of the street segment found instead of one of its ends. Fixes #1104.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5431 ffa7fe5e-494d-0410-b361-a75ebd5db220
-rw-r--r-- | navit/search.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/navit/search.c b/navit/search.c index 86ed702e9..1f3145511 100644 --- a/navit/search.c +++ b/navit/search.c @@ -10,10 +10,10 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * * Boston, MA 02110-1301, USA. */ @@ -32,6 +32,7 @@ #include "search.h" #include "country.h" #include "linguistics.h" +#include "geom.h" #if HAVE_API_ANDROID #include "android.h" @@ -612,7 +613,9 @@ search_list_street_new(struct item *item) { struct search_list_street *ret=g_new0(struct search_list_street, 1); struct attr attr; + struct coord p[1024]; struct coord c; + int count; ret->common.item=ret->common.unique=*item; if (item_attr_get(item, attr_street_name, &attr)) @@ -620,7 +623,9 @@ search_list_street_new(struct item *item) else ret->name=NULL; search_list_common_new(item, &ret->common); - if (item_coord_get(item, &c, 1)) { + count=item_coord_get(item, p, sizeof(p)/sizeof(*p)); + if (count) { + geom_line_middle(p,count,&c); ret->common.c=g_new(struct pcoord, 1); ret->common.c->x=c.x; ret->common.c->y=c.y; |