Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Below I have modified PaulG's outstanding answer to display a latitude-longitude grid. The grid is coarser than I would like, but might be adequate. I use the United Kingdom with the code below. I do not know how to include the result in this post.</p> <pre><code>library(rgdal) library(raster) # define extent of map area mapExtent &lt;- rbind(c(0, 62), c(5, 45)) # BNG is British National Grid newProj &lt;- CRS("+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.999601271625 +x_0=400000 +y_0=-100000 +ellps=airy +units=m +no_defs") mapExtentPr &lt;- spTransform(SpatialPoints(mapExtent, proj4string=CRS("+proj=longlat")), newProj) # provide a valid 3 letter ISO country code # obtain a list with: getData("ISO3") uk0 &lt;- getData('GADM', country="GBR", level=0) # UK uk1 &lt;- getData('GADM', country="GBR", level=1) # UK countries uk2 &lt;- getData('GADM', country="GBR", level=2) # UK counties # United Kingdom projection uk1Pr &lt;- spTransform(uk1, newProj) # latitude-longitude grid projection grd.LL &lt;- gridlines(uk1, ndiscr=100) lat.longPR &lt;- spTransform(grd.LL, newProj) # latitude-longitude text projection grdtxt_LL &lt;- gridat(uk1) grdtxtPR &lt;- spTransform(grdtxt_LL, newProj) # plot the map, lat-long grid and grid labels plot(mapExtentPr, pch=NA) plot(uk1Pr, border="white", col="lightgrey", add=TRUE) plot(lat.longPR, col="black", add=TRUE) text(coordinates(grdtxtPR), labels=parse(text=as.character(grdtxtPR$labels))) </code></pre> <p>Result looks like: </p> <p><img src="https://i.stack.imgur.com/PvDEV.png" alt="enter image description here"></p>
    singulars
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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