I'm trying to read a folder containing ~80,000 .kmz files of vector data using sf::st_read.
The top-level folder contains a single large .kml file that I expect ties all of the other folders/data together.
These are arranged into a group of OSGB folders, e.g. folder contains four sub-folders and and four .kmz files that I presume describe the folder contents.
Each of these folders then contains a cluster of .kmz files where I presume the vector data is contained for each grid square (e.g. )
So the structure is: 1x top-level.kml
~400x grid square file.kmz
~400x grid square folder
~100x smaller grid square files.kmz
Or...do I simply take all of the small grid square .kmz files, unzip them and import each 1-by-1? I've not yet tried this in the hope that there's a more elegant solution somewhere
Apologies, if I've missed any earlier advice about this but I've searched StackExchange for a solution to this) Further apologies but the data isn't public domain so I'm not sure how best to share, either!
sf::st_readcan not openkmzdirectly. You have to convert them to thekmlfirst. Or use another approach. Maybe this helps https://gis.stackexchange.com/questions/58131/reading-kml-file-into-r – Anatolii Jun 02 '20 at 14:17Yes, the "OSGB folder" was my shorthand for Ordinance Survey GB, because the folders are arranged into OSGB 4-char grid-ref with sub-folders in 6-char format, e.g. folder contains , , , , and then contains 101 .kmz files names <SO2020.kmz>, etc.
– David Hawkins Jun 03 '20 at 06:57I can read the whole nested structure in Google Earth but it feels like st_read cannot import the nested structure.