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.

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)',
                                 4326),
                                 ST_Transform('SRID=3035;POLYGON((4000000          3000000
                                                                 (4000000 + 5000)  3000000,
                                                                 (4000000 + 5000) (3000000 + 5000),
                                                                  4000000         (3000000 + 5000),
                                                                  4000000          3000000 ))',
                                4326)))

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.) postgis.refractions.net/documentation/manual-1.5/… –  Mapperz Jun 12 '12 at 14:59

1 Answer 1

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

 
discard

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.