Skip to content

Commit

Permalink
Merge pull request #213 from yyu1/optimization
Browse files Browse the repository at this point in the history
Do not create array with ones, and then multiply value by nodata.  In…
  • Loading branch information
perrygeo committed Feb 29, 2020
2 parents f967c1d + a913471 commit 853a0c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rasterstats/io.py
Expand Up @@ -183,7 +183,8 @@ def boundless_array(arr, window, nodata, masked=False):
window_shape = (wr_stop - wr_start, wc_stop - wc_start)

# create an array of nodata values
out = np.ones(shape=window_shape) * nodata
out = np.empty(shape=window_shape)
out[:] = nodata

# Fill with data where overlapping
nr_start = olr_start - wr_start
Expand Down

0 comments on commit 853a0c3

Please sign in to comment.