[OSM-talk] New "Highways" view in OSM Inspector

Patrick Kilian osm at petschge.de
Sat Jan 9 15:50:39 GMT 2010


Hi all,

> And, thinking about it a bit, I guess the proper rule is that (10, 
> 10) -> (30, 30) passes through (20, 20), since it's completely 
> unrealistic to assume that the basic renderers will do otherwise.
And this is where you are wrong. On zoomlevel 0 (one tile for the whole
earth) (10,10) ends up on (135.11, 135.15) and (30,30) ends up on
(149.33, 150.38).

One thing that should be stand out is the fact that x!=y even for points
which have lat==long.

The halfway point between the two is (142.22, 142.77) while (20,20) is
projected to (142.22, 142.52) or about a quarter of a pixels off. Other
zoom levels or other triplets of points could expose much bigger
deviations but I wanted to prove you wrong using your very own example.

> My understanding is that this is equivalent to say saying that the 
> line is "straight in the Mercator projection", as my understanding is
> that the Mercator projection represents each pixel as a fixed length
> and width in degrees.
Nope it does not. Each pixel represents the same width in degrees, but
the height in degress increases as you go away from the equator.


> And what that also means is that a straight line on earth which is 
> more than a certain length is not properly represented by a way with 
> two points.
THAT depends on your definition of "straight line".


> One thing I can't quite get my mind wrapped around is whether or not 
> a geodesic is what we'd call a straight line on the earth.  If we put
>  a few million (?) rulers end-to-end as best we could, would that
> form a geodesic, and if not, what would it form?  I'm fairly certain
> it wouldn't pass (10, 10) -> (30, 30) through (20, 20), since 20
> degrees of longitude does not (generally) equal 20 degrees of
> latitude in length. But I'm not sure if it'd be a geodesic or not.
> I'd love for someone to answer that question and provide a link or
> source to back up their answer.
Well. There isn't one single definition of "straight line" here. We are
used to the fact that straight lines are the shortest line between two
points. Geodesics are the more general form of that. They connect two
points in with the shortest way possible and are "straight" in that sense.
One a flat surface geodesics are just straight lines. One a sphere the
are segments of great circles. If your metric gets more complicated
geodesics get more complicated too.


On the other hand we are used to the fact that a straight line always
intersects lines which are parallel to the y-axis at a constant angle.
This is not (necessarily) true for geodesics. The compass heading along
the great circle route from (10,10) to (30,30) is NOT going to be NE all
the time! So in that sense geodesics are NOT straight. A line which
follow a constant heading is called a "loxodrome".


As you can see now geodesics and loxodromes are two different lines
which both might be considered straight by some definition. There are
other definitions of straightness and "straight lines" which are defined
by them. In a flat plane they all coincide, but for a sphere or our
not-quite-spherical earth the don't. So don't stop assuming that is a
simple topic, everybody was just a lazy bum or that you know it all (tm).


HTH,
Patrick "Petschge" Kilian




More information about the talk mailing list