Skip to content

Commit

Permalink
fix lat lon cli
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshCu committed Aug 6, 2024
1 parent a1b2a8d commit d99c382
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions modules/ngiab_data_cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,13 @@ def read_waterbody_ids(input_file: Path) -> List[str]:
def get_wb_ids_from_lat_lon(input_file: Path) -> List[str]:
"""Read waterbody IDs from input file or return single ID."""
lat_lon_list = []
if "," in input_file.stem:
coords = input_file.stem.split(",")
lat_lon_list.append([float(coords[0]), float(coords[1])])
if "," in input_file.name:
coords = input_file.name.split(",")
lat_lon_list.append(
get_wbid_from_point({"lat": float(coords[0]), "lng": float(coords[1])})
)
return lat_lon_list

if not input_file.exists():
raise FileNotFoundError(f"The file {input_file} does not exist")

Expand Down

0 comments on commit d99c382

Please sign in to comment.