Skip to content

Commit b594b7f

Browse files
committed
Add test for geographic coords in dist_to_coast
1 parent 657b612 commit b594b7f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

climada/util/coordinates.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,8 @@ def dist_to_coast(coord_lat, lon=None, highres=False, signed=False):
541541
lat, lon = [np.asarray(v).reshape(-1) for v in [coord_lat, lon]]
542542
if lat.size != lon.size:
543543
raise ValueError(f'Mismatching input coordinates size: {lat.size} != {lon.size}')
544+
if not check_if_geo_coords(lat, lon):
545+
raise ValueError('Input lat and lon coordinates are not geographic.')
544546
return dist_to_coast_nasa(lat, lon, highres=highres, signed=signed)
545547

546548
def _get_dist_to_coast_nasa_tif():

0 commit comments

Comments
 (0)