Skip to content

Commit

Permalink
update transformation metadata when cropto used in read_geotif
Browse files Browse the repository at this point in the history
  • Loading branch information
HaleySchuhl committed Sep 20, 2024
1 parent 0648992 commit b878289
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plantcv/geospatial/read_geotif.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ def _read_geotif_and_shapefile(filename, cropto):
shapes = [mapping(convex_hull)]
# rasterio does the cropping within open
with rasterio.open(filename, 'r') as src:
img_data, _ = mask(src, shapes, crop=True)
img_data, trans_metadata = mask(src, shapes, crop=True)
metadata = src.meta.copy()
metadata.update({"transform": trans_metadata})
d_type = src.dtypes[0]

else:
Expand Down

0 comments on commit b878289

Please sign in to comment.