if object states is of class SpatialPolygons or of class
SpatialPolygonsDataFrame, use
plot(states[1,])
you can find out by asking
class(states)
On 11/01/2010 07:42 PM, Peter Larson wrote:
Hello all,
This is probably a completely stupid question, but how does one subset
a polygon data set
On 08/13/2010 03:33 PM, Patrick Giraudoux wrote:
Thank you both, that is very clear now. SpatialPixelsDataFrame objects
can be indexed as a data frame, but not SpatialGridDataFrame where
row, col, band must be specified (thanks also not to have written,
please read the doc, which was all
you mean
chinatemput...@data[idx,]
?
If you want to subset the grid itself, look at the examples for
SpatialGridDataFrame class
# the following is weird, but illustrates the concept of row/col
selection:
data(meuse.grid) # only the non-missing valued cells
fullgrid(meuse.grid) = TRUE
# Subseting shapefile before merging tables - join table
I realised that deleting the polygon with does match wit the record is
not possible since, I can read the shapefile at all. But still I need
to know how to delete / subset polygons.
I think this is more workable.
1. Read shapefile
I apologize for raising the same topic from time to time,
but each time I have to subset Spatial*DataFrame
objects (where * stands for polygons, lines or points) I
get some problems.
Last year Roger was kindly advising:
Just think of Spatial*DataFrame objects as data.frame objects and things
Thanks, Augusting for pointing out a flaw in the [ methods for
Spatial*DataFrames. To be really honest, I didn't even know that you
could select rows by ID this way. After 16 years of using S!
I'll look into it when I get the chance; this may however take (quite) a
while.
--
Edzer
Agustin Lobo
Dear all,
I have a SpatialGridDataFrame which I read from grass
myrast-readRAST6(DRENVAL)
Now I attrib a sequential number for each pixel with:
myrast @ data[[1]]-1:dim(myrast @ data)[1]
Now I need to select record by record, from 1 to N, get the bbox()
from each record, set the g.region
For SpatialGridDataFrames, row and col selection can be done by
object[firstrow:lastrow, firstcol:lastcol,]
after the last , you can optionally select attributes.
--
Edzer
Rob Robinson wrote:
Help - please! :-)
I have what I thought was a really simple problem. I have a raster image of
Help - please! :-)
I have what I thought was a really simple problem. I have a raster image of
satellite data from which I would like to extract an arbitrary (but simple
rectangular) portion for subsequent analysis (which I'll need to do for many
images). I have the data as a (projected)
On Wednesday 10 December 2008, Rob Robinson wrote:
Help - please! :-)
I have what I thought was a really simple problem. I have a raster image
of satellite data from which I would like to extract an arbitrary (but
simple rectangular) portion for subsequent analysis (which I'll need to do
for
-Original Message-
From: Edzer Pebesma [mailto:[EMAIL PROTECTED]
Sent: Fri 24/10/2008 5:24 PM
To: Hengl, T.
Cc: 'Pieter Beck'; r-sig-geo@stat.math.ethz.ch
Subject: Re: [R-sig-Geo] subsetting
Tomislav Hengl wrote:
In GIS terms, getting a raster from one grid topology to (any) other grid
topology
To: Hengl, T.
Cc: 'Pieter Beck'; r-sig-geo@stat.math.ethz.ch
Subject: Re: [R-sig-Geo] subsetting
Tomislav Hengl wrote:
In GIS terms, getting a raster from one grid topology to (any) other grid
topology (also subgrids) is referred to 'resampling' (I do not think that
this is yet implemented
hth,
Tom Hengl
http://spatial-analyst.net
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Pieter Beck
Sent: Thursday, October 23, 2008 9:15 PM
To: r-sig-geo@stat.math.ethz.ch
Subject: [R-sig-Geo] subsetting
Dear all,
I am a new user to the world
PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Pieter Beck
Sent: Thursday, October 23, 2008 9:15 PM
To: r-sig-geo@stat.math.ethz.ch
Subject: [R-sig-Geo] subsetting
Dear all,
I am a new user to the world of spatial applications of R and am wondering
about this trivial question:
What is the easiest
Pieter,
the easiest in terms of the least mental exercise might be to form a
polygon from the four points and then overlay that with the grid. This
will likely be too slow and/or memory intensive.
The more efficient way would be to compute the row and column index
ranges from the bounding box,
PROTECTED] On Behalf Of
Pieter Beck
Sent: Thursday, October 23, 2008 9:15 PM
To: r-sig-geo@stat.math.ethz.ch
Subject: [R-sig-Geo] subsetting
Dear all,
I am a new user to the world of spatial applications of R and am wondering
about this trivial question:
What is the easiest way to subset
-analyst.net
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Pieter Beck
Sent: Thursday, October 23, 2008 9:15 PM
To: r-sig-geo@stat.math.ethz.ch
Subject: [R-sig-Geo] subsetting
Dear all,
I am a new user to the world of spatial applications of R and am
Dear all,
I am a new user to the world of spatial applications of R and am wondering
about this trivial question:
What is the easiest way to subset a SpatialGridDataFrame, based on 4 corner
coordinates?
The reason I ask is that I want to do an overlay of a polygon file on a
large raster
Hi,
I've got this experimental function gridppp.
You have to especify the required lag of the
grid (i.e. the desired length of the x-side or
the y-side of each cell in the grid).
It gives you a list of point patterns of the required size.
Example of use:
data (lansing)
plot(lansing)
axis(1)
Hi,
I am currently using R 2.5.1 on a linux
operating system (I am connected to the linux system via remote desktop
connection). I am trying to estimate nuiscance parameters for a Geyer model
that will be fit to a spatial point process dataset with ~10,000 points.
However, R reaches its
Dear all,
I am very new to SIG.
This is probably a very simple question but I could not find an answer
searching the web and the R-SIG emails archive.
I have an ESRI shapefile with a coast and bathymetric lines. In the dbf
file I have a column “ELEVATION” that gives this information.
I import
That's really helpful, thanks.
For everyday use, I've made:
slotspol - function(pol, sl=ID)
sapply(slot(pol, polygons), function(x) slot(x, sl))
Which can be used for any slot name:
slotspol(Up)
slotspol(Up,area)
Also, few questions:
1. I observe that pols$Site is identical to [EMAIL
22 matches
Mail list logo