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

reproject grid data for rasterio / gdal #230

Open
vodp opened this issue Mar 7, 2023 · 3 comments
Open

reproject grid data for rasterio / gdal #230

vodp opened this issue Mar 7, 2023 · 3 comments

Comments

@vodp
Copy link

vodp commented Mar 7, 2023

I find salem super helpful to deal with .nc files. My tasks however somtimes involves with reprojecting nc gridded data to be used with rasterio and visualizing on top of Google Maps. I find that merely setting crs to epsg:4326 is not correct to show nc data. For example in the following data of global soil moisture product, overlaying on top of Esri map gives incorrect results:
image

but with the internal quick_map of salem, the country boundaries are correctly visualized:

image

I am wondering is there a mechanism to help project the grid data so that it can be conveniently used with Transform matrix, and Crs as like rasterio or Gdal ?

@fmaussion
Copy link
Owner

I'm sorry I can't help you there. You should have a look at https://corteva.github.io/rioxarray though, this is much better than salem!

@vodp
Copy link
Author

vodp commented Mar 8, 2023

Thanks. Because the source netcdf lacks some georeference data, rioxarray is quite not useful for my problem. I find salem's subset and roi could be the workaround for this particular case.

Can you help explaining why country boundaries are not drawn for America as in the figure above?

@fmaussion
Copy link
Owner

Yes Sorry Salem does not support 0-360 grids. I recommend to shift your dataset to -180 > 180 (using xarray .roll), or use cartopy for plotting. If Salem can read it, your dataset is probably a straightforward plate carree projection

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