Compare commits

...

3 Commits

View File

@ -248,21 +248,20 @@ int dijkstra_search_route_to_geojson(struct dijkstra_search *search,
for (l = route; l != NULL; l = l->next) {
node = (struct dijkstra_node*) l->data;
if (node_last) {
heading = atanf((node->position.y - node_last->position.y) / (node->position.x - node_last->position.x)) / (M_PI * 2) * 360;
heading = atanf((node->position.y - node_last->position.y) / (node->position.x - node_last->position.x)) / (M_PI * 2) * 360;
if (last_heading - heading > 10) {
heading = atan2f((node->position.y - node_last->position.y), (node->position.x - node_last->position.x)) / (M_PI * 2) * 360;
if (last_heading - heading > 25) {
relative_direction_str = "right";
} else if (last_heading - heading < -10) {
} else if (last_heading - heading < -25) {
relative_direction_str = "left";
} else {
relative_direction_str = "straight";
}
if (node_last == search->start)
format_str = "Start here.";
format_str = "Start on %2$s";
else if (search->states[node_last->uid]->cheapest_path->name == search->states[node->uid]->cheapest_path->name)
format_str = "Stay on %2$s by going %1$s.";
format_str = "Stay on %2$s by going %1$s";
else
format_str = "Go %s onto %s.";
format_str = "Go %s onto %s";
if (node_last != search->start)
sdprintf(buf, &offset, ",");