Natural Language Geocoding implements an AI technique to convert natural language descriptions of spatial areas into polygons.
Project description
natural-language-geocoding
Natural Language Geocoding implements an AI technique to convert natural language descriptions of spatial areas into polygons.
TODOS
- Add integration tests
- Can have them just run locally for now
- Add unit tests
Installing and Using
pip install natural-language-geocoding
natural-language-geocoding init
Set the NOMINATIM_USER_AGENT
environment variable to identify your application with the Nominatim API.
Running the demo
There's a streamlit demo in src/natural_language_geocoding_demo
. It can be run by following these steps.
- Set up AWS credentials. The demo uses AWS Bedrock Anthropic Claude as the LLM. Valid AWS access keys to an account need to be present.
- Follow steps for local development
- Run
NOMINATIM_USER_AGENT=your-nominatim-user-agent scripts/run_demo.sh
- It will open in your browser
Developing
- Install python and uv
- Checkout the code
- Run
scripts/recreate_venv.sh
- Run
PYTHONPATH=src python src/natural_language_geocoding/main.py init
- Run
pre-commit install
to install the pre commit checks - Make changes
- Verify linting passes
scripts/lint.sh
- Commit and push your changes
Attribution
OpenStreetMap
This library uses the OpenStreetMap Nominatim API for geocoding. Users of this library must follow OpenStreetMap's attribution guidelines
Users must also conform to the Nominatim Usage Policy. The environment variable NOMINATIM_USER_AGENT
should be set to identify your application.
Natural Earth
This library uses coastlines from https://github.com/martynafford/natural-earth-geojson which is distributed under the CC0-1.0 license. These are downloaded when the project is initialized.
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 natural_language_geocoding-0.0.1.tar.gz
.
File metadata
- Download URL: natural_language_geocoding-0.0.1.tar.gz
- Upload date:
- Size: 24.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89a46b71f77c60839fd8b1da533b681742f56cdc0cc447d6be8af0c895605d20 |
|
MD5 | ba0708883fc6e554ffc0b7ed8100a64c |
|
BLAKE2b-256 | cd85bbdc0f22a7d52084982f508648121ed5adaf61558cbd61fe2bc9b5060450 |
File details
Details for the file natural_language_geocoding-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: natural_language_geocoding-0.0.1-py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d471559a1619da7059b6dc19b65404afe592401b465a243c5c9bc184fc853731 |
|
MD5 | 77db4dd78e86a1793352713fe21810b6 |
|
BLAKE2b-256 | 31c2e46f2e444f7864986ae12d170c2029434a9291b38bd05ffe7a8a203829cc |