Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

Sample file from MOBAC for EPSG:3395 is here:


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.


share|improve this question

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 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

Your Answer


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.