Sunday, 2 April 2017

python - How should I use GDAL to perform a transformation?


I am a student who wishes to use GDAL to transform a series of images from Lambert Conformal Conic (EPSG: 9802) to Google Earth's WGS 84 (EPSG: 4326) for a web mapping project. I know that in order to perform this operation I need to use gdaltransform, which is an executable that can be used via command line.


My issue is not being able to wrap my head around how to use gdaltransform correctly. I have read several documents that source this link http://gdal.org/gdaltransform.html, but I have been unable to replicate the tutorial results. Can someone please help me understand what I am missing.


Source Code: This code is what I typed in replicate the demo found on the above link.


Input: gdaltransform -s_srs EPSG:9802 -t_srs EPSG:4326


Return: 0 0 0


Input: 177502 311865



Return: 177502 311865 0


Note: The return should read 244510.77404604 166154.532871342 -1046.79270555763 not 177502 311865 0



Answer



Actually, you will want gdalwarp, not gdaltransform. There are lots of examples out there.


For example,


gdalwarp -t_srs 'EPSG:4326' input.tif output.tif

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...