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.

after starting to use MOBAC to create offline background maps I found the aux.xml files very useful as QGIS automatically sets the CRS so this would be very useful for my colleagues with smaller GIS knowledge.

Is it possible to generate such file for particular projection using WKT or PRJ file? I am able to get both from spatialreference.org

Sample file from MOBAC for EPSG:3395 is here:

PROJCS["World_Mercator",GEOGCS["GCS_WGS_1984",DATUM["WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_1SP"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],PARAMETER["latitude_of_origin",0.0],UNIT["Meter",1.0]]

I use mostly only few CRS - epsg:4326, 32633, 900913, 3395 - so I could always create a copy of current *.aux.xml and rename it to fit the raster dataset name. So this would be helpful for me.

thanks

share|improve this question
add comment

1 Answer 1

This was a proposed feature for QGIS which seems to have slipped down the priorities of the developers for the time being. However the feature request page outlines the syntax of the aux.xml file so it should be possible to write a simple python script to get all of the required parameters from the raster file and SpatialReference.org and write them to an xml file with the required filename.

XML parsing is a massive pain and generally it is best to use a pre-written parser such as beautifulsoup, however since this will write the same file structure every time it should be possible to manage in pure python.

share|improve this answer
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.