This file contains 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
#Get second nearest neighbors using knnx | |
x1 <- cbind(ponderosa$x, ponderosa$y) | |
x2 <- cbind(rp$x, rp$y) | |
nn2 <- get.knnx(x1, x2, 2) | |
X.2 <- nn2$nn.dist[,2] | |
X.22 <- X.2^2 | |
sumX.22 <- sum(X.22) |
This file contains 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
#get pairwise distances from rp and ponderosa datasets | |
xpairs <- crossdist(rp, ponderosa) | |
#Initialize vector container for X.2 | |
X.2 = numeric() | |
#Sort rows and get second nearest neighbor | |
for (i in 1:nrow(xpairs) { | |
x <- sort(xpairs[i,])[2] | |
X.2 <- append(X.2, x) |
This file contains 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
#Get second nearest neighbors using crossdist | |
crossnn2 <- crossdist(rp, ponderosa) | |
X.2 <- crossnn2[,2] |
This file contains 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
<html> | |
<head> | |
<title>OpenLayers: Google Layer Example</title> | |
<link rel="stylesheet" href="style1.css" type="text/css" /> | |
<link rel="stylesheet" href="style2.css" type="text/css" /> | |
<!-- this gmaps key generated for http://localhost:8080/geoserver/ --> | |
<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAl9RMqSzhPUXAfeBCXOussRTQDbvAygy0cfGJr8dEMAYKf3RWNBQqP9mjKIsqTfmAlz5LOJ3Xpy5s4w'></script> | |
<script src="resources/openlayers/OpenLayers.js"></script> | |
<script type="text/javascript"> |
This file contains 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
div.olMap { | |
z-index: 0; | |
padding: 0 !important; | |
margin: 0 !important; | |
cursor: default; | |
} | |
div.olMapViewport { | |
text-align: left; | |
} |
This file contains 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
/** | |
* CSS Reset | |
* From Blueprint reset.css | |
* http://blueprintcss.googlecode.com | |
*/ | |
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;} | |
body {line-height:1.5;} | |
table {border-collapse:separate;border-spacing:0;} | |
caption, th, td {text-align:left;font-weight:normal;} | |
table, td, th {vertical-align:middle;} |
This file contains 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
; | |
; pgShapeLoader (Linux): | |
; | |
Title=PostGIS Shapefile and DBF loader | |
Command=$$PGBINDIR/shp2pgsql-gui -U $$USERNAME -d $$DATABASE -p $$PORT -h $$HOSTNAME | |
Description=Open a PostGIS ESRI Shapefile or Plain dbf loader console to the current database. | |
KeyFile=$$PGBINDIR/shp2pgsql-gui | |
Platform=unix | |
ServerType=postgresql | |
Database=Yes |
This file contains 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
mat<-matrix(1:9,1,9) | |
which(mat==5,arr.ind=TRUE) | |
row col | |
[1,] 1 5 | |
#from: http://r.789695.n4.nabble.com/How-do-I-find-the-index-for-a-value-in-an-array-td846012.html |
This file contains 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
theta <- acos( sum(a*b) / ( sqrt(sum(a * a)) * sqrt(sum(b * b)) ) ) | |
#taken from http://stackoverflow.com/questions/1897704/angle-between-two-vectors-in-r |
This file contains 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
#get pairwise distances from rp and ponderosa datasets | |
xpairs <- crossdist(rp, ponderosa) | |
#A function to get the second nearest neighbor | |
nncross2 <- function (x) sort(x)[2] | |
#Initialize the vector container for x.2 | |
x.2 <- numeric() | |
#Applies the nncross2 function to the xpairs matrix. |
OlderNewer