Note that there are some explanatory texts on larger screens.

plurals
  1. POPlotting results of geographical analysis within shapefiles onto Google map tiles
    primarykey
    data
    text
    <p>I have performed a geographical analysis </p> <pre><code>library(PBSmapping); library(RgoogleMaps); library(maptools) cases&lt;-read.table("cases.csv") cases.ppp&lt;-ppp(cases@coords[,1], cases@coords[,2], unitname=c("km")) dens.cas &lt;- density.ppp(cases.ppp, bw) plot(dens.cas) </code></pre> <p>yielding the following image:</p> <p><img src="https://i.stack.imgur.com/gAWLm.png" alt="enter image description here"></p> <p>I would like to overlay this on some google map tiles, and I have been able to tell R to fetch the appropriate tile, as below:</p> <pre><code>shp &lt;- importShapefile('map.shp', projection="LL"); bb &lt;- qbbox(lat = shp[,"Y"], lon = shp[,"X"]); MyMap &lt;- GetMap.bbox(bb$lonR, bb$latR, destfile = "map.jpg"); </code></pre> <p><img src="https://i.stack.imgur.com/qUtwc.png" alt="enter image description here"></p> <p>However, I can't seem to find any solutions for laying the results of the analysis over the map tile. I know it is possible to overlay the shapefile using this solution:</p> <p><a href="https://stackoverflow.com/a/2105912/1540735">https://stackoverflow.com/a/2105912/1540735</a></p> <p>This does work, and is perfectly aligned in terms of geolocation (as below), but I lose the results of the analysis:</p> <pre><code>PlotPolysOnStaticMap(MyMap, shp, lwd=.5, col = rgb(1,1,1,0.2), add = F) </code></pre> <p><img src="https://i.stack.imgur.com/Db4qG.jpg" alt="enter image description here"></p> <p>Does anyone know how to overlay these? The numerical values that give rise to the colours are stored in dens.cas$v, and are stored as a 128*128 matrix, as far as I can tell.</p> <p>Many thanks to anyone who can help</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload