4

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?

How to batch "Layer save as"-process in QGIS?>

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

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

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

  • Thanks! :-) Could you explain the creation options? I would like to keep Datasource options, altitudeMode - clamptoGround Will add more information to question. – maskin Jul 5 '16 at 10:21
  • 1
    you can see updated answer. May it help?? – Uje Indo Jul 5 '16 at 13:33
  • Thanks, that helps. Do you know if this gives the same result, has this been tested at all? – maskin Jul 6 '16 at 12:35
  • I am not sure how you might confirm these settings work, but I hope this comment doesn't come across rude, I am not sure how you would tell? Other than a kml has exported. – maskin Jul 6 '16 at 12:36
  • it's ok.. yes, it was updated and tested. – Uje Indo Jul 6 '16 at 12:57
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')
  • 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 5 '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 5 '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 5 '16 at 12:39
  • 1
    i have updated my answer by adding description attribute to creation option. is it that you are looking for? – Uje Indo Jul 5 '16 at 13:38
  • 1
    @Joseph No worries. :-) I tend to write longer answers adding in extra detail... – maskin Jul 6 '16 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.