Skip to main content

A Python library that links geographic coordinates to environmental properties at a global scale.

Project description

geoenv

Map geometries to environmental semantics

Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. example workflow codecov Package version

geoenv is a Python library that maps geospatial geometries, such as points and polygons, to standardized environmental terms. It’s like reverse geocoding, but for environments.

Motivation

Finding datasets based on their environmental context is a challenge in data synthesis. The process often relies on vague or inconsistent metadata. This variability presents a barrier to reliable, large-scale analysis due to time lost in data discovery and incomplete search results.

geoenv addresses this by using a dataset's originating location as a consistent and objective starting point. It programmatically maps the geometry of this location to standardized environmental terms, providing a scalable and repeatable method for generating interoperable metadata. This approach enriches datasets with uniform, semantic metadata, making them easier to discover, query, and integrate at scale.

Key Features

  • Automated Semantic Annotation: Supplements inconsistent, manual descriptions with standardized environmental terms from controlled vocabularies.
  • Structured, Interoperable Output: Generates GeoJSON objects enriched with formal terms from ENVO (by default).
  • Global Coverage: Provides worldwide coverage for terrestrial, coastal, and marine environments using high-resolution data sources.
  • Extensible: Designed to accommodate new data sources or vocabularies for specific research needs.

Know of a useful data source or vocabulary? Suggest it!

Quick Start

Install from PyPI:

pip install geoenv

Resolve a point on land:

from geoenv.data_sources import WorldTerrestrialEcosystems
from geoenv.geometry import Geometry
from geoenv.resolver import Resolver

# Define a geometry in GeoJSON format (Point or Polygon)
geometry = Geometry(
    {
        "type": "Point",
        "coordinates": [
            -122.622364,
            37.905931
        ]
    }
)

# Configure the resolver with a data source (there can be multiple)
resolver = Resolver(data_source=[WorldTerrestrialEcosystems()])

# Resolve the geometry to environmental descriptions
response = resolver.get_environment(geometry)

The response is a GeoJSON Feature with structured environments mapped to ENVO (by default):

{
  "type": "Feature",
  "identifier": null,
  "geometry": {
    "type": "Point",
    "coordinates": [
      -122.622364,
      37.905931
    ]
  },
  "properties": {
    "description": null,
    "environment": [
      {
        "type": "Environment",
        "dataSource": {
          "identifier": "https://doi.org/10.5066/P9DO61LP",
          "name": "WorldTerrestrialEcosystems"
        },
        "dateCreated": "2025-03-07 15:53:09",
        "properties": {
          "temperature": "Warm Temperate",
          "moisture": "Moist",
          "landCover": "Cropland",
          "landForm": "Mountains",
          "climate": "Warm Temperate Moist",
          "ecosystem": "Warm Temperate Moist Cropland on Mountains"
        },
        "mappedProperties": [
          {
            "label": "temperate",
            "uri": "http://purl.obolibrary.org/obo/ENVO_01000206"
          },
          {
            "label": "humid air",
            "uri": "http://purl.obolibrary.org/obo/ENVO_01000828"
          },
          {
            "label": "area of cropland",
            "uri": "http://purl.obolibrary.org/obo/ENVO_01000892"
          },
          {
            "label": "mountain range",
            "uri": "http://purl.obolibrary.org/obo/ENVO_00000080"
          }
        ]
      }
    ]
  }
}

Related Projects

The Global Ecosystems Atlas is a project that provides a comprehensive, harmonized open resource on the world's ecosystems. It standardizes diverse geospatial datasets by mapping them to the IUCN Global Ecosystem Typology, a hierarchical classification of environments.

Contributing

We welcome contributions! If you know of a useful data source or vocabulary, and have ideas for new features, or find a bug, please open an issue to start a discussion.

License

This project is licensed under the terms of the MIT license.

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

geoenv-0.2.1.tar.gz (36.8 kB view details)

Uploaded Source

Built Distribution

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

geoenv-0.2.1-py3-none-any.whl (47.1 kB view details)

Uploaded Python 3

File details

Details for the file geoenv-0.2.1.tar.gz.

File metadata

  • Download URL: geoenv-0.2.1.tar.gz
  • Upload date:
  • Size: 36.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for geoenv-0.2.1.tar.gz
Algorithm Hash digest
SHA256 f504ba7e46b7f10d607c5a116cad580c0317ef2cf01754afc20ab99e1ee3014f
MD5 13fd7c39eb25145279fc7d29c5bc9899
BLAKE2b-256 75d9b87c19176c26b9192749266816cc6b672303152c329c5dfa8675056a0a2e

See more details on using hashes here.

File details

Details for the file geoenv-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: geoenv-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 47.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for geoenv-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ac9cab47a79eebf0df30dc077cd6a8eb0af7d69283915bbb5430a0e6ceddff63
MD5 cb3ac3b68c5e3110739b0dc76d79d97c
BLAKE2b-256 a51775ee36cb5c9c294a7832d640c8fc2d9d76b6a5380ef7a9bf8ee3987c2d80

See more details on using hashes here.

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