add test for negative latitudes

This commit is contained in:
Emil Tin 2013-02-23 13:20:45 +01:00
parent 1690b4037b
commit 2f8a07fec9
3 changed files with 11 additions and 8 deletions

View File

@ -387,9 +387,9 @@ double EdgeBasedGraphFactory::GetAngleBetweenTwoEdges(const CoordinateT& A, cons
const double v2x = B.lon - C.lon;
const double v2y = B.lat - C.lat;
const double latC = (C.lat/100000.)*M_PI/180.;
const double scale = cos(latC); //scale by length of longitude at latitude latC
const double scale = cos(latC); //scale by length of longitude at latitude C
const double a2 = atan2(v2y,v2x*scale)*180/M_PI;
const double a1 = atan2(v1y,v1x*scale)*180/M_PI;
const double a1 = atan2(v1y,v1x*scale)*180/M_PI;
const double angle = a2-a1;
if(angle < 0) {

View File

@ -97,20 +97,27 @@ Feature: Turn directions/codes
| g | c | xg,xc | head,right,destination |
| g | e | xg,xe | head,sharp_right,destination |
Scenario: Turn instructions at high latitude
Scenario: Turn instructions at high latitude
https://github.com/DennisOSRM/Project-OSRM/issues/532
Given the node locations
| node | lat | lon |
| a | 55.68740 | 12.52430 |
| b | 55.68745 | 12.52409 |
| c | 55.68711 | 12.52383 |
| x | -55.68740 | 12.52430 |
| y | -55.68745 | 12.52409 |
| z | -55.68711 | 12.52383 |
And the ways
| nodes |
| ab |
| bc |
| xy |
| yz |
When I route I should get
| from | to | route | turns |
| a | c | ab,bc | head,left,destination |
| c | a | bc,ab | head,right,destination |
| x | z | xy,yz | head,right,destination |
| z | x | yz,xy | head,left,destination |

View File

@ -161,11 +161,7 @@ function way_function (way, numberOfNodesInWay)
local service = way.tags:Find("service")
local area = way.tags:Find("area")
local foot = way.tags:Find("foot")
if name ~= "Vej 6" and name ~= "Skadestuevejen" then
return 0
end
-- name
if "" ~= ref then
way.name = ref