GlacioHack / geoutils

Analysis of georeferenced rasters and vectors
https://geoutils.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
82 stars 19 forks source link

Add `Raster.merge()` relying on `merge_rasters()`? #576

Closed rhugonnet closed 3 months ago

rhugonnet commented 3 months ago

Or should it be geoutils.merge_rasters()? To have the function accessible from the class object.

adehecq commented 3 months ago

I don't think it makes sense to have it as a method or Raster since it may involve more than 2 rasters.

You mean that within gu.raster.multiraster.merge_rasters it is not visible enough? I don't know if we should have all functions directly under the main name geoutils, or if we should try to split gu.raster.my_function and gu.vector.my_function etc? I think I would favor the latter to avoid having too many things under geoutils. Obviously, we could also move stack_rasters and load_multiple_rasters in the same location.

rhugonnet commented 3 months ago

All raster submodules function are already imported to raster, so all public functions should already be accessible with geoutils.raster.merge_rasters!

I wonder if it could be a class method that returns the object... Like from_array(). I guess there might be circular problems with this kind of behaviour. And GeoPandas do have it separately, so let's go for that!

We don't have good enough example data to show-case merging, so I can't document it yet.

rhugonnet commented 3 months ago

I guess I could create some artificial data based on the example... I'll try that.