Compare commits
No commits in common. "fff25e0a24a1e244f35c6ab9274f6d8a78fbba46" and "d219007e71b62230484d0fb85d0107256ab4d672" have entirely different histories.
fff25e0a24
...
d219007e71
@ -248,20 +248,21 @@ int dijkstra_search_route_to_geojson(struct dijkstra_search *search,
|
|||||||
for (l = route; l != NULL; l = l->next) {
|
for (l = route; l != NULL; l = l->next) {
|
||||||
node = (struct dijkstra_node*) l->data;
|
node = (struct dijkstra_node*) l->data;
|
||||||
if (node_last) {
|
if (node_last) {
|
||||||
heading = atan2f((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 > 25) {
|
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) {
|
||||||
relative_direction_str = "right";
|
relative_direction_str = "right";
|
||||||
} else if (last_heading - heading < -25) {
|
} else if (last_heading - heading < -10) {
|
||||||
relative_direction_str = "left";
|
relative_direction_str = "left";
|
||||||
} else {
|
} else {
|
||||||
relative_direction_str = "straight";
|
relative_direction_str = "straight";
|
||||||
}
|
}
|
||||||
if (node_last == search->start)
|
if (node_last == search->start)
|
||||||
format_str = "Start on %2$s";
|
format_str = "Start here.";
|
||||||
else if (search->states[node_last->uid]->cheapest_path->name == search->states[node->uid]->cheapest_path->name)
|
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
|
else
|
||||||
format_str = "Go %s onto %s";
|
format_str = "Go %s onto %s.";
|
||||||
|
|
||||||
if (node_last != search->start)
|
if (node_last != search->start)
|
||||||
sdprintf(buf, &offset, ",");
|
sdprintf(buf, &offset, ",");
|
||||||
|
Loading…
Reference in New Issue
Block a user