Gabriele Cozzi | 28 Jun 2012 12:32
Picon

SpatialPoints, SpatialGrid and related terminology

Dear list,
apologize for the unusual question.  I am new and I have some problems with
some of the terminology.
I had my codes running but only after trial and error rather than with a
full understanding of what is what and this does not entirely satisfy me.

I have a data frame (call it grid1) containing X, Y coordinates along with
other variables
Locations are spaced 500 m apart on on a grid. Here an example with random
data:

##-------------
X1 <- rep(seq(0,20000, by=500)
          , each=45)
Y1 <- rep(seq(0,20000, by=500)
          , 45)
grid1 <- data.frame(X1,Y1,
                    value=rep("val", length(X1)))
plot(grid1$X1,grid1$Y1, cex=0.1)
##--------------

I want to extract from grid 1 only those locations, and relative values,
that are spaced 2500 m apart, so basically those locations that overlap
with a second data frame (call it grid2). In other words those locations
where dots overlap with circles (cfr. the plot in the codes below)

##--------------
X2 <- rep(seq(0,20000, by=2500)
         , each=9)
Y2 <- rep(seq(0,20000, by=2500)
(Continue reading)

Tom Gottfried | 28 Jun 2012 13:52
Picon

Re: SpatialPoints, SpatialGrid and related terminology

Gabriele,

it would be surely very useful for you to read the ASDAR-book:

Bivand, Roger S., Edzer J. Pebesma, und Virgilio Gómez-Rubio. Applied 
spatial data analysis with R. Use R! New York: Springer, 2008. 
http://www.asdar-book.org/; 
http://www.springerlink.com/content/978-0-387-78170-9.

Besides this, your approach with using over on point data seems the way 
you have to go. In grid cells with a size of 2500 m over would find more 
than one point from your finer grid.

HTH,
Tom

Am 28.06.2012 12:32, schrieb Gabriele Cozzi:
> Dear list,
> apologize for the unusual question.  I am new and I have some problems with
> some of the terminology.
> I had my codes running but only after trial and error rather than with a
> full understanding of what is what and this does not entirely satisfy me.
>
> I have a data frame (call it grid1) containing X, Y coordinates along with
> other variables
> Locations are spaced 500 m apart on on a grid. Here an example with random
> data:
>
> ##-------------
> X1<- rep(seq(0,20000, by=500)
(Continue reading)

Giuseppe Calamita | 3 Jul 2012 10:58
Picon
Favicon

Re: SpatialPoints, SpatialGrid and related terminology

Ciao Gabriele,
you can find a shorter yet very useful descriptions of how spatial classes
work in one of the vignettes of the sp-package.

To visualize that, simply write on R terminal 
> vignette("intro_sp") 
this will open a pdf. 
You can also download it directly from
http://cran.r-project.org/web/packages/sp/vignettes/intro_sp.pdf

If you use 
> vignette(package= "sp") 
you'll see all the available vignette in that package, whereas if you use 
> vignette()
you'll see ALL the available vignette in all the installed package (this may
take a long time).

Hope this helps
Giuseppe

-----
Giusepep Calamita
PhD italian National Council of Research - Institute of Methodologies for Environmental Research CNR - IMAA
85050 Tito Scalo - Potenza - Italy 

--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/SpatialPoints-SpatialGrid-and-related-terminology-tp7580355p7580375.html
Sent from the R-sig-geo mailing list archive at Nabble.com.

Gmane