Hi,
I am not I would like to map coordinates from a KML file with with other geo-spatial data (see code below). This works well if the kml file only contains one placemark, however, I receive an error if the kml file contains multiple placemarks. Does someone have an idea how I could solve this issue? I am only starting to learn R, so apologies if the solution to this question seems obvious.
Many thanks, Dominique
This is how I tried it:
install.packages("maptools")
install.packages("prevR")
install.packages("rgeos")
library("maptools")
library("prevR")
library("rgeos")
zz <- getKMLcoordinates(file.path("/Users/chs/Downloads/KML_PL1899-2.kml"), TRUE)
zz <- SpatialPolygons(zz)
p1 = Polygon(zz)
p2 <- Polygons(list(p1))
p3 = SpatialPolygons(list(p2))
// check if a coordinate is in polygon (p3)
point.in.SpatialPolygons(104.14432742893, -2.020485348759713, p3)