Skip to content

Instantly share code, notes, and snippets.

merge_by_intercept <- function(buff){
gt <- rgeos::gIntersects(buff, byid = TRUE, returnDense = FALSE)
ut <- unique(gt)
while(sum(duplicated(unlist(unique(ut)))) > 0){
ut <- unique(sapply(ut, function(x)
unique(unlist(ut[sapply(ut, function(y)
any(x %in% y))]))))
if(is.matrix(ut)){
ut <- list(`1` = ut[,1])
}
@thusoy
thusoy / index.html
Created February 3, 2015 14:50
Simple site to get lat/lon coordinates of a point from OSM with OpenCycleMap tiles.
<!doctype html>
<html>
<head>
<title>Hike map</title>
<style>
html, body, #map {
height: 100%;
}
</style>
<script src="http://www.openlayers.org/api/OpenLayers.js"></script>