summaryrefslogtreecommitdiff
path: root/navit/map
diff options
context:
space:
mode:
authortegzed <tegzed@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-09-11 18:01:37 +0000
committertegzed <tegzed@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-09-11 18:01:37 +0000
commit5beb5d6cc873b04cb5743451db6f673c34ab1d04 (patch)
tree5474bcc5bc5dd7954b2db18d02addaba003af918 /navit/map
parent1884fadd9dcbcc08325b674223a43db654c3d1fc (diff)
downloadnavit-5beb5d6cc873b04cb5743451db6f673c34ab1d04.tar.gz
fix:map/csv:fix quadtree splitting
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@4777 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/map')
-rw-r--r--navit/map/csv/quadtree.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/navit/map/csv/quadtree.c b/navit/map/csv/quadtree.c
index 3d4911aa3..58096ed3a 100644
--- a/navit/map/csv/quadtree.c
+++ b/navit/map/csv/quadtree.c
@@ -349,8 +349,7 @@ quadtree_add(struct quadtree_node* this_, struct quadtree_item* item) {
int i;
double lon = this_->items[0].longitude, lat = this_->items[0].latitude;
- this_->items[this_->node_num++] = *item;
- if(QUADTREE_NODE_CAPACITY == this_->node_num) {
+ if(QUADTREE_NODE_CAPACITY-1 == this_->node_num) {
//avoid infinite recursion when all elements has the same coordinate
for(i=0;i<this_->node_num;++i) {
if (lon != this_->items[i].longitude || lat != this_->items[i].latitude) {
@@ -361,7 +360,10 @@ quadtree_add(struct quadtree_node* this_, struct quadtree_item* item) {
if (bSame) {
return;
}
+ this_->items[this_->node_num++] = *item;
quadtree_split(this_);
+ } else {
+ this_->items[this_->node_num++] = *item;
}
}
else {