Skip to content

Commit 29deeee

Browse files
committed
fix rasterio index issue; better fix
1 parent 23b9eef commit 29deeee

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

server/guppy/endpoints/endpoint_utils.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,7 @@ def sample_coordinates_window(coords_dict, layer_models, bounds, round_val=None)
249249
coords.extend(v)
250250
with rasterio.open(path) as src:
251251
geometry_window = from_bounds(bounds[0], bounds[1], bounds[2], bounds[3], src.transform).round_offsets()
252-
rows = []
253-
cols = []
254-
for x, y in zip([p[0] for p in coords], [p[1] for p in coords]):
255-
row, col = src.index(x, y)
256-
rows.append(row)
257-
cols.append(col)
252+
rows, cols = src.rowcol([p[0] for p in coords], [p[1] for p in coords])
258253
cols = [c - geometry_window.col_off for c in cols]
259254
rows = [r - geometry_window.row_off for r in rows]
260255
in_rows = []

0 commit comments

Comments
 (0)