Skip to content

Commit

Permalink
Fix AWS DEM tiles requests for negative lat/lon
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyPechnikov committed Feb 25, 2024
1 parent 56d5f23 commit a69667f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pygmtsar/pygmtsar/AWS.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def download_dem(self, geometry, filename=None, n_jobs=-1, product='1s', skip_ex
def job_tile(product, lon, lat):
base_url = self.base_url.format(resolution=30 if product=='1s' else 90)
tile_id = self.tile_id.format(product1=int(product[0]),
SN2=f'{"S" if lat<0 else "N"}{lat:02}',
WE3=f'{"W" if lon<0 else "E"}{lon:03}')
SN2=f'{"S" if lat<0 else "N"}{abs(lat):02}',
WE3=f'{"W" if lon<0 else "E"}{abs(lon):03}')
url = f'{base_url}/{tile_id}/{tile_id}.tif'
response = requests.get(url)
#response.raise_for_status()
Expand Down

0 comments on commit a69667f

Please sign in to comment.