Skip to content

Commit

Permalink
Merge pull request #131 from sgoodm/band_alias
Browse files Browse the repository at this point in the history
Add 'band_num' alias for 'band' for backwards compatibility.
  • Loading branch information
perrygeo committed Sep 20, 2016
2 parents 84e56a9 + d1c0c31 commit 91dba2e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/rasterstats/main.py
Expand Up @@ -130,6 +130,11 @@ def gen_zonal_stats(
warnings.warn("Use `geojson_out` to preserve feature properties",
DeprecationWarning)

bn = kwargs.get('band_num')
if bn:
warnings.warn("Use `band` to specify band number", DeprecationWarning)
band = band_num

with Raster(raster, affine, nodata, band) as rast:
features_iter = read_features(vectors, layer)
for _, feat in enumerate(features_iter):
Expand Down

0 comments on commit 91dba2e

Please sign in to comment.