6

EDIT - please link any similar questions as this needs testing on QGIS 3

Similar questions have been asked but without I think non "script" solutions

Is there a easier to use for non technical users for QGIS plugin/program to bulk export files? Say shp files to .kml files?

I believe a program: Expert GPS Pro that would do this, but this $299.95 at the time of writing. (http://www.expertgps.com/)

Similar Questions

Bulk SHP/KML Processing Tools

Bulk uploading shapefiles to PostGIS?

Exporting several files at same time in QGIS

https://gis.stackexchange.com/questions/137326/how-to-batch-layer-save-as-process-in-qgis?lq=1>

https://gis.stackexchange.com/questions/176490/convert-shp-to-mif-mid>

How to bulk import gpx files to QGIS and merge into a single shapefile?

Related Questions

CartoDB QGIS plugin: export/import projection shift?

EDIT

Cannot get plugin to work based on answer

Get error: 'NoneType' object has no attribute 'CreateDataSource' See log for more details

Tried kml to shp and shp to kml Autofill settings, used Do not autofill for each test. Perhaps this plugin is better in newer QGIS versions

In QGIS 2.2:

  • Output layer doesn't remember where you saving the files too
  • You have to fill the output layer in multiple times. The path (location to save files isn't remembered)
  • This bulk convert probably takes longer to setup than manually saving each file for a small number

How could you replicate Save Vector Layer Export settings, such as DataSource Options, Layer Options, Custom Options ect... via Creation Options Settings, so that the conversion is the "same"?

If you export kml files, I think you sometimes need to remove the altitude component via: Datasource Options, AltitudeMode: ClampToGround, so is this or other "settings" still possible via Creation Options?

I ask as I would assume you would still need to manually export files, if the settings are not "transferable" to the Convert Format.

Save vector layer as... window

Convert format window

maskin
  • 611
  • 8
  • 15
  • www.geofileconverter.com this website above helps easily convert geographic file formats for example shp, csv, wkt, gml, kml... it is based on the OGR libraries. – Elasri Abdessadek Oct 15 '18 at 22:41
  • @ElasriAbdessadek Thanks, just wanted this inside QGIS, but this question is out of date. I've just got back access to stackexchange – maskin Oct 17 '21 at 15:26

3 Answers3

6

Yes, there is. its called "Convert format". Go to processing toolbox and run it from there by right click then run as batch processing.

enter image description here

UPDATE :

put as follow in creation option column:

-dsco AltitudeMode=absolute -dsco NameField=Name -dsco DescriptionField=Description

For example, in my case will be

-dsco AltitudeMode=clampToGround -dsco NameField=NAME_1 -dsco DescriptionField=Description

TEST RESULT enter image description here

Be Careful, when insert the creation option attribute (No space at the end allowed, seems it affecting the result):

Wrong → enter image description here Right → enter image description here

This extra description value can be modified as you need like AltitudeMode can be clampToGround or relativeToGround like the one that you see within "Save as" method.

UPDATE 2 - Alternative

-dsco altitudeModeEnum=clampToGround -dsco NameField=Name -dsco DescriptionField=description

Alternative option has been tested.

Source : GDAL.org and KML Guide for Google Developer

Maruli Uje Indo
  • 703
  • 4
  • 15
2

The answer provided by @UjeIndo seems to be the correct one although I am also unsure how to exactly use the Creation Options. But if you have loaded your shapefiles into QGIS, you could loop through each one and save it as a .kml file specifying the datasourceOptions by using the following in the Python Console:

result_path = "path/to/directory/"
for layer in QgsMapLayerRegistry.instance().mapLayers().values():
    QgsVectorFileWriter.writeAsVectorFormat(layer, result_path + layer.name(), "utf-8", None, "KML", datasourceOptions='your_text')
Joseph
  • 75,746
  • 7
  • 171
  • 282
  • Thank you :-) but I am looking for non "script" options as this is more practical to explain to other users of QGIS I know.

    Unless you know of a dummies/step by step guide to running this in Python Console that I could share? :-) but I don't wish to ask too much of your time.

    – maskin Jul 05 '16 at 12:15
  • 2
    @maskin - Most welcome, there are other plugins available which convert shapefiles to kml such as Batch Save Layers and Bulk vector export but I don't think either of these support adding in custom options. But to run the above code, you can copy/paste it to a text editor, change the result_path and datasourceOptions, press Ctrl + Alt + P in QGIS to load up the python console, then paste the code and hit Enter twice ;) – Joseph Jul 05 '16 at 12:21
  • Thanks, I would like to expand your answer with your comment if that is possible? To highlight that the plugins are experimental so users can better find them. – maskin Jul 05 '16 at 12:39
  • 1
    i have updated my answer by adding description attribute to creation option. is it that you are looking for? – Maruli Uje Indo Jul 05 '16 at 13:38
  • @maskin - Apologies, I keep forgetting that I have it enabled! – Joseph Jul 05 '16 at 14:41
  • 1
    @Joseph No worries. :-) I tend to write longer answers adding in extra detail... – maskin Jul 06 '16 at 12:40
1

I think the best option might be the installation of the HCMGIS plugin, which has a built-in batch converter.

The plugin appears in the main top bar after installation. You can select:

HCMGIS -> Batch Converter -> Vector format converter

and next select the file extensions to convert: Shp, GeoJSON, CSV, Kml, Gpkg and Gml

enter image description here

Geographos
  • 4,087
  • 2
  • 27
  • 88