Skip to content

Commit

Permalink
use min_scalar_type in rasterize (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfleis authored Feb 6, 2025
1 parent 131e6cb commit f035e23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xvec/zonal.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _zonal_stats_rasterize(

transform = acc._obj.rio.transform()
length = len(geometry)
dtype = np.int16 if length < np.iinfo(np.int16).max else np.int32
dtype = np.min_scalar_type(length + 1)

labels = features.rasterize(
zip(geometry, range(length), strict=False),
Expand Down

0 comments on commit f035e23

Please sign in to comment.