Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plot orientation with positive-y (note, for discussion) #547

Open
mdsumner opened this issue Oct 17, 2024 · 1 comment
Open

plot orientation with positive-y (note, for discussion) #547

mdsumner opened this issue Oct 17, 2024 · 1 comment

Comments

@mdsumner
Copy link
Collaborator

mdsumner commented Oct 17, 2024

this had me going for a while, read the raster here when it is created by gdalmdimtranslate:

OSGeo/gdal#11041

#gdalmdimtranslate -of ZARR in.nc out-gdal.zarr 
## gdalinfo ZARR:"out-gdal.zarr":/air_temperature_2m
library(gdalraster)
ds <- new(GDALRaster, "ZARR:"out-gdal.zarr":/air_temperature_2m")
plot_raster(ds)

image

Essentially $bbox() is (xmin, ymax, xmax, ymin) and this controls the plot orientation.

It presents genuinely "upside down", because the R plot axis is inverted. (The contours are me adding a terra version of elevation to the map, which also surprisingly adds to the plot correctly - I guess because rasterImage() and plot() generally allows inversion ...)

I'm not saying this is a problem ... just wanted to share it, because maybe we want different behaviour for positive-y cases.

@ctoney
Copy link
Collaborator

ctoney commented Oct 17, 2024

Thanks for the description of this.

maybe we want different behaviour for positive-y cases

Ideally display should do what QGIS does. However, gdalraster currently implements the GDAL raster data model and does not yet implement the multidimensional raster data model. So I'm unsure if/how this should be handled at the moment. We get the correct plot orientation and bbox on the netCDF "classic raster" as expected (i.e., with ds <- new(GDALRaster, 'NETCDF:"in.nc":air_temperature_2m')).

Support for multidim raster should be added eventually. Please let me know if you have other suggestions for the meantime though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants