Skip to content

Commit

Permalink
Merge pull request #682 from jpolchlo/fix/rasterio-1.0-support
Browse files Browse the repository at this point in the history
Allow gps.rasterio.get to run on Rasterio versions above 1.0
  • Loading branch information
Jacob Bouffard committed Oct 16, 2018
2 parents 6f617b7 + a75dda6 commit 575be04
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion geopyspark/geotrellis/rasterio.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ def _read_windows(uri, xcols, ycols, bands, crs_to_proj4):
bounds = dataset.bounds
height = dataset.height
width = dataset.width
proj4 = crs_to_proj4(dataset.get_crs())
if rasterio.__version__ >= '1.0':
proj4 = crs_to_proj4(dataset.crs)
else:
proj4 = crs_to_proj4(dataset.get_crs())
nodata = dataset.nodata
tile_cols = (int)(math.ceil(width/xcols)) * xcols
tile_rows = (int)(math.ceil(height/ycols)) * ycols
Expand Down

0 comments on commit 575be04

Please sign in to comment.