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

I want to calculate the lenght of the line inside the polygon.

If I do this:

SELECT ST_Length(ST_Intersection(ST_Transform('SRID=3035;LINESTRING(4000000 3000000, 
                                                                    4005000 3005000)',
                                 ST_Transform('SRID=3035;POLYGON((4000000          3000000
                                                                 (4000000 + 5000)  3000000,
                                                                 (4000000 + 5000) (3000000 + 5000),
                                                                  4000000         (3000000 + 5000),
                                                                  4000000          3000000 ))',

I get as a result: 0.0809729885483392

Shouldn't I get around 7000? What am I doing wrong?

share|improve this question
ST_Length for LineStrings - ST_Perimeter for 2D (polygon and multipolygon.)… – Mapperz Jun 12 '12 at 14:59
up vote 0 down vote accepted

You transformed to SRID 4326 which uses the unit degrees. That's why your result is so small. Why do you transform?

share|improve this answer
Good question ;) Thanks for help! – Zahnfee Jun 12 '12 at 15:44

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.