Skip to content

Commit

Permalink
Update swmmanywhere/geospatial_operations.py
Browse files Browse the repository at this point in the history
Co-authored-by: Diego Alonso Álvarez <6095790+dalonsoa@users.noreply.github.com>
  • Loading branch information
barneydobson and dalonsoa authored Jan 25, 2024
1 parent 00c740b commit 4798c01
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions swmmanywhere/geospatial_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,25 +70,6 @@ def get_utm_crs(x: float,
)
return f"{utm_crs_list[0].auth_name}:{utm_crs_list[0].code}"

def get_utm_epsg(lon: float, lat: float) -> str:
"""Get the formatted UTM EPSG code for a given longitude and latitude.
Args:
lon (float): Longitude in EPSG:4326 (x)
lat (float): Latitude in EPSG:4326 (y)
Returns:
str: Formatted EPSG code for the UTM zone.
Example:
>>> get_utm_epsg(-0.1276, 51.5074)
'EPSG:32630'
"""
# Determine the UTM zone number
zone_number = int((lon + 180) / 6) + 1
# Determine the UTM EPSG code based on the hemisphere
utm_epsg = 32600 + zone_number if lat >= 0 else 32700 + zone_number
return 'EPSG:{0}'.format(utm_epsg)

def interp_wrap(xy: tuple[float,float],
interp: RegularGridInterpolator,
Expand Down

0 comments on commit 4798c01

Please sign in to comment.