Skip to content

Commit

Permalink
add null crs case
Browse files Browse the repository at this point in the history
  • Loading branch information
Fanchengyan committed Aug 13, 2023
1 parent 53b7cbe commit 06aaf06
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions GeoSAM-Image-Encoder/geosam/image_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,16 @@ def encode_image(
extent = [i for i in src.bounds]
extent_crs = src.crs
else:
extent_crs = CRS.from_user_input(
extent.split(' ')[-1].strip()[1:-1]
)
extent_crs = extent.split(' ')[-1].strip()[1:-1].strip()
extent = [float(i.strip(',').strip())
for i in extent.split(' ')[:-1]]
extent = warp.transform_bounds(
extent_crs,
src.crs,
*extent,
)
if extent_crs != '':
extent_crs = CRS.from_user_input(extent_crs)
extent = warp.transform_bounds(
extent_crs,
src.crs,
*extent,
)

# check bands
if bands is None:
Expand Down

0 comments on commit 06aaf06

Please sign in to comment.