Created
September 10, 2013 07:16
-
-
Save jlehtoma/6505993 to your computer and use it in GitHub Desktop.
Example of how 2 sets of coordinates (in the same projection) can be compared for proximity.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Buffer the coordinates with a desired distance | |
sp.espoo.etrs89.buffer <- gBuffer(sp.espoo.etrs89, byid=TRUE, width=100) | |
sp.espoo.etrs89.buffer <- SpatialPolygonsDataFrame(sp.espoo.etrs89.buffer, | |
sp.espoo.etrs89@data) | |
sp.tarto.etrs89.buffer <- gBuffer(sp.tarto.etrs89, byid=TRUE, width=100) | |
sp.tarto.etrs89.buffer <- SpatialPolygonsDataFrame(sp.tarto.etrs89.buffer, | |
sp.tarto.etrs89@data) | |
# See which SpatialPoints from the KML files fall within the buffer from sp | |
# points | |
espoo.buffers.with.kml.point <- sp::over(kml.espoo.etrs89, sp.espoo.etrs89.buffer) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment