0

I would like to project one raster onto another and while doing so I think the values are changing their position "to the north".

Is this an expected behavior?

I was hoping to create a longlat raster to use it for lookups and GeoJSON generation.

Strangely (or maybe expected, I don't know) resulting GeoJSON positions are shifted (what feels like 10km) to the north.

Do I have a logical mistake somewhere?

This is an example:

x <- raster(ncol=900, nrow=900)
x_proj <- "+proj=stere +lat_0=90 +lat_ts=90 +lon_0=10 +k=0.93301270189 +x_0=0 +y_0=0 +a=6378137 +b=6356752.3142451802 +to_meter=1000 +no_defs "
proj <- CRS(x_proj)
extent(x) <- extent(-523.4622, 376.5378, -4658.645, -3758.645)
projection(x) <- x_proj
x[seq(450,455),seq(1,900)]<-1

new_raster<-raster(ncols=900,nrows=900)
new_raster_crs<- "+proj=longlat +datum=WGS84 +zone=34 +no_defs +ellps=WGS84"
new_raster_proj <- CRS(new_raster_crs)
extent(new_raster) <- extent(3.5889,14.6209, 47.0705, 54.7405)
projection(new_raster) <- new_raster_proj
new_raster<-projectRaster(x,new_raster,method = "bilinear")

Plot of raster x

Plot of Raster x

Plot of Raster new_raster

Plot of Raster new_raster

Is there something I could to with source/dest raster to create a "true" longlat lookup / GeoJSON possibility?

Is there a mistake somewhere ?

Can i maybe change +y_0=0 value to correct this?

If thats the case how can I get the exact value of shift?

Currently I only see the change visually.

2
  • 1
    Lines of latitude aren't horizontal in the stereographic projection, if that helps. The shortest distance between two points at the same latitude always "pulls" to the nearest pole, north or south (great circle) Jun 24, 2022 at 15:10
  • 1
    See: stackoverflow.com/a/72745206/635245 Jun 24, 2022 at 15:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.