38

The following solution is based on a post by Roger Bivand on R-sig-Geo. I took his example replacing the German shapefile with some census data from Oregon you can download from here (take all shapefile components from 'Oregon counties and census data'). Let's start with loading the required packages and importing the shapefile into R. # Required packages ...


29

"Geographically weighted PCA" is very descriptive: in R, the program practically writes itself. (It needs more comment lines than actual lines of code.) Lets begin with the weights, because this is where geographically weighted PCA parts company from PCA itself. The term "geographical" means the weights depend on distances between a base point and the ...


28

This question has been converted to Community Wiki and wiki locked because it is an example of a question that seeks a list of answers and appears to be popular enough to protect it from closure. It should be treated as a special case and should not be viewed as the type of question that is encouraged on this, or any Stack Exchange site, but if ...


23

Here is example code. It is fairly straight forward to adapt this code to work in a loop for processing all of your rasters. If your rasters share a common extent and resolution you can create a raster stack and loop through the bands in the stack. To create a vector containing all rasters in a directory, in a specific format, you can use "list.files" and ...


19

My guess is that you coordinate transformations have introduced tiny rounding errors (see an example below). As there is no way to set the tolerance in ST_Equals, this is causing ST_Equals to return false for some geometries that only differ in the nth decimal place, as the geometries have to be identical in every respect -- see the intersection matrix ...


18

A couple I've found useful: I'd strongly recommend Analysing spatial point patterns in 'R' by Prof. Adrian Baddeley at the CSIRO in Australia. It covers the spatstat module in depth and I think it's a great resource for cluster analysis. Applied Spatial Data Analysis in R (Bivand, Roger S., Pebesma, Edzer J., Gómez-Rubio, Virgilio) and Spatial Statistics ...


17

This question has been converted to Community Wiki and wiki locked because it is an example of a question that seeks a list of answers and appears to be popular enough to protect it from closure. It should be treated as a special case and should not be viewed as the type of question that is encouraged on this, or any Stack Exchange site, but if ...


17

This is a difficult question as there just have not been many, if any, spatial process statistics developed for line features. Without seriously digging into equations and code, point process statistics are not readily applicable to linear features and thus, statistically invalid. This is because the null, that a given pattern is tested against, is based on ...


16

Few more from my side: Virgilio Gómez Rubio's (he is the author of the famous/superuseful ASDAR book, mentioned in other answers) website provides materials to his tutorials from useR! conferences - slides, data and code are available. Apart from ADAR, there is now new book 'An Introduction to R for Spatial Analysis and Mapping' by Brundson & Comber ...


16

Spatial statistics, like most statistical methods, is a large topic. If you would like spatial statistical theory presented in a statistical/mathematical framework my favorite is Cressie's book "Statistics for Spatial Data". Since Diggle's point process book is out of print, A good alternative, specific to point pattern analysis, is "Statistical Analysis ...


15

There's no strict algorithmic relationship between latitude and longitude and zip code - they're all custom areas generated by the postal service. You need access to a dataset that codes polygons / polygon centroids by zip code. 1) Complex Traditionally, this task (coupled with address lookup) is termed 'Geocoding'. The most convenient method for full ...


15

Evaluation of the options Contour lines represent continuous surfaces, so their comparison ultimately is a proxy for comparing those surfaces. Because both the surface values (elevations) and locations are potentially subject to error, there are two components to the comparison: in terms of value and in terms of position. The two cannot be separated, ...


14

Note: the following was edited following whuber's comment You might want to adopt a Monte Carlo approach. Here's a simple example. Assume you want to determine if the distribution of crime events A is statistically similar to that of B, you could compare the statistic between A and B events to an empirical distribution of such measure for randomly ...


14

Update: There is now a specialized R package available on CRAN - GWmodel that includes geographically weighted PCA among other tools. From author's website: Our new R package for Geographically Weighted Modelling, GWmodel, was recently uploaded to CRAN. GWmodel provides range of Geographically Weighted data analysis approaches within a single ...


14

Learning by doing is my preferred way. And when it comes to spatial statistics, R is getting seriously powerful tool. So if this is an option browse through some course materials, download the data and try it yourself. Few starting points covering spatial autocorrelation (SA) (and generally speaking handling spatial stuff in R): Center for Studies in ...


14

You might want to look into Fréchet distance. I only recently found out about this after a recent question looking for a python implementation. This is a metric for finding spatial similarity of linestrings. It's a similar idea to Hausdorff distance, the equivalent for polygon similarity measures, but for linestrings with a direction. The Fréchet ...


13

ArcGIS v10 will do this. First run "Add XY coordinates". Then run Dissolve, select Point_X and Point_Y as the dissolve fields, add a statistics field, Sum. I just tested it on overlapping Points. The output has a single Point at each overlap location while the numeric field is summed, for that location.


13

Here is a solution based on Find clusters of points based distance rule, but using the distm function from the geosphere package: library(sp) library(rgdal) library(geosphere) # example data from the thread x <- c(-1.482156, -1.482318, -1.482129, -1.482880, -1.485735, -1.485770, -1.485913, -1.484275, -1.485866) y <- c(54.90083, 54.90078, 54.90077, 54....


13

GeoDa is free, cross-platform software designed for dynamic visualization, exploratory spatial data analysis, and spatial statistics. It has been around for almost 15 years (starting as an ArcView 3.x extension, it was recoded to be independent of ArcView after ESRI abandoned the old AV architecture). It is associated with an illustrious group of GIS ...


13

What these procedures are Although OLS and GWR share many aspects of their statistical formulation, they are used for different purposes: OLS formally models a global relationship of a particular sort. In its simplest form, each record (or case) in the dataset consists of a value, x, set by the experimenter (often called an "independent variable"), and ...


13

One way to approach this interesting problem is to view it as a robust estimator of the center of a bivariate point distribution. A (well-known) solution is to peel away convex hulls until nothing is left. The centroid of the last non-empty hull locates the center. (This is related to the bagplot. For more information, search the Web for "convex hull ...


11

There are functions for computing true distances on a spherical earth in R, so maybe you can use those and call the clustering functions with a distance matrix instead of coordinates. I can never remember the names or relevant packages though. See the R-spatial Task View for clues. The other option is to transform your points to a reference system so that ...


11

The ESRI Spatial Statistics tools do not calculate great circle distance if the data is in a geographic coordinate system (Lat/Long). As such, distance based spatial analysis is incorrect. The tools require that your projection units be in feet or meters. The "ZONE_OF_INDIFFERENCE" is a term made up by ESRI that basically means that within a local ...


11

Chris Brunsdon gave a paper on this issue at the 2008 GeoComputation conference - see http://www.geocomputation.org/2007/1B-Algorithms_and_Architecture1/1B2.pdf In the paper he discusses how to apply Principal Curve Analysis (Hastie and Stuetzle 1989) and makes some suggestions on how to increase robustness of the method. Further searching leads to a ...


11

The expected value of Moran's I is -1/(N-1), which for your sample of 38 cases equals -1/(38-1) = -0.02702703. This is what the software spit out, so that is a good start! So this means that there is really no evidence of negative auto-correlation here, as with random data you would expect it to be a negative value more often than positive. You interpret ...


10

Simple question, difficult solution. The best method I know uses simulated annealing (I have used this to select a few dozen points out of tens of thousands and it scales extremely well to selecting 200 points: the scaling is sublinear), but this requires careful coding and considerable experimentation, as well as a huge amount of computation. You should ...


10

Average slope sounds like a natural quantity but it's rather a strange thing. For instance, the average slope of a flat horizontal plain is zero, but when you add a tiny bit of random, zero-average noise to a DEM of that plain, the average slope can only go up. Other strange behaviors are the dependence of the average slope on DEM resolution, which I have ...


9

have you looked at the zipcode package? it's basically a dataframe with ~45,000 zipcodes along with their city, state, latitude and longitude.


9

The ArcGIS online help page has the answer here: http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=How%20GWR%20Regression%20works In particular this quote seems particularly pertinent: Parameter estimates and predicted values for GWR are computed using the following spatial weighting function: exp(-d^2/b^2). There may be differences in this ...


8

In R you can do library(raster) library(rgdal) r <- raster('raster_filename') p <- readOGR('shp_path', 'shp_file') e <- extract(r, p, fun=mean) e is a vector with the mean of the raster cell values for each polygon.


Only top voted, non community-wiki answers of a minimum length are eligible