I get a regularly updated KML file which I need to pull into QGIS.
It has different folders/layers (about 12), and features in each folder/layer have different
<styleURL>s. I need to access each feature's
styleURL (along with name, description, and the location) for processing in QGIS.
1st attempt - just import the KML file inside QGIS. I get one layer per folder (well, lines and points separately), but the styleURL is not an accessible field.
2nd attempt by manually running ogr2ogr and using the special field OGR_STYLE:
ogr2ogr -f GPKG -oo LIBKML_RESOLVE_STYLE=YES -sql "select *, OGR_STYLE from Boundaries" twinrock_test.gpkg twinrock13.kml
Works fine for a single named folder, Boundaries, but I need to run it for all folders in the kml file, as if I just did ogr2ogr -f GPKG twinrock_test.gpkg twinrock13.kml (without the mucking around with OGR_STYLE).
ogr2ogr -f GPKG -oo LIBKML_RESOLVE_STYLE=YES -select Name,description,OGR_STYLE twinrock_test2.gpkg twinrock13.kml
Fails since the special field
OGR_STYLE seems only accessible via -sql, not -select.