1

I would like to convert from EPSG:4326 to UTM (30N/EPSG:32630 or 29N/EPSG:32629) in PostGIS. I do the following query but I get wrong results:

SELECT ST_AsText(ST_Transform(ST_GeomFromText('POINT(36.5277099609375 -5.86424016952515)',4326),32630)) As check;

I get "POINT(5262418.33128724 -839958.963432011)" when it should be something approximate to 243625.00,4046330.00 in UTM 30N. If I do the conversion from 4326 to UTM I get the right result but not from UTM to 4326.

  • What's wrong with the query?
  • And are there anyway to get the UTM timezone from the coordinates in EPSG:4326 because I don't know if they belong to 30N or 29N?

1 Answer 1

3

There is something wrong with your data. POINT(36.5277099609375 -5.86424016952515) is on the southern Hemisphere at 36°E and 5° South.

I guess you rather want POINT(-5.86424016952515 36.5277099609375) which is close to the border of 29N and 30N.

The borders between the UTM zones are 6 degrees apart, starting from -180° in the West. But there are some exceptions around Norway.

2
  • It's that! Thanks! But I have one more issue. The X means the longitude and the Y means the latitude always? Because e.g. in Google Maps i think they are changed.
    – Esteban S
    Commented Sep 28, 2015 at 11:29
  • 2
    You better think of the x-axis horizontally, and the y-axis vertically. No matter if they are degrees or meters. And most GIS software expects the data in X-Y order.
    – AndreJ
    Commented Sep 28, 2015 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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