Re: [R-sig-Geo] Generating Random Transects of Same Length

2009-02-12 Thread Tom Philippi
Marcelino & All-- If, by random, you mean either equal inclusion probability (of points or transects) or even known/computable inclusion probability (e.g., for Horvitz-Thompson estimators of properties of the entire polygon), be wary of edges and think very carefully about what exactly you are gen

Re: [R-sig-Geo] Generating Random Transects of Same Length

2009-02-12 Thread Barry Rowlingson
2009/2/12 Marcelino de la Cruz : > > As an spatstat aficionado, I would use the following code: Very very nice, but: > #compute a circle around each point > cosadisc<- apply(cosaxy,1, function(x) disc(r=ltransect, x)) generates 128 points on a circle around each point. There's a teeny tiny cha

Re: [R-sig-Geo] Generating Random Transects of Same Length

2009-02-12 Thread Marcelino de la Cruz
As an spatstat aficionado, I would use the following code: Enjoy! Marcelino library(spatstat) # Define polygon, length of transect and number of (points)transects data(letterR) mywindow <- letterR ltransect <- 0.3 npoints <- 100 s<- 1:npoints # Generate random origin points cosa <- runifpoi

Re: [R-sig-Geo] Generating Random Transects of Same Length

2009-02-12 Thread Barry Rowlingson
2009/2/12 Pierre Racine : > Hi, > > Anybody knows a tool or algorythm (R, GRASS or ArcGIS Script, anything!) > to generate a number of random same length transects (e.g. 1000) within > the extent of a given polygon or raster? > > I can't just create random point in the extent and joint hem two by t

Re: [R-sig-Geo] Assistance converting SPDF polygons to holes

2009-02-12 Thread Roger Bivand
On Thu, 12 Feb 2009, Don MacQueen wrote: I feel a bit lazy asking for help, as I know I can do this -- but since I don't work with spatial polygons frequently, I find assembling objects consisting of nested polygons to be a bit challenging. It can be done, so this approach from the other side

[R-sig-Geo] Generating Random Transects of Same Length

2009-02-12 Thread Pierre Racine
Hi, Anybody knows a tool or algorythm (R, GRASS or ArcGIS Script, anything!) to generate a number of random same length transects (e.g. 1000) within the extent of a given polygon or raster? I can't just create random point in the extent and joint hem two by two. This would result in different len

Re: [R-sig-Geo] How to move an island?!

2009-02-12 Thread Greg Snow
Well to move an island you are going to need a really big ship with a really big crane ... Ok, on a more serious note. Here is one approach that may work for you (a different idea from what you suggest below): library(maptools) library(TeachingDemos) dnk <- readShapePoly('g:/downloads/DNK_adm

[R-sig-Geo] In R: adaptive kernel density estimation

2009-02-12 Thread Sandra Oliveira
Hi all, I'm trying to compute adaptive kernel density estimation in R (multivariate data), using the k-nearest neighbour method for selecting the bandwidth. I found locfit (only for univariate) and I tried the Kernsur in GenKern package (which says it can use non equally spaced and adaptive bandw

[R-sig-Geo] Assistance converting SPDF polygons to holes

2009-02-12 Thread Don MacQueen
I feel a bit lazy asking for help, as I know I can do this -- but since I don't work with spatial polygons frequently, I find assembling objects consisting of nested polygons to be a bit challenging. I have a Spatial Polygons Data Frame object named "s2poly" (read in from a polygons shapefile

Re: [R-sig-Geo] How to move an island?!

2009-02-12 Thread Roger Bivand
On Thu, 12 Feb 2009, Peter Jepsen wrote: Dear all, I have only just begun plotting on maps, so please bear with me. I am plotting a map of Denmark in which each county is colorcoded by its incidence of a particular disease. I am using the map data found at http://biogeo.berkeley.edu/bgm/gdatare

Re: [R-sig-Geo] SpatialGridDataFrame to data.frame

2009-02-12 Thread Roger Bivand
On Thu, 12 Feb 2009, Ned Horning wrote: Roger, Thanks - It looks like this will do the trick. I had to change [X$covertype="forest",] to [X$covertype=="forest",] but it appears to work just fine. Yes, of course, my mistake. Nice to know it worked after correction. Roger Ned Roger Bivan

Re: [R-sig-Geo] SpatialGridDataFrame to data.frame

2009-02-12 Thread Ned Horning
Roger, Thanks - It looks like this will do the trick. I had to change [X$covertype="forest",] to [X$covertype=="forest",] but it appears to work just fine. Ned Roger Bivand wrote: On Thu, 12 Feb 2009, Ned Horning wrote: Roger and Robert, Thanks for the help. Once again I am close but I c

Re: [R-sig-Geo] SpatialGridDataFrame to data.frame

2009-02-12 Thread Roger Bivand
On Thu, 12 Feb 2009, Ned Horning wrote: Roger and Robert, Thanks for the help. Once again I am close but I can't figure out how to use the attribute data to control the sampling. I'd like to stratify the sampling by attribute value. In the Shapefile I have an integer attribute "covertype". T

Re: [R-sig-Geo] SpatialGridDataFrame to data.frame

2009-02-12 Thread Ned Horning
Roger and Robert, Thanks for the help. Once again I am close but I can't figure out how to use the attribute data to control the sampling. I'd like to stratify the sampling by attribute value. In the Shapefile I have an integer attribute "covertype". There can be several polygons with the same

[R-sig-Geo] How to move an island?!

2009-02-12 Thread Peter Jepsen
Dear all, I have only just begun plotting on maps, so please bear with me. I am plotting a map of Denmark in which each county is colorcoded by its incidence of a particular disease. I am using the map data found at http://biogeo.berkeley.edu/bgm/gdatares.php. The map is perfect, but the island of