Metadata-Version: 2.1
Name: pyterrain
Version: 0.0.2
Summary: A Python package to fetch terrain data easily.
Home-page: https://github.com/Clarmy/pyterrain
Author: Wentao Li
Author-email: 
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy (>=1.24.1)
Requires-Dist: requests (>=2.28.1)
Requires-Dist: mercantile (>=1.2.1)
Requires-Dist: tqdm (>=4.64.1)
Requires-Dist: pyproj (>=3.4.1)
Requires-Dist: matplotlib (>=3.6.2)
Requires-Dist: retrying
Requires-Dist: loguru

# pyterrain
A python package to fetch terrain.

# Installation
You can install by pip `$ pip install pyterrain`

# Usage

## Register API Key
Pyterrain doesn't offer terrain data by itself, it fetches data from another website. Before downloading data, you should sign up an API key from [nextzen.org](https://developers.nextzen.org/). The key's pattern is like `Dto0r88DQuaQizoxcQSxxx`

## Fetch DEM by bound box
When API key is reday, you can download DEM data like this:

```python
bbox = 108.444319, 20.161757, 111.318897, 18.05883  # Hainan province of China

terrain = Terrain("Dto0r88DQuaQizoxcQSxxx")  # Pass API key
xs, ys, elevation = terrain.fetch(bbox=bbox, quiet=False, coord="lonlat", zoom=10)
```

If download is not completed because of connection, retry it.
