[GIS] Any idea how to export multiple KML files from one SHP layer

google-fusion-tableskmlqgis

When exporting one KML, it's exceeding the Google Fusion Table's max limit of 100mb per upload. Fusion Tables however lets users merge more than one KML for a merged max size of 250mb. Any idea how to export multiple KMLs from QGIS?

Best Answer

It is trivial with ogr2ogr and SQLite SQL dialect. Next examples write 10 first lakes into one KML file and next 10 lakes into another KML file

ogr2ogr -f kml batch_1.kml lakes.shp -dialect sqlite -sql "select * from lakes limit 10"

ogr2ogr -f kml batch_2.kml lakes.shp -dialect sqlite -sql "select * from lakes limit 10 offset 10"
Related Question