Skip to content

Help: assign crs to RasterBrick

3 messages · Jesús Rojo, Michael Sumner

#
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20200426/58ab109b/attachment.html>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-2.tiff
Type: image/tiff
Size: 15216 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20200426/58ab109b/attachment.tiff>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-1.tiff
Type: image/tiff
Size: 15528 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20200426/58ab109b/attachment-0001.tiff>
3 days later
#
#
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, <jru85yebe at hotmail.com> wrote:

            
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20200430/53c42adb/attachment.html>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-2.tiff
Type: image/tiff
Size: 15216 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20200430/53c42adb/attachment.tiff>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-1.tiff
Type: image/tiff
Size: 15528 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20200430/53c42adb/attachment-0001.tiff>