Enhancer Reference
OpenTopoElevationEnhancer(url='https://api.opentopodata.org/', dataset='eudem25m', interpolation='cubic', skip_checks=False)
Bases: ElevationEnhancer
Use the/a OpenTopoData API (https://opentopodata.org) to enhance a GPX track with elevation information.
Setup the enhancer via a opentopodata rest api.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url
|
str
|
REST api entrypoint url, defaults to "https://api.opentopodata.org/" |
'https://api.opentopodata.org/'
|
dataset
|
str
|
Dataset of elevation data , defaults to "eudem25m" |
'eudem25m'
|
interpolation
|
str
|
Interpolation method, defaults to "cubic" |
'cubic'
|
skip_checks
|
bool
|
If true, health checks will be skipped on initialization, defaults to False |
False
|
Raises:
Type | Description |
---|---|
APIHealthCheckFailedError
|
If connection can not established |
APIHealthCheckFailedError
|
Any other error on health check |
APIDataNotAvailableError
|
Dataset is not available at the endpoint |
Source code in geo_track_analyzer/enhancer.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|
enhance_track(track, inplace=False)
Main method to enhance a passed GPX track with elevation information
Parameters:
Name | Type | Description | Default |
---|---|---|---|
track
|
GPXTrack
|
Track to be enhanced. |
required |
Returns:
Type | Description |
---|---|
GPXTrack
|
The enhanced track |
Source code in geo_track_analyzer/enhancer.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
get_elevation_data(input_coordinates, split_requests=None)
Send a post request to the api endoint to query elevation data for the passed input coordinates
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_coordinates
|
list[tuple[float, float]]
|
list of latitude, longitude tuples for which the elevation should be determined. |
required |
split_requests
|
None | int
|
Optionally split request into multiple requires to get around size restrictions, defaults to None |
None
|
Returns:
Type | Description |
---|---|
list[float]
|
A list of Elevations for the passed coordinates. |
Raises:
Type | Description |
---|---|
APIResponseError
|
Any none 200 response form the endpoint |
Source code in geo_track_analyzer/enhancer.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
|
OpenElevationEnhancer(url='https://api.open-elevation.com')
Bases: ElevationEnhancer
Use the/a OpenElevation API (https://open-elevation.com) to enhance a GPX track with elevation information.
Setup the enhancer via the url of the rest api of open-elevation
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url
|
str
|
URL of the API gateway |
'https://api.open-elevation.com'
|
Source code in geo_track_analyzer/enhancer.py
176 177 178 179 180 181 182 183 184 185 186 |
|
enhance_track(track, inplace=False)
Main method to enhance a passed GPX track with elevation information
Parameters:
Name | Type | Description | Default |
---|---|---|---|
track
|
GPXTrack
|
Track to be enhanced. |
required |
Returns:
Type | Description |
---|---|
GPXTrack
|
The enhanced track |
Source code in geo_track_analyzer/enhancer.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
get_elevation_data(input_coordinates)
Send a POST request to the Open-Elevation API specified in the init.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_coordinates
|
list[tuple[float, float]]
|
list of latitude, longitude tuples for which the elevation should be determined. |
required |
Returns:
Type | Description |
---|---|
list[float]
|
A list of Elevations for the passed coordinates. |
Source code in geo_track_analyzer/enhancer.py
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
|
get_enhancer(name)
Get a Enhance object for a specific enpoint by passing a distinct name
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
EnhancerType
|
Name of enhancer. Chose OpenTopoElevation or OpenElevation |
required |
Returns:
Type | Description |
---|---|
Type[Enhancer]
|
An Enhancer object |
Raises:
Type | Description |
---|---|
NotImplementedError
|
If an invalid name is passed |
Source code in geo_track_analyzer/enhancer.py
216 217 218 219 220 221 222 223 224 225 226 227 228 |
|