On Wed, 25 Feb 2009, Roger Bivand wrote:
On Tue, 24 Feb 2009, Heuvelink, Gerard wrote:
Dear list,
The stratified random sampling problem that I submitted a few days ago has
already been solved, with the help of several of you, notably Edzer
Pebesma. Edzer came up with the following solution
On Wed, Feb 25, 2009 at 12:53 AM, Roger Bivand wrote:
> On Tue, 24 Feb 2009, Heuvelink, Gerard wrote:
>
>> Dear list,
>>
>> The stratified random sampling problem that I submitted a few days ago has
>> already been solved, with the help of several of you, notably Edzer Pebesma.
>> Edzer came up wi
On Tue, 24 Feb 2009, Heuvelink, Gerard wrote:
Dear list,
The stratified random sampling problem that I submitted a few days ago
has already been solved, with the help of several of you, notably Edzer
Pebesma. Edzer came up with the following solution:
WARNING!! This is only conditionally co
Dear list,
The stratified random sampling problem that I submitted a few days ago has
already been solved, with the help of several of you, notably Edzer Pebesma.
Edzer came up with the following solution:
library(sp)
library(rgdal)
nc1 <- readShapePoly(system.file("shapes/sids.shp",package="
Hi Gerard,
following Dylan's hint, the following example should be easily reproducable:
library(maptools)
nc1 <- readShapePoly(system.file("shapes/sids.shp",
package="maptools")[1], proj4string=CRS("+proj=longlat +datum=NAD27"))
x100 = do.call(rbind, sapply(slot(nc1, "polygons"), spsample, n=1,
t
Hi Gerald:
I have an example that may help: It demonstrates the sampling of a
polygon shape file with a regularly-spaced point grid,
and assignment of polygon values to the sampling points:
http://nceas.ucsb.edu/scicomp/GISSeminar/UseCases/SampleVectorPolygonsRasterGrid/SampleVectorPolysRastGr
On Monday 23 February 2009, Heuvelink, Gerard wrote:
> Dear list,
>
> I use readShapePoly to import a shape file. The file has multiple polygons
> (actually, a 'polygon' may consist of multiple polygons that have the same
> ID). I want to sample one location at random from each of the polygons. I
>
Dear list,
I use readShapePoly to import a shape file. The file has multiple polygons
(actually, a 'polygon' may consist of multiple polygons that have the same ID).
I want to sample one location at random from each of the polygons. I tried to
do this with spsample but did not manage (the opti