Mathias Hauser

Results 175 comments of Mathias Hauser

## Proof of concept **Code** ```python import regionmask import shapely import xarray as xr def regions_contained(lon, lat, regions): # determine if the longitude needs to be wrapped regions_is_180 = regions.lon_180...

Thanks, per default it should use the newest version of rasterio, so most (new) users should automatically avoid this problem once the new rasterio version is out. If I understand...

https://github.com/perrygeo/python-rasterstats/pull/136

Subsample a regular grid cell ![DSC_0514](https://user-images.githubusercontent.com/10194086/73591396-712e8200-44ee-11ea-8fea-b66fcfbbf533.JPG)

Code to subsample and coarsen the grid: -> see updated code in https://github.com/regionmask/regionmask/issues/38#issuecomment-1244406912 below Example: ```python import numpy as np import xarray as xr import regionmask lon = np.arange(-180, 180,...

should be `mask_fraction` and not `mask_percentage`

Thanks that's really cool! I need to study it more to know if inclusion here makes sense. I would probably create a new mask "method" - e.g. `mask_3D_frac_exact` (and the...

Updated code: ```python def sample_coord(coord): # sample coords for the percentage overlap d_coord = coord[1] - coord[0] n_cells = len(coord) left = coord[0] - d_coord / 2 + d_coord /...

geopandas and cartopy (and thus fiona and gdal) are already required dependencies... This would kind of require a `to_geopandas` method (which is anyway a good idea #50). I haven't used...