[OSM-dev] shortest streets

Stephan Knauss osm at stephans-server.de
Thu Sep 17 01:01:10 BST 2009


Lennard wrote:
> Stephan Knauss wrote:
>> something like this?
>> select osm_id, st_length(way) as length from planet_osm_roads order by 
>> length asc limit 10
> 
> Something, but not exactly that. ST_Length(way) is in projected meters, 
> which varies with latitude.

So could you specify a better projection that would be equidistant? The 
data here uses 900913.
Would 4326 be equidistant?

Then it could read like this:
select osm_id, length(st_transform(way,4326)) as length from 
planet_osm_roads order by length asc limit 10

Is there a difference between st_length() and length()? They both return 
the same values (at least for 900913).

Postgis manual has a similar query to sum up the length of ways. Why is 
it working there? Different projection?

Stephan




More information about the dev mailing list