An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20131125/2d2b57ec/attachment.pl>
grid overlay on polylines
10 messages · Robert J. Hijmans, Sarah Goslee, ldecola at comcast.net +1 more
Lee, What are you trying the accomplish with this "overlay"? If you want to do a spatial query (extract grid cell values covered by the line), you can use raster::extract. If you want to rasterize (create a raster where the cells covered by the line get a particular value), you can use raster::rasterize. Robert
On Mon, Nov 25, 2013 at 1:15 PM, <ldecola at comcast.net> wrote:
i'm trying to overlay a grid on a SpatialLines object but over() doesn't work, even if i load rgeos...
--------
library(sp)
library(rgeos)
# SPATIAL LINES OBJECT
tmp_sl <- SpatialLines(
list(
Lines(
list(
Line(matrix(c(0, 1, 1, 0, 0, 1), 3))
),
ID = 'a'
)
)
)
plot(tmp_sl, axes = T, col = 'red', lwd = 4)
# SPATIAL GRID TO COVER IT
res <- 2^-3
tmp_grd <- SpatialGrid(
GridTopology(
bbox(tmp_sl)[, 'min'],
rep(res, 2),
round(apply(bbox(tmp_sl), 1, diff) / res + 1)
)
)
plot(tmp_grd, add = T)
# DOESN'T WORK...
over(tmp_grd, tmp_sl)
# *** END ***
--------
Lee De Cola, PhD, MCP.
DATA to Insight
LDECOLA at COMCAST.NET
Reston, Virginia
703 709 6972
571 315 0577 mobile
[[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
1 day later
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20131127/a2f728e1/attachment.pl>
Where are you looking? Not, apparently, on CRAN: http://cran.r-project.org/web/packages/spatstat/index.html Sarah
On Wed, Nov 27, 2013 at 12:34 PM, <ldecola at comcast.net> wrote:
i don't see it among available packages to install...
Sarah Goslee http://www.functionaldiversity.org
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20131127/8d94089a/attachment.pl>
Is your version of R up-to-date? If not, that might explain absence of spatstat from list. Timothy G. Gregoire J. P. Weyerhaeuser Professor of Forest Management School of Forestry & Environmental Studies, Yale University 360 Prospect Street, New Haven, CT 06511-2104 U.S.A. office: 1.203.432.9398 mobile: 1.203.508.4014, fax: 1.203.432.3809 timothy.gregoire at yale.edu G&V sampling text: http://crcpress.com/product/isbn/9781584883708 -----Original Message----- From: r-sig-geo-bounces at r-project.org [mailto:r-sig-geo-bounces at r-project.org] On Behalf Of ldecola at comcast.net Sent: Wednesday, November 27, 2013 12:56 PM Cc: r-sig-geo Subject: Re: [R-sig-Geo] where's spatstat? i install packages on my windows7 pc by clicking packages > install and then i select a mirror site, which brings up a list of 100s of packages in alpha order, including SpatioTemporal followed by spBayes. Lee De Cola. ----- Original Message ----- From: "Sarah Goslee" <sarah.goslee at gmail.com> To: ldecola at comcast.net Cc: "r-sig-geo" <r-sig-geo at r-project.org> Sent: Wednesday, November 27, 2013 12:43:59 PM Subject: Re: [R-sig-Geo] where's spatstat? Where are you looking? Not, apparently, on CRAN: http://cran.r-project.org/web/packages/spatstat/index.html Sarah
On Wed, Nov 27, 2013 at 12:34 PM, <ldecola at comcast.net> wrote:
i don't see it among available packages to install...
Sarah Goslee http://www.functionaldiversity.org [[alternative HTML version deleted]] _______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
You can can download the Windows binary from the link I provided and use the install local packages option, or you can select a different mirror. You can also use the install.packages() command, and specify the package name and mirror. If your particular method and mirror are not working for you, there are a multitude of other options. But do note that the more information about OS, procedure, etc, you include in your initial query, the more helpful the answers are likely to be. "This does not work" is not a well-formed query. Sarah
On Wed, Nov 27, 2013 at 12:55 PM, <ldecola at comcast.net> wrote:
i install packages on my windows7 pc by clicking packages > install and then i select a mirror site, which brings up a list of 100s of packages in alpha order, including SpatioTemporal followed by spBayes. Lee De Cola. ----- Original Message ----- From: "Sarah Goslee" <sarah.goslee at gmail.com> To: ldecola at comcast.net Cc: "r-sig-geo" <r-sig-geo at r-project.org> Sent: Wednesday, November 27, 2013 12:43:59 PM Subject: Re: [R-sig-Geo] where's spatstat? Where are you looking? Not, apparently, on CRAN: http://cran.r-project.org/web/packages/spatstat/index.html Sarah On Wed, Nov 27, 2013 at 12:34 PM, <ldecola at comcast.net> wrote:
i don't see it among available packages to install...
Sarah Goslee http://www.functionaldiversity.org
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20131127/34fa2ec8/attachment.pl>
On Wed, Nov 27, 2013 at 1:12 PM, <ldecola at comcast.net> wrote:
i would not think the version would have anything to do with the packages available on the sites...anyway, here's what's reported at startup: -------- R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit)
http://cran.r-project.org/web/packages/spatstat/index.html Version: 1.34-1 Depends: R (? 3.0.2) You need to upgrade. Sarah
-------- Lee De Cola. ----- Original Message ----- From: "Timothy Gregoire" <timothy.gregoire at yale.edu> To: ldecola at comcast.net Cc: "r-sig-geo" <r-sig-geo at r-project.org> Sent: Wednesday, November 27, 2013 1:00:46 PM Subject: RE: [R-sig-Geo] where's spatstat? Is your version of R up-to-date? If not, that might explain absence of spatstat from list. Timothy G. Gregoire J. P. Weyerhaeuser Professor of Forest Management School of Forestry & Environmental Studies, Yale University 360 Prospect Street, New Haven, CT 06511-2104 U.S.A. office: 1.203.432.9398 mobile: 1.203.508.4014, fax: 1.203.432.3809 timothy.gregoire at yale.edu G&V sampling text: http://crcpress.com/product/isbn/9781584883708 -----Original Message----- From: r-sig-geo-bounces at r-project.org [mailto:r-sig-geo-bounces at r-project.org] On Behalf Of ldecola at comcast.net Sent: Wednesday, November 27, 2013 12:56 PM Cc: r-sig-geo Subject: Re: [R-sig-Geo] where's spatstat? i install packages on my windows7 pc by clicking packages > install and then i select a mirror site, which brings up a list of 100s of packages in alpha order, including SpatioTemporal followed by spBayes. Lee De Cola. ----- Original Message ----- From: "Sarah Goslee" <sarah.goslee at gmail.com> To: ldecola at comcast.net Cc: "r-sig-geo" <r-sig-geo at r-project.org> Sent: Wednesday, November 27, 2013 12:43:59 PM Subject: Re: [R-sig-Geo] where's spatstat? Where are you looking? Not, apparently, on CRAN: http://cran.r-project.org/web/packages/spatstat/index.html Sarah On Wed, Nov 27, 2013 at 12:34 PM, <ldecola at comcast.net> wrote:
i don't see it among available packages to install...
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20131127/c0e25e6c/attachment.pl>