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.
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 installto install the pre commit checks - Make changes
- Verify linting passes
scripts/lint.sh - Commit and push your changes
Contributions
We are happy to take contributions! It is best to get in touch with the maintainers about larger features or design changes before starting the work, as it will make the process of accepting changes smoother.
Contributor License Agreement (CLA)
Everyone who contributes code to natural language geocoding will be asked to sign a CLA, which is based off of the Apache CLA.
-
Download a copy of one of the following from the
docs/cladirectory in this repository:- Individual Contributor (You're using your time):
2024_1_24-Natural-Language-Geocoding-Open-Source-Contributor-Agreement-Individual.pdf - Corporate Contributor (You're using company time):
2024_1_24-Natural-Language-Geocoding-Open-Source-Contributor-Agreement-Corporate.pdf
- Individual Contributor (You're using your time):
-
Sign the CLA -- either physically on a printout or digitally using appropriate PDF software.
-
Send the signed CLAs to Element 84 via one of the following methods:
- Emailing the document to contracts@element84.com
- Mailing a hardcopy to:
Element 84, 210 N. Lee Street Suite 203 Alexandria, VA 22314, USA.
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
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 natural_language_geocoding-0.0.3.tar.gz.
File metadata
- Download URL: natural_language_geocoding-0.0.3.tar.gz
- Upload date:
- Size: 260.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8a88b5526bae295b345a0c73b90f4e2c741fb49b402f8fc3e2d4910de17d722
|
|
| MD5 |
40150135134d929bb3a7d4b9b4f33ed6
|
|
| BLAKE2b-256 |
fb9e134375944f7b2f60793c83c11bfd2ca448f714c0dfb6904f20386eb8172e
|
Provenance
The following attestation bundles were made for natural_language_geocoding-0.0.3.tar.gz:
Publisher:
pypi-publish.yml on Element84/natural-language-geocoding
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
natural_language_geocoding-0.0.3.tar.gz -
Subject digest:
d8a88b5526bae295b345a0c73b90f4e2c741fb49b402f8fc3e2d4910de17d722 - Sigstore transparency entry: 173057801
- Sigstore integration time:
-
Permalink:
Element84/natural-language-geocoding@7c7a465448cfc5fe6f3d3a9746c8c15994f29ad7 -
Branch / Tag:
refs/tags/0.0.3 - Owner: https://github.com/Element84
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@7c7a465448cfc5fe6f3d3a9746c8c15994f29ad7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file natural_language_geocoding-0.0.3-py3-none-any.whl.
File metadata
- Download URL: natural_language_geocoding-0.0.3-py3-none-any.whl
- Upload date:
- Size: 38.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31a03feb1c56f64f43e344d042a4a04b1621ccb808270942edd2d77ad0262468
|
|
| MD5 |
0ff880735b611bfe90a157fed954d23f
|
|
| BLAKE2b-256 |
9a399c48789908edb0c23d0a7d19d290d7ca37dfbfdc85d5310c36c0ba7282e0
|
Provenance
The following attestation bundles were made for natural_language_geocoding-0.0.3-py3-none-any.whl:
Publisher:
pypi-publish.yml on Element84/natural-language-geocoding
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
natural_language_geocoding-0.0.3-py3-none-any.whl -
Subject digest:
31a03feb1c56f64f43e344d042a4a04b1621ccb808270942edd2d77ad0262468 - Sigstore transparency entry: 173057804
- Sigstore integration time:
-
Permalink:
Element84/natural-language-geocoding@7c7a465448cfc5fe6f3d3a9746c8c15994f29ad7 -
Branch / Tag:
refs/tags/0.0.3 - Owner: https://github.com/Element84
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@7c7a465448cfc5fe6f3d3a9746c8c15994f29ad7 -
Trigger Event:
release
-
Statement type: