[R-sig-Geo] Converting shapefile from gridded to lat/ lng

Pascal Oettli kridox at ymail.com
Mon Jan 20 09:10:43 CET 2014


Hello,

Maybe something like that:


library(sp)
library(maptools)
library(rgdal)

crs.ll <- "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0"
crs.tmerc <- "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717
+x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs"

authoritiesMap.TMERC <- readShapePoly("LAD_Pop_EngWales2011",
proj4string=CRS(crs.tmerc))
authoritiesMap.LL <- spTransform(authoritiesMap.TMERC, CRS(crs.ll))

par(mfrow=c(1,2), las=1)
plot(authoritiesMap.TMERC)
axis(1)
axis(2)
title(main="Transverse Mercator")
plot(authoritiesMap.LL)
axis(1)
axis(2)
title(main="LongLat")


HTH,
Pascal

On 20 January 2014 16:41, Steve Pickering
<pickering at penguin.kobe-u.ac.jp> wrote:
> Apologies if this seems a trivial one, but I know I'm missing something.
>
> I am working with a shapefile of local authorities in England and
> Wales (available here:
> http://www.sharegeo.ac.uk/download/10672/330/Local%20Authority%20District%20Population%20for%20England%20and%20Wales%20-%20Census%202011.zip
> )
>
> The shapefile is in a gridded format, but I need to convert to a
> conventional lat/ lng coordinates format, and then plot in the usual
> way.
>
> Can you help?  Many thanks!
>
> library(sp)
> library(maptools)
> authoritiesMap = readShapePoly("LAD_Pop_EngWales2011")
> plot(authoritiesMap)
>
>  - Steve.
>
> Steve Pickering
> Assistant Professor
> Kobe University
> 2-1 Rokkodai-cho
> Nada-ku, Kobe
> 657-8501 Japan
> pickering at penguin.kobe-u.ac.jp
> http://www.stevepickering.net
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan



More information about the R-sig-Geo mailing list