algo
This commit is contained in:
@@ -100,9 +100,11 @@ def get_elevation_from_oe(coordinates): # v1 deepseek
|
||||
|
||||
return points
|
||||
|
||||
|
||||
def getElevationFromOE(coordinates):
|
||||
"""Obtiene elevaciones de Open-Elevation API y devuelve vectores FreeCAD en coordenadas UTM."""
|
||||
|
||||
import certifi
|
||||
from requests.exceptions import RequestException
|
||||
if len(coordinates) == 0:
|
||||
return None
|
||||
@@ -110,15 +112,15 @@ def getElevationFromOE(coordinates):
|
||||
from requests import get
|
||||
import utm
|
||||
|
||||
str=""
|
||||
locations_str=""
|
||||
total = len(coordinates) - 1
|
||||
for i, point in enumerate(coordinates):
|
||||
str += '{:.6f},{:.6f}'.format(point[0], point[1])
|
||||
locations_str += '{:.6f},{:.6f}'.format(point[0], point[1])
|
||||
if i != total:
|
||||
str += '|'
|
||||
query = 'https://api.open-elevation.com/api/v1/lookup?locations=' + str
|
||||
locations_str += '|'
|
||||
query = 'https://api.open-elevation.com/api/v1/lookup?locations=' + locations_str
|
||||
try:
|
||||
r = get(query, timeout=20, verify=False)
|
||||
r = get(query, timeout=20, verify=certifi.where()) # <-- Corrección aquí
|
||||
except RequestException as e:
|
||||
points = []
|
||||
for i, point in enumerate(coordinates):
|
||||
|
||||
Reference in New Issue
Block a user