Mathias Hauser

Results 218 comments of Mathias Hauser

Or `engine`? I am not sure if there is a difference in meaning?

Another option is to remove the keyword - users don't need to set it. However it is used for testing and in the docs. So there should be a possibility...

I could do it via `regionmask.set_options`: ```python with regionmask.set_options(backend="rasterio"): region.mask(lon, lat) ``` ```python with regionmask.set_options(engine="rasterio"): region.mask(lon, lat) ``` This would hide the keyword but still allow to select the backend.

Edit: from version 0.9 regionmask can take care of overlapping regions and should mask them automatically, if the regions are constructed with `overlap=True`. See the the [docs](https://regionmask.readthedocs.io/en/stable/notebooks/overlap.html) for details. ---...

I gave this a bit more thought. It would be possible to handle overlapping regions with (quite?) a bit of work. Of course this only works for `mask_3D` (because a...

I found https://stackoverflow.com/a/51509307/3010700: ```python import numpy as np def unpackbits(x, num_bits): if np.issubdtype(x.dtype, np.floating): raise ValueError("numpy data type needs to be int-like") shape = list(x.shape) x = x.reshape([-1, 1]) mask...

What I need to mention `rasterio.features.rasterize` seems to have quite some overhead - i.e. calling it twice is much slower than calling it once with two regions: ```python import regionmask...

I become more and more convinced that creating overlapping mask should be the default. The issue is that this does not work for 2D masks...

Currently I always create 2D masks and make them 3D if required. My initial idea here was to do 2D masks _or_ 3D masks if required. But the difficulty is...

Interesting - that would be kind of a 2D mask with an additional dim. Could be a bit difficult to understand if you don't know what's going on. Might still...