2

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?

5
  • 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
    Commented Jul 10, 2012 at 4:56
  • 1
    ogr2ogr seg.shp pla.gml segments does it not work for you?
    – urcm
    Commented Jul 10, 2012 at 6:54
  • How to convert SHP into GML in OS VerctorMap Local format?
    – Nickon
    Commented Oct 16, 2012 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
    Commented Dec 14, 2012 at 15:58
  • OS? Windows or Linux?
    – nickves
    Commented Dec 15, 2012 at 11:42

2 Answers 2

3

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.

3

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); 
   do 
     ogr2ogr "$file" `basename "$file" .shp`.gml; 
   done

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

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.