[R-sig-Geo] Reading multiple layer/geometry KML into R
Robin Edwards
geotheory1 at gmail.com
Tue Oct 22 00:07:09 CEST 2013
I'm vaguely aware there is an issue with reading KML files into R that have
contain layers/geometries - e.g. as Barry describes in this r-sig-geo post
<http://r-sig-geo.2731867.n2.nabble.com/convert-KML-file-into-shape-file-or-CSV-file-td4136757.html>
, listing one particular problem as arising when "the individual KMZ files
which do contain the data have multiple layers". Is there any way around
this, or is it insurmountable with rgeos as it stands?
A reproducible example:
library(rgdal)
setwd( {SPECIFY A FOLDER} )
download.file("http://www.scribblemaps.com/maps/kml/shackleton.kml",
"file.kml")
(lyr = ogrListLayers("file.kml"))
map = readOGR ("file.kml", layer=lyr, verbose = TRUE,
drop_unsupported_fields=T, dropNULLGeometries=T)
yields errors in Windows & Mac:
Windows: Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding,
use_iconv = use_iconv) :
Cannot open layer
OSX: Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding,
use_iconv = use_iconv) :
Multiple incompatible geometries: 1:2
Thanks in advance.
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Reading-multiple-layer-geometry-KML-into-R-tp7584922.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
More information about the R-sig-Geo
mailing list