Srtm prints NONE when finding elevations for locations with negative longitude or latitude values

123 views Asked by At

I am trying to use the srtm module in python to get elevation data for my thesis. I am reading the longitude and latitude values from an excel sheet.

But in situations where either the longitude or latitude of the date is negative srtm prints out "NONE".

I'll explain better showing the code I have written below

import openpyxl
import srtm
elevation_data = srtm.get_data()


fhred= openpyxl.load_workbook(r"/Users/username/Desktop/disso code/databases/fhred - future dams/zim.xlsx")
sheet =fhred["Sheet1"]


for rows in range(2, sheet.max_row+1):
    project_name = (sheet.cell(row=rows, column=2)).value
    latitudes = (sheet.cell(row=rows, column=8)).value
    longitudes = (sheet.cell(row=rows, column=9)).value
    elevation = elevation_data.get_elevation(latitudes, longitudes)
    print(f"{project_name} and elevation is {elevation}")

if for example, I get

elevation = elevation_data.get_elevation(-56.53541667, 94.02946500)

or

elevation_data.get_elevation(56.53541667, -94.02946500)

Python prints out "project_name" and elevation is NONE

But if i get

elevation = elevation_data.get_elevation(56.53541667, 94.02946500)

Python prints out "project_name" and elevation is 353

I have tried searching (56.53541667, -94.02946500) and (-56.53541667, 94.02946500) on google earth and both times I get the elevation

Please does anyone know how to resolve this

0

There are 0 answers