Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 2 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.