Skip to main content

WindEurope 72 Hours Challenge: Octue Elevations Python Client

Summary

A python client that returns the ground elevations of the coordinates sent to it. The client accepts any of the following as inputs:

  • H3 cells (a hierarchical, hexagonal coordinate system that combines position with resolution in a single index)
  • Latitude/longitude coordinates
  • A polygon defined by a set of latitude/longitude coordinates (the output is the elevations of the H3 cells within the polygon are returned)

Elevations are defined as meters above the coordinate reference system defined in the underlying dataset (see data sources section) as:

Horizontal WGS84-G1150 (EPSG 4326) (DGED & DTED format), (EPSG 3035) for continental Europe and UTM , (EPSG 32740,
32622, 32738, 32620) for the French DOMs (INSPIRE format), Vertical EGM2008 (EPSG 3855).

The client is a wrapper for the Octue Elevations API.

Usage

Method 1 - H3 cells

Request the elevations of a list of H3 cells:

from windeurope72hours import get_h3_cell_elevations

elevations, later, estimated_wait_time = get_h3_cell_elevations(
    [630949280935159295, 630949280220393983],
)

elevations
>>> {630949280935159295: 151.216965, 630949280220393983: 180.708115}

Notes

  • The H3 cells must be given in their integer form (not their hexadecimal string form)
  • Requests of this form are limited to 15 cells per request.

Method 2 - Latitude/longitude coordinates

Request the elevations of a list of latitude/longitude coordinates:

from windeurope72hours import get_coordinate_elevations

elevations, later, estimated_wait_time = get_coordinate_elevations(
    [[54.53097, 5.96836]],
    resolution=12,
)

elevations
>>> {(54.53097, 5.96836): 0.0}

Notes

  • The latitude and longitude coordinates must be given in decimal degrees
  • A resolution field can also be included - this should be one of the H3 resolution levels. The default of 12 is used if not included.
  • Requests of this form are limited to 15 cells per request.

Method 3 - H3 cells within a polygon

Request the elevations of the H3 cells contained within a polygon defined by a list of latitude/longitude coordinates:

from windeurope72hours import get_h3_cell_elevations_in_polygon

elevations, later, estimated_wait_time  = get_h3_cell_elevations_in_polygon(
    [
      [54.53097, 5.96836],
      [54.53075, 5.96435],
      [54.52926, 5.96432],
      [54.52903, 5.96888],
    ],
    resolution=12,
)

elevations
>>> {622045820847718399: 0.0, 622045820847849471: 0.0, 622045848952471551: 0.0, 622045848952602623: 0.0}

Notes

  • The latitude and longitude coordinates must be given in decimal degrees
  • A resolution field can also be included:
    • This should be one of the H3 resolution levels
    • The default of 12 is used if not included
    • The returned cells will be of this resolution
  • Requests of this form are limited to polygons that contain up to 1500 cells per request. You can reduce the number of cells within a polygon by decreasing the resolution.

Output

As the API's database is lazily loaded (see output data section below), it will respond to any requests for coordinates it hasn't seen before by asking you to come back after a short estimated wait time (240s) while the database is populated. The response will look like:

elevations
>>> {}

later
>>> [631574537555217407]

estimated_wait_time
>>> 240

Resend the same request after the wait time has passed to get the elevations.

Output data

Data storage

The data served by the API is stored in a Neo4j graph database, which is "lazily" populated by our elevations populator data service. The populator works by extracting the elevations of the centerpoints of high resolution H3 cells at a 30m spatial resolution from the underlying data source (see data sources section below); elevations for lower resolution cells are calculated by averaging each cell's immediate children's elevations. In the database, cells, elevations, and data sources are nodes connected by edges that define their relationships to each other.

Why store a copy of the data?

The original data is available only via latitude/longitude coordinates at a single resolution in a format that's difficult to automatically use. To facilitate the quick data access at multiple resolutions using the H3 coordinate system, we created an intermediate graph database that efficiently stores the relationships between H3 cells and can be easily and quickly queried.

Why lazily populate instead of loading the whole dataset?

We chose lazy-loading to reduce the up-front cloud computation and storage costs of populating trillions of data points. Once an elevation has been added to the database, however, it is permanently available.

Limitations

As in the original dataset:

  • The elevations of all oceans appear as 0m
  • The elevations of a small number of large bodies of water (e.g. the Caspian Sea) appear as having a constant negative non-zero elevation
  • We are currently only able to provide elevations for H3 cells between resolution 8 and 12. However:
    • We're likely to be able to decrease the minimum resolution to 6 or below with time
    • We're unlikely to be able to increase the maximum resolution beyond 12 - with the underlying dataset, it's not possible to provide meaningful elevations for cells with resolutions higher than 12 because they have a higher spatial resolution than the dataset

Data sources

The underlying dataset we used to provide the elevations is the Copernicus DEM - Global and European Digital Elevation Model (COP-DEM) GLO-30 dataset:

We accessed it via the AWS S3 mirror, which provides easy access to the dataset's GeoTIFF files:

Metadata

Release files for windeurope72hours 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for windeurope72hours 0.1.3
File Size Uploaded Provenance
windeurope72hours-0.1.3.tar.gz 5.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for windeurope72hours 0.1.3
File Interpreter ABI Platform
windeurope72hours-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 11.2 kB

Release files / windeurope72hours-0.1.3.tar.gz

Download URL windeurope72hours-0.1.3.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b9e71d2a40e00836cb2dc023cc0dfb8c75287635cf1cffd8731447cf30a0e996
BLAKE2b-256 checksum
How to use checksums
4e4cc507a132d613409fdb4debc7b885468fafb25d0106c7510cf1a6f5479e79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.1 CPython/3.11.3

Release files / windeurope72hours-0.1.3-py3-none-any.whl

Download URL windeurope72hours-0.1.3-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d237392246c7b23b0c8162a13cacaec5cf9800967b950c22860348c39c9dda3
BLAKE2b-256 checksum
How to use checksums
65f3b8024d6e3a03490d101b943fe3f2acc08b637c442df18d3a553c12958733
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.1 CPython/3.11.3

Security for windeurope72hours 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page