Skip to main content

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. CI CD codecov PyPI - Version

geoenv is a Python library that maps geospatial geometries, such as points and polygons, to environmental terms in vocabularies/ontologies (e.g. ENVO). It’s like reverse geocoding, but for environments.

Features

  • Broad scale environmental context: Provides consistent broad scale environmental context supplementing local scale environmental descriptions.
  • Global Coverage: Provides worldwide resolution of terrestrial, coastal, and marine environments.
  • GeoJSON Output: Outputs data as a GeoJSON Feature, for integration with other tools and libraries.
  • Concurrent Data Resolution: Leverages asyncio to query multiple geospatial data sources concurrently, providing fast results.
  • Modular and Extensible: Designed with a modular architecture to facilitate integration of new data sources and vocabularies.

Quick Start

Install from PyPI:

$ pip install geoenv

Resolve a point location to environmental descriptions:

import asyncio
from geoenv.geometry import Geometry
from geoenv.resolver import Resolver
from geoenv.data_sources import (WorldTerrestrialEcosystems,
                                 EcologicalMarineUnits,
                                 EcologicalCoastalUnits)

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

# Set up the resolver. When the location's environment is not known, 
# multiple data sources are included to cover potential environment 
# types.
resolver = Resolver(
    data_source=[
        WorldTerrestrialEcosystems(),
        EcologicalMarineUnits(),
        EcologicalCoastalUnits(),
    ]
)

# Resolve the geometry to environmental descriptions. The resolver 
# queries multiple data sources concurrently using `asyncio`.
response = asyncio.run(resolver.resolve(geometry))

# Access response data.
print(response.data)

The response is a GeoJSON Feature with environmental terms mapped to ENVO (by default). Only resolved environments are included:

{
  "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"
          }
        ]
      }
    ]
  }
}

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 helps address this challenge by using a dataset’s originating location as a consistent and objective starting point. It can programmatically map the geometry of this location to standardized environmental terms, providing a scalable and repeatable method for generating interoperable metadata. This approach aims to enrich datasets with uniform, semantic metadata, making them potentially easier to discover, query, and integrate at scale.

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.

Metadata

Release files for geoenv 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for geoenv 0.5.0
File Size Uploaded
geoenv-0.5.0.tar.gz 36.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for geoenv 0.5.0
File Interpreter ABI Platform
geoenv-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 84.1 kB

Release files / geoenv-0.5.0.tar.gz

Download URL geoenv-0.5.0.tar.gz
Size 36.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3c8de22adbabbef6b3125d487698a9d45e3c42e1818bd1125eb18530fc3aa222
BLAKE2b-256 checksum
How to use checksums
3a2bd527118828d6d364a943a8d5a753a6ce3c25da696c9811d1d24a20e2869f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / geoenv-0.5.0-py3-none-any.whl

Download URL geoenv-0.5.0-py3-none-any.whl
Size 47.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a43d0bfa726b7baf921316bc73ebc241112d43a0a9d7428b41046446f7679e2
BLAKE2b-256 checksum
How to use checksums
60679a441c6b17246186880b6f86408f14ae9a307975fd6520ac98fcd95e4f92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page