xarray-contrib / xarray_leaflet

An xarray extension for tiled map plotting.
https://xarray-leaflet.readthedocs.io
MIT License
163 stars 21 forks source link

Default CRS and nodata #35

Open davidbrochart opened 3 years ago

davidbrochart commented 3 years ago

When a DataArray is passed without any CRS, we could assume that it is WGS 84 and write it automatically. Same for nodata, we could assume it's np.nan (if the type of the data is floating-point):

da = da.rio.write_crs(4326)  # WGS 84
da = da.rio.write_nodata(np.nan)

See #34