I have a collection of very large KML files that I'm trying to convert to .shp. I'm iterating over 200+ KML files with an average size of around 20 MB. Each KML contains multiple layers, some of which have names that contain special characters including
When I run ogr2ogr on these KMLs the layers with names containing special characters do not get created, as the layer's .shp files are named by each layer and filenames cannot include things like
I wrote a script to replace all special characters using
sed but due to the huge volume of text this looks like it will take several days to complete, even on a fast machine with SSD.
I was hoping to use ogr2ogr's -nln parameter to map outgoing layer names to character-safe names, but the parameter seems to only accommodate a single layer name.
Can anyone suggest a way to change the KML layer names before conversion that may be quicker than
sed (Google Earth struggles and eventually crashes if I try to open the KML directly), or a way to explicitly tell ogr2ogr what to call the new .shp files?