Skip to main content

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.

  1. 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.
  2. Follow steps for local development
  3. Run NOMINATIM_USER_AGENT=your-nominatim-user-agent scripts/run_demo.sh
  4. It will open in your browser

Developing

  1. Install python and uv
  2. Checkout the code
  3. Run scripts/recreate_venv.sh
  4. Run PYTHONPATH=src python src/natural_language_geocoding/main.py init
  5. Run pre-commit install to install the pre commit checks
  6. Make changes
  7. Verify linting passes scripts/lint.sh
  8. 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/cla directory 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
  • 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

natural_language_geocoding-0.0.2.tar.gz (260.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

natural_language_geocoding-0.0.2-py3-none-any.whl (38.2 kB view details)

Uploaded Python 3

File details

Details for the file natural_language_geocoding-0.0.2.tar.gz.

File metadata

File hashes

Hashes for natural_language_geocoding-0.0.2.tar.gz
Algorithm Hash digest
SHA256 8ed81c4d3f0ed9334d3d4b27ecf2d8b7462d2114c5799628b74b9a560693f000
MD5 0fe330c172b1324d4241f5d649277f9a
BLAKE2b-256 af25882c3e2f0f249d2d49a26062974f296cea8112c4ba79e06e05c298072589

See more details on using hashes here.

Provenance

The following attestation bundles were made for natural_language_geocoding-0.0.2.tar.gz:

Publisher: pypi-publish.yml on Element84/natural-language-geocoding

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file natural_language_geocoding-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for natural_language_geocoding-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7c3d549d43acfb51f21d4d7dd5dc62307fec8400d7e5de58f18f062b454893d5
MD5 a21dc19850b85c6ba3305f1dbb72b783
BLAKE2b-256 d5ad401cd7e218ba5b1395b15dafccc8c0daf335886d6f0f38e166f4f4ba3058

See more details on using hashes here.

Provenance

The following attestation bundles were made for natural_language_geocoding-0.0.2-py3-none-any.whl:

Publisher: pypi-publish.yml on Element84/natural-language-geocoding

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page