I have a lot of .TAB files open in QGIS and I want to save them to .SHP so I can work with them in ArcMap.
Is there a way to save/export all these files at the same time or do I really have to "save as" separately for every single file?
Answer
Try this Frida:
Create a folder to store your Shapefiles there (e.g., I've created the folder
/tmp/data/
, I use GNU/Linux).In QGIS, open the QGIS Python console.
Write the following line, editing the right hand side to match the full path to your folder (make sure you include the trailing slash/backslash):
myDir = '/tmp/data/'
Press Enter.
Copy the following lines to the QGIS Python console:
for vLayer in iface.mapCanvas().layers():
QgsVectorFileWriter.writeAsVectorFormat( vLayer,
myDir + vLayer.name() + ".shp", "utf-8",
vLayer.crs(), "ESRI Shapefile" )Press Enter a couple of times.
You should now have your Shapefiles inside the folder you created in step 1.
If you face troubles, let me know your OS and the full path to your folder.
No comments:
Post a Comment