Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There is a special tag 'way_area' in osm2pgsql creating a database column that stores the area of polygon features. So is there something like this for calculation of length of line objects?

share|improve this question
up vote 3 down vote accepted

No, but use can use PostGIS function ST_Length for that. It returns length in meters if way field is of geography type. That is, to get length in meters, convert it: ST_Length(ST_Transform(way, 4326)::geography).

share|improve this answer
It's also worth noting that if you just want to order by length, ST_Length(way) will work if only considering a reasonable sized area as once, assuming you have imported with a conformal projection like Web Mercator – Paul Norman Sep 9 '14 at 1:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.