Help: assign crs to RasterBrick

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Help: assign crs to RasterBrick

J Rojo
Hello everyone
I have a flipped RasterBrick without crs assigned (crs = NA):
plot(a[[100]]
I would like to fill the map and assign the correct coordinate systems, that it has been said to me to be specifically:

"+init=EPSG:3034 +proj=lcc +lat_1=35 +lat_2=65 +lat_0=50 +lon_0=10 +x_0=4000000 +y_0=2800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs”

I try to solve with the next commands for the raster library:

In a first step I have flipped the map, and it has been right with:

a <- t(flip(a, direction='y' ))

But I have problems with the assignments of the suitable crs.

crs(a) <- "+init=EPSG:3034 +proj=lcc +lat_1=35 +lat_2=65 +lat_0=50 +lon_0=10 +x_0=4000000 +y_0=2800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs”

Because although the map assigns crs = “+init = EPSG:3034”, the map doesn’t seem georreferenced, because the starting point of the map is (0,0). My final objective is  to transform the crs to "+proj=longlat +datum=WGS84”

A <- projectRaster(a, crs = "+proj=longlat +datum=WGS84")
I will be grateful some kind of help. Do I need more additional information? Any step is wrong?
Thank you so much
Jesús Rojo

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Help: assign crs to RasterBrick

J Rojo

> Hello everyone
> I have a flipped RasterBrick without crs assigned (crs = NA):
> plot(a[[100]]
> <PastedGraphic-2.tiff>
> I would like to fill the map and assign the correct coordinate systems, that it has been said to me to be specifically:
>
> "+init=EPSG:3034 +proj=lcc +lat_1=35 +lat_2=65 +lat_0=50 +lon_0=10 +x_0=4000000 +y_0=2800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs”
>
> I try to solve with the next commands for the raster library:
>
> In a first step I have flipped the map, and it has been right with:
>
> a <- t(flip(a, direction='y' ))
>
> But I have problems with the assignments of the suitable crs.
>
> crs(a) <- "+init=EPSG:3034 +proj=lcc +lat_1=35 +lat_2=65 +lat_0=50 +lon_0=10 +x_0=4000000 +y_0=2800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs”
>
> Because although the map assigns crs = “+init = EPSG:3034”, the map doesn’t seem georreferenced, because the starting point of the map is (0,0). My final objective is  to transform the crs to "+proj=longlat +datum=WGS84”
>
> A <- projectRaster(a, crs = "+proj=longlat +datum=WGS84")
> <PastedGraphic-1.tiff>
> I will be grateful some kind of help. Do I need more additional information? Any step is wrong?
> Thank you so much
> Jesús Rojo

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Help: assign crs to RasterBrick

Michael Sumner-2
In reply to this post by J Rojo
You need to also setExtent() of the raster. That's the coordinates that the crs refers to xmin,xmax,ymin,ymax values in metres. Sometimes visual cues can be used to derive these from an image, sometimes the grid is a commonly used convention (a certain dimension, I.e. extent +resolution in a region). It really needs the file source itself or some info from the provider where the data was already a map.

Not much can be done from a picture alone though. 

I'll have a look around sometimes wild guesses work because projection-use is rarely bespoke.

Best 




On Mon., 27 Apr. 2020, 01:21 Jesús Rojo, <[hidden email]> wrote:
Hello everyone
I have a flipped RasterBrick without crs assigned (crs = NA):
plot(a[[100]]
I would like to fill the map and assign the correct coordinate systems, that it has been said to me to be specifically:

"+init=EPSG:3034 +proj=lcc +lat_1=35 +lat_2=65 +lat_0=50 +lon_0=10 +x_0=4000000 +y_0=2800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs”

I try to solve with the next commands for the raster library:

In a first step I have flipped the map, and it has been right with:

a <- t(flip(a, direction='y' ))

But I have problems with the assignments of the suitable crs.

crs(a) <- "+init=EPSG:3034 +proj=lcc +lat_1=35 +lat_2=65 +lat_0=50 +lon_0=10 +x_0=4000000 +y_0=2800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs”

Because although the map assigns crs = “+init = EPSG:3034”, the map doesn’t seem georreferenced, because the starting point of the map is (0,0). My final objective is  to transform the crs to "+proj=longlat +datum=WGS84”

A <- projectRaster(a, crs = "+proj=longlat +datum=WGS84")
I will be grateful some kind of help. Do I need more additional information? Any step is wrong?
Thank you so much
Jesús Rojo
_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

PastedGraphic-2.tiff (20K) Download Attachment
PastedGraphic-1.tiff (20K) Download Attachment