Helpers
Utility functions for working with altitude and coordinate data.
ALT
cell_to_shapely(h)
Converts an H3 ID into a Shapely Polygon
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
str
|
H3 cell ID |
required |
Returns:
| Name | Type | Description |
|---|---|---|
polygon |
Polygon
|
Polygon of cell boundary in lon,lat |
Source code in src/aspiaspace/helpers/alt.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
Coordinates
format_areas(features)
Convert outputs of areas endpoint into GeoPandas GeoDataFrame
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
features
|
str
|
Output of areas endpoint |
required |
Returns:
| Type | Description |
|---|---|
|
geometry table (geopandas.GeoDataFrame): A GeoDataFrame of features |
Source code in src/aspiaspace/helpers/coordinates.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
is_valid_coordinate(coord_str)
Asserts that a coordinate is valid and not out of bounds
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coord_str
|
str
|
Coordinates |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
True if valid, otherwise False |
Source code in src/aspiaspace/helpers/coordinates.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |