I'm curious if anyone out there has written a python script or knows of one that allows the input of an ASCII file (pixel coordinates) and output of a numpy array or similar format for storing the actual geographic coordinates?

I can easily use GDAL to convert from ASCII to GeoTiff or something similar and then extract values using that raster but I'm curious if there is an easy way to do this directly without a GIS from:

  1. ASCII Header Information
  2. Known Coordinate System of ASCII

I think I should be able to use gdal_translate and gdal warp if I knew the projection equation.

1 Answer 1


I think you have answered your own question. An normal installation of GDAL will have executable for both gdal_translate and gdal_warp that you can use standalone or could call from the Python bindings for GDAL. Assuming your GIS is QGIS have a look in the installation directory and you will find them (for me on Windows it is: C:\OSGeo4W64\bin - other installations will vary). You can also install the GDAL bindings separately from any GIS just for your version of Python.


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.