model.util.geometry =================== .. py:module:: model.util.geometry Attributes ---------- .. autoapisummary:: model.util.geometry.cache_dir model.util.geometry.cache_file model.util.geometry.store model.util.geometry.HTTP_TIMEOUT_SECONDS Functions --------- .. autoapisummary:: model.util.geometry.get_altitude_openelevation model.util.geometry.get_altitude_google model.util.geometry.get_altitude model.util.geometry.geometry_has_z Module Contents --------------- .. py:data:: cache_dir .. py:data:: cache_file .. py:data:: store .. py:data:: HTTP_TIMEOUT_SECONDS :value: 10 .. py:function:: get_altitude_openelevation(latlon) Get altitude information for a given latitude and longitude from an OpenElevation server. Requires the ``OPENELEVATION_URL`` environment variable to be set. .. py:function:: get_altitude_google(latlon) Get altitude information for a given latitude and longitude from the Google Maps Elevation API. Requires the ``GOOGLE_MAPS_API_KEY`` environment variable to be set. .. py:function:: get_altitude(latlon) Get altitude information for a given latitude and longitude. Tries OpenElevation first, then falls back to Google Maps. Results are cached on disk (rounded to 4 decimal places, ~11m resolution) via ``kv_cache``. Set ``ELEVATION_DUMMY_MODE=True`` to return a constant dummy altitude. .. py:function:: geometry_has_z() Check whether the geometry types of Station, Route and AssocRouteStation have Z coordinates. :return: True if they have Z coordinates, False otherwise