Skip to content

Commit

Permalink
Fix band_num var and add import for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sgoodm committed Mar 21, 2017
1 parent 9896562 commit 5ffce1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rasterstats/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ def gen_zonal_stats(
warnings.warn("Use `geojson_out` to preserve feature properties",
DeprecationWarning)

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

Expand Down
1 change: 1 addition & 0 deletions tests/test_zonal.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from rasterstats import zonal_stats, raster_stats
from rasterstats.utils import VALID_STATS
from rasterstats.io import read_featurecollection, read_features
from shapely.geometry import Polygon

sys.path.append(os.path.dirname(os.path.abspath(__file__)))

Expand Down

0 comments on commit 5ffce1a

Please sign in to comment.