I have a lot of GML files to loop through in R, but none of them are extremely heavy (max file size is 600 Mb, but normally they range between 10-60 Mb). My problem is that readOGR function from the {rgdal} package takes too long to read them, and it slows down the loop a lot. It takes between 3 minutes up to 30 minutes to read a single file...
I have looped through .shp files and they do not take up so much time to read.
So my question is actually two:
- Is there a faster function in R to read GML files? Have not been able to find one so far
- If a faster reading function isnt possible, is there perhaps a quick way to convert the GML files to .shp?
Code to my readOGR:
llayer<-ogrListLayers(gmls)[1]
a<- readOGR(dsn=gmls, layer=llayer, encoding = "UTF-8", disambiguateFIDs = T)