implementations of geocoder_reverse using natural_earth shape-files
Project description
geocoder_reverse_natural_earth
implementations of readers for the pyaerocom project using pyaro as interface
License
The python code in this package is licensed under the LGPL >= 2.1, see LICENSE.
The Natural-Earth database included as zip file is in public domain, see https://www.naturalearthdata.com/about/terms-of-use/ .
Installation
python -m pip install 'pyaro-readers@git+https://github.com/metno/geocoder_reverse_natural_earth.git'
This will install geocoder_reverse_natural_earth and all their dependencies.
Usage
geocoder_reverse_natural_earth is small helper to identify country codes for obs networks that don't mention the countrycode of a station in their location data
from geocoder_reverse_natural_earth import (
Geocoder_Reverse_NE,
Geocoder_Reverse_Exception,
)
geo = Geocoder_Reverse_NE()
print(geo.lookup(60, 10)["ISO_A2_EH"])
lat = 78.2361926
lon = 15.3692614
try:
geo.lookup(lat, lon)
except Geocoder_Reverse_Exception as grex:
dummy = geo.lookup_nearest(lat, lon)
if dummy is None:
print(f"error: {lat},{lon}")
else:
print(dummy["ISO_A2_EH"])
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
File details
Details for the file geocoder_reverse_natural_earth-0.0.1.tar.gz
.
File metadata
- Download URL: geocoder_reverse_natural_earth-0.0.1.tar.gz
- Upload date:
- Size: 4.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b9414a5a3c394137af49da4b15f962ae42f9497ffa0fbcffada42e327c6245c |
|
MD5 | 923f01e29c3d966626cee232d156256d |
|
BLAKE2b-256 | 6a1e36c214813a151088a22c0840b4ca84c9ef31f76cc9ea76730d7951a3ac03 |
Provenance
File details
Details for the file geocoder_reverse_natural_earth-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: geocoder_reverse_natural_earth-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e637ca62f7b9b888929006222f74a83f6cbc47dfca97318636fd529ca904a0c |
|
MD5 | 9fc6148426fbbbf1fd6027419a008805 |
|
BLAKE2b-256 | 0ce91651f85647af866fbac755bc42759357bc599cc97a550f3ef0ec025d0f6a |