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 got a postGIS error like this,

ERROR:  transform: couldn't project point (100.496 13.7118 0): latitude or longitude exceeded limits (-14)
SELECT ST_Length(ST_Transform(ST_GeomFromText(E'LINESTRING(100.495995129 13.7117836894,100.495962221169 13.7117761471941)',4326),27700));

This lat/lng comes from Bangok, Thailand and the 27700 is a british national grid. Do you think this casued the problem? May I mention that problems like this did not occur when I got lat/lng from Spain or USA.

Any input would be much appreciated. Kind regards, A

share|improve this question
    
Related gis.stackexchange.com/questions/30117/… –  Mapperz Sep 14 '12 at 15:44
    
What's the E in E'LINESTRING': typo or something I don't recognize? –  andytilia Sep 14 '12 at 16:22
    
i just copied it from postgresql log file in which E indicates a string if I am not mistaken.. –  Antony Sep 14 '12 at 17:02
2  
Why are you trying to convert lat/lng from Bangkok, Thailand to British National Grid? That doesn't seem to make much sense - is there a specific reason? –  CHenderson Sep 14 '12 at 19:07
    
Hi, I started testing in the UK but now it has gone global so I am trying to come around this problem. –  Antony Sep 17 '12 at 9:10
add comment

1 Answer 1

up vote 5 down vote accepted

A guess: many implementations of transverse Mercator (used by British National Grid) can only be used with a limited range of longitudes centered on the projection's central meridian. Try converting to 32647 (WGS 84 UTM Zone 47North) instead to see if that's the issue.

share|improve this answer
    
hi, i tried the 32647 and it still throws the same error. Thanks for your help though! –  Antony Sep 14 '12 at 15:58
    
What versions of PostGIS and PROJ.4 are you using? Testing the suggested SRID 32647 works with PostGIS -trunk and PROJ.4 4.8.0 –  dustymugs Sep 14 '12 at 18:38
    
Try swapping the coordinate order from lon/lat to lat/lon? That is, use 13.7118 100.496. –  mkennedy Sep 14 '12 at 19:36
1  
I just ran your query using 32647 and it worked fine: SELECT ST_Length(ST_Transform(ST_GeomFromText(E'LINESTRING(100.495995129 13.7117836894,100.495962221169 13.7117761471941)',4326),32647)); –  Paul Ramsey Sep 14 '12 at 22:38
    
Hi, I tried it today and it worked, then I tried it again and it did not by throwing an error like this, ERROR: AddToPROJ4SRSCache: couldn't parse proj4 string: '+proj=utm +zone=47 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ': latitude or longitude exceeded limits –  Antony Sep 17 '12 at 8:57
show 1 more comment

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.