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 have a png image that shows the region defined by the geo bounds UpperLat, LeftLon, BottomLat, RightLon (in degrees & -ve for West Lon and South Lat) in Plate Carree EPSG:4326. I want to convert it to Mercator EPSG:3857 using GDAL.

When I tried doing it this way:

Step1) gdal_translate -of Gtiff -a_srs EPSG:4326 pc_map_piece.png pc_map_piece.tiff
Step2) gdalwarp -s_srs EPSG:4326 -t_srs EPSG:3857 pc_map_piece.tiff mer_map_piece.tiff

I got this error:

ERROR 1: Unable to compute a transformation between pixel/line and georeferenced coordinates for pc_map_piece.tiff. There is no affine transformation and no GCPs.

Then I tried doing it this way:

Step1) gdal_translate -of Gtiff -a_ullr UpperLat LeftLon BottomLat RightLon -a_srs EPSG:4326 pc_map_piece.png pc_map_piece.tiff
Step2) gdalwarp -s_srs EPSG:4326 -t_srs EPSG:3857 pc_map_piece.tiff mer_map_piece.tiff

I didn't get the above error but the output image is not converted to mercator projection, I simply got the same image upside down as output.

Any ideas to get around this problem and convert the image to Mercator? Thanks.

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

Problem solved. Changing the order to LeftLon UpperLat RightLon BottomLat in my second approach gdal_translate did it for me!!

share|improve this answer
    
Mark your answer as accepted then — it's common practice also mentioned in the FAQ. –  lynxlynxlynx Oct 3 '12 at 17:00
add 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.