-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
add single netCDF layer to map #285
Comments
Good suggestion. I think it is possible to implement this feature, but it might a while. The upstream |
Is it possible to add a |
I don't think so. |
I am prototyping a function to read variables from a netCDF file and add them as an ee.Image. So far, I used the netcdf4 library to read one variable (e.g. u_wind in the wind-global.nc) and then If I shift the data so that it goes from lon=-180 to 180, then it works: Any suggestions on the desired functionality? I envision having a list of variables to read so that we can add them to the ee.Image as different bands. At the moment, I would suggest focusing on reading a file with one time slice only, and then we can build on that to read multiple time slices and create an image collection. Do you suggest using netCDF4? xarray, gdal, or others? Other suggestions? |
Hi Oliver --- I like your method. Would you mind sharing a notebook and maybe sample data? Your second graphic has a nice palette and I would like to replicate. I would expect -180 to 180 for lines of longitude, and -90 to 90 for lines of latitude. I guess you could consider opening the .nc file with xarray and then calling it from numpy. As I'm sure you're aware, the more packages you add, the greater the potential computing slowdown. Albert |
@lopezvoliver The prototype looks nice!! I would suggest using xarray. Keep in mind that xarray is not an official dependency of geemap yet. We need more testing to make sure that geemap can be installed smoothly across platforms before including a new dependency. For the time being, you can use One thing I am not sure about is the size limit of a numpy array that can be converted to ee.Image on-the-fly. From geojson to ee.FeatureCollection, the size limit is ~4 MB. Ideally, I would envision the functionality being split into two functions, e.g., You don't have to implement this kind of |
@albertlarson I believe the sample data is from https://github.com/giswqs/geemap/blob/master/examples/data/wind-global.nc For palette and colormaps, you can take a look at #302 |
@albertlarson You can check a preview of the new function here. The palette I used was "YlOrRd". Hopefully you can test it soon with your dataset. @giswqs I agree, I think this will be useful mainly for large-scale datasets (e.g. half-degree or coarser resolution). |
This feature has been implemented. See notebook example https://geemap.org/notebooks/68_netcdf_to_ee. A big thank you to @lopezvoliver for making this happen! |
I saw the notebook where you implemented the ipyleaflet's Velocity code utilizing a .nc file. Is it possible to extend the functionality of geemap / ipyleaflet to enable the ability to simply display an .nc file as a layer?
Here is a link to some .nc files as an example:
https://opendap.jpl.nasa.gov/opendap/OceanTemperature/amsre/L3/sst_1deg_1mo/contents.html
cc: @davidbrochart from xarray-leaflet
The text was updated successfully, but these errors were encountered: