[R-sig-Geo] Coverting CRS in R to OSGB 1936
Rob Robinson
rob@rob|n@on @end|ng |rom bto@org
Tue Nov 29 19:17:02 CET 2022
Or use
?stars::st_transform
The EPSG for OSGB36 is 27700 (https://epsg.io/27700), so something like...
newraster <- st_transform(raster, CRS=27700)
should work, but you might also want to look at st_warp() if you need a
regular grid in your new (OS) raster
Cheers
Rob
*************** Learn about Britain's Birds at www.bto.org/birdfacts
******************
Dr Rob Robinson, Associate Director - Research (he/him)
Hon Reader: Univ East Anglia | Visiting Researcher: Swiss Ornithological
Institute
British Trust for Ornithology, The Nunnery, Thetford, Norfolk, IP24 2PU
Ph: +44 (0)1842 750050 T: @btorobrob
E: rob.robinson using bto.org W: www.bto.org/about-bto/our-staff/rob-robinson
======== "How can anyone be enlightened, when truth is so poorly lit"
========
On Tue, 29 Nov 2022 at 18:00, Alaba Boluwade <alaba.boluwade using mail.mcgill.ca>
wrote:
> Try:
>
> library(raster)
>
> new_raster<-spTransform(old_raster,CRS("+proj=longlat +ellps=airy
> +no_defs"))
>
> Good luck
> Alaba
>
> ________________________________
> From: R-sig-Geo <r-sig-geo-bounces using r-project.org> on behalf of Nick Wray <
> nickmwray using gmail.com>
> Sent: November 29, 2022 10:25 AM
> To: r-sig-geo using r-project.org <r-sig-geo using r-project.org>
> Subject: [R-sig-Geo] Coverting CRS in R to OSGB 1936
>
> Hello I have shapefile data (of the river Tweed catchment in N England
> and Scotland) which I have been able to plot precipitation and temperature
> data onto without too many problems. These data have the OSGB 1936/British
> National Grid CRS projection.
>
> But I now have a raster of land cover (from the Centre for Ecology and
> Hydrology) covering the catchment area which I want to incorporate into my
> processing. I have downloaded the raster into R and its properties are
>
> class : RasterLayer
> band : 1 (of 5 bands)
> dimensions : 4914, 8861, 43542954 (nrow, ncol, ncell)
> resolution : 25, 25 (x, y)
> extent : 261400, 482925, 576750, 699600 (xmin, xmax, ymin, ymax)
> crs : +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000
> +y_0=-100000 +ellps=airy +units=m +no_defs
> source : LCM.tif
> names : LCM
> values : 0, 255 (min, max)
>
> So it has a different CRS - my question is - how (in R) can I reset the
> raster CRS to be the same as my earlier data sets ie OSGB 1936 British
> National Grid? I haven't been able to find anything obvious on the net.
> Thanks Nick Wray
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
[[alternative HTML version deleted]]
More information about the R-sig-Geo
mailing list