To create a nice bounded Voronoi polygons tessellation of a point layer
in R
, we need two libraries: sp
and deldir
. The following function
takes a SpatialPointsDataFrame
as input, and returns a
SpatialPolygonsDataFrame
that represents the Voronoi tessellation of
the input point layer.
- Wed 16 September 2009 cfarmer
Python, Matlab, and R
Wed 12 August 2009 cfarmerOne project I’m working on at the moment involves exploring a dynamic extension of the Isomap algorithm for visualising constantly varying real-world road networks. Currently, we are testing out the method on a small scale simulated road network, and most of the original code (written by Laurens van der Maaten, with updates by Alexei Pozdnoukhov), was done in Matlab. Since this work is eventually going to have to run on relatively large datasets, and probably behind the scenes on a server somewhere, we decided that Python was the way to go. The goal therefore was to reproduce the Matlab code using only Python libraries, and the fewer additional libraries required, the better.
R featured in New York Times
Wed 28 January 2009 cfarmerI’m sure everyone has seen this already, but I’m going to post it anyway, as I think the more exposure open-source tools get, the better off we’ll all be!
Check out this New York Times article which features
R
, the open-source statistical programming language.R
now has quite an extensive range of spatial analysis options, and is the software of choice for researchers using spatial statistics and geographic information analysis.View spatial data attribute tables in R
Tue 14 October 2008 cfarmerMany GIS offer the ability to view the attribute table of a vector layer. While this is perhaps less obvious in the R environment, it is not impossible. The following command allows you to visually inspect, and change any data.frame (or other vector, matrix, etc.), including Spatial*DataFrames.
R spatial indentify tool
Tue 23 September 2008 cfarmerThis is useful for visually exploring R spatial data such as
SpatialPointDataFrames
orSpatialGridDataFrames
. By clicking on various features, the value at that point will be displayed.library(rgdal) y = readGDAL(system.file("pictures/Rlogo.jpg", package="rgdal")[1], band=1) y.grid = y@grid y.coords = coordinates(y.grid) image(y) identify(x=y.coords, y=NULL, n=1)
where
x
andy
refer to coordinates (in this case becausey.coords
contains bothx
andy
coordinates,y
can be set toNULL
), andn
is the number of features to identify.