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,7 +387,7 @@ double EdgeBasedGraphFactory::GetAngleBetweenTwoEdges(const CoordinateT& A, cons
const double v2x = B.lon - C.lon; const double v2x = B.lon - C.lon;
const double v2y = B.lat - C.lat; const double v2y = B.lat - C.lat;
const double latC = (C.lat/100000.)*M_PI/180.; 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 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; const double angle = a2-a1;

View File

@ -104,13 +104,20 @@ Feature: Turn directions/codes
| a | 55.68740 | 12.52430 | | a | 55.68740 | 12.52430 |
| b | 55.68745 | 12.52409 | | b | 55.68745 | 12.52409 |
| c | 55.68711 | 12.52383 | | c | 55.68711 | 12.52383 |
| x | -55.68740 | 12.52430 |
| y | -55.68745 | 12.52409 |
| z | -55.68711 | 12.52383 |
And the ways And the ways
| nodes | | nodes |
| ab | | ab |
| bc | | bc |
| xy |
| yz |
When I route I should get When I route I should get
| from | to | route | turns | | from | to | route | turns |
| a | c | ab,bc | head,left,destination | | a | c | ab,bc | head,left,destination |
| c | a | bc,ab | head,right,destination | | c | a | bc,ab | head,right,destination |
| x | z | xy,yz | head,right,destination |
| z | x | yz,xy | head,left,destination |

View File

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