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

I know how to do this within Quantum GIS but I have 30+ shapefiles that need to be converted to GML. Is there a Python script sample or plugin for Quantum GIS that I can use to convert my shapefiles to GML?

share|improve this question
Depending on your QGIS install you probably have GDAL/OGR installed already. You could then create a quick batch process from ogr2ogr to do the job - after all, that's what QGIS is using the the background anyway. – om_henners Jul 10 '12 at 4:56
ogr2ogr seg.shp pla.gml segments does it not work for you? – Aragon Jul 10 '12 at 6:54
How to convert SHP into GML in OS VerctorMap Local format? – Nickon Oct 16 '12 at 9:09
@om_henners could you add your comment as an answer so the question can be marked as solved if the OP agrees? – steko Dec 14 '12 at 15:58
Thanks @steko - can do. – om_henners Dec 14 '12 at 23:50

With the installation of QGIS you will have the GDAL/OGR libraries installed. OGR supports both shapefiles and GML (and many other vector formats). You can then create a batch process from ogr2ogr to perform the transformation.

share|improve this answer

You can do this from the command-line shell using ogr2ogr ‒ that is, outside QGIS. E.g. on GNU/Linux with bash:

cd /path/to/shapefiles
for file in $(ls *.shp); 
     ogr2ogr "$file" `basename "$file" .shp`.gml; 

That would be a “batch process” as mentioned in some comments to this same question.

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.