Fetch Australian Digital Elevation Model (DEM) data from Geoscience Australia WCS services as xarray arrays.
Project description
ausdem
Fetch Australian Digital Elevation Model (DEM) data from Geoscience Australia straight into Python as georeferenced xarray arrays.
It talks to GA's public Web Coverage Services, asking only for the bounding box you want rather than downloading whole continental tiles. The data and services come from GA's Digital Elevation Data page.
Install
pip install ausdem
Requires requests, numpy, xarray, rioxarray and rasterio (pulled in
automatically).
Usage
import ausdem
# A small area around Canberra (min_lon, min_lat, max_lon, max_lat)
dem = ausdem.get_dem((149.0, -35.4, 149.1, -35.3))
dem.plot() # it's a normal xarray DataArray
print(float(dem.max())) # highest point in the box
ausdem.save_geotiff(dem, "canberra.tif") # or: dem.rio.to_raster("canberra.tif")
The returned object is an xarray.DataArray with dimensions (y, x), a NaN
no-data mask, and a .rio accessor (CRS, transform, to_raster). So you get
the array for analysis and can drop it to a GeoTIFF whenever you like.
Choosing a dataset
ausdem.list_datasets()
# ['lidar_5m', 'srtm_1s_dem', 'srtm_1s_dem_h']
dem_h = ausdem.get_dem(bbox, dataset="srtm_1s_dem_h") # hydro-enforced
lidar = ausdem.get_dem(bbox, dataset="lidar_5m") # 5 m, where surveyed
| key | product | resolution |
|---|---|---|
srtm_1s_dem |
SRTM 1 Second DEM (bare earth), national | ~30 m |
srtm_1s_dem_h |
SRTM 1 Second DEM-H (hydro-enforced) | ~30 m |
lidar_5m |
LiDAR-derived 5 m DEM (surveyed areas) | 5 m |
The smoothed DEM-S product is not served over WCS; download it from the
ELVIS portal. The LiDAR DEM only covers
surveyed areas (coastal zone, Murray-Darling floodplains, population centres);
requests outside coverage either come back as a no-data (NaN) tile or raise
ausdem.WCSError, depending on the area.
Pass resolution= (in degrees) to resample, e.g. resolution=0.001 for a
coarser, lighter grid.
Command line
ausdem 149.0 -35.4 149.1 -35.3 -o canberra.tif
ausdem 149.0 -35.4 149.1 -35.3 -o canberra_demh.tif -d srtm_1s_dem_h
ausdem --list
Notes
Coordinates are decimal degrees. SRTM products are served in WGS84 (EPSG:4326) and the LiDAR product in GDA94 (EPSG:4283); for input bounding boxes the two are interchangeable at this scale. Very large requests are rejected client-side to avoid pulling huge rasters by accident; tile your area or coarsen the resolution if you hit that.
Example
There is a small standalone script in examples/ that fetches a
DEM and plots it:
python examples/plot_dem.py # a box near Canberra, writes dem.png
Development
git clone https://github.com/g-adopt/ausdem
cd ausdem
pip install -e ".[dev]"
pytest -m "not network" # offline tests
pytest # include the live GA WCS test
License
MIT, see LICENSE.
Citation
If you use ausdem in your work, please cite it. Release archives are deposited on Zenodo and a DOI will be added here after the first release; in the meantime see CITATION.cff.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ausdem-0.1.0.tar.gz.
File metadata
- Download URL: ausdem-0.1.0.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b7b1c90e304bece8c193c5e2b49b26d8c0c1e00c3f0175174f321a755906aca
|
|
| MD5 |
061e380ea8b0f240825026a4654164cb
|
|
| BLAKE2b-256 |
00efffbec762a81879ea4683020ce50eff28c97d5d4da6c4d5413cc7fd05f3cf
|
Provenance
The following attestation bundles were made for ausdem-0.1.0.tar.gz:
Publisher:
publish.yml on g-adopt/ausdem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ausdem-0.1.0.tar.gz -
Subject digest:
3b7b1c90e304bece8c193c5e2b49b26d8c0c1e00c3f0175174f321a755906aca - Sigstore transparency entry: 1866986285
- Sigstore integration time:
-
Permalink:
g-adopt/ausdem@a57621c3c3e38367120b3f5654ea5e6f536d8f89 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/g-adopt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a57621c3c3e38367120b3f5654ea5e6f536d8f89 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ausdem-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ausdem-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf357cba047a176ca186bb75212f01718a3524db8def551e047f66c9010ecb4c
|
|
| MD5 |
2f02eda55486409056af1c3f6cb76e6f
|
|
| BLAKE2b-256 |
0488d6ad3edf8df94b7f1fd6e62dfa11b35b99b8daf298bada7e69ae62c8cfd3
|
Provenance
The following attestation bundles were made for ausdem-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on g-adopt/ausdem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ausdem-0.1.0-py3-none-any.whl -
Subject digest:
bf357cba047a176ca186bb75212f01718a3524db8def551e047f66c9010ecb4c - Sigstore transparency entry: 1866986292
- Sigstore integration time:
-
Permalink:
g-adopt/ausdem@a57621c3c3e38367120b3f5654ea5e6f536d8f89 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/g-adopt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a57621c3c3e38367120b3f5654ea5e6f536d8f89 -
Trigger Event:
release
-
Statement type: