Skip to main content

Generate standards-compliant spatial reference grids.

Project description

StandardGrid

StandardGrid is a lightweight Python library for generating standards-compliant spatial reference grids aligned with recognised reference systems such as C-Squares and INSPIRE.

The library was originally developed within the EMODnet Seabed Habitats project to support the harmonisation and automation of composite habitat map production carried out under Work Package 3 (WP3). Its primary objective is to provide a reproducible and standardised way of generating reference grids for large-scale spatial analyses and map compilation.

Although originally developed for EMODnet Seabed Habitats, StandardGrid is intended as a general-purpose Python library for any GIS application requiring official and reproducible spatial reference grids.


Why StandardGrid?

Combining spatial datasets from different sources is often challenging because they are produced using different grid origins, spatial resolutions or processing workflows.

StandardGrid addresses this problem by generating centroid grids that are precisely aligned with recognised spatial reference standards, ensuring that different datasets can be integrated consistently and reproducibly.

Typical applications include:

  • Essential Fish Habitats (EFH)
  • Vulnerable Marine Ecosystems (VME)
  • Essential Ocean Variables (EOV)
  • Habitat suitability modelling
  • Marine spatial planning
  • Environmental assessments
  • Large-scale composite habitat mapping
  • Any workflow requiring standards-aligned reference grids

Features

  • Official C-Squares support
  • Official INSPIRE support
  • Standards-compliant centroid generation
  • Automatic alignment to official reference grids
  • Validation of supported resolutions
  • Simple and lightweight Python API
  • Pandas DataFrame output
  • CSV export
  • Excel export

Installation

Install directly from PyPI:

pip install standardgrid

or install from the GitHub repository:

git clone https://github.com/pmontei/standardgrid.git

cd standardgrid

pip install .

Quick Start

from standardgrid import Grid

grid = Grid(
    standard="csquares",
    resolution=0.01,
)

grid.generate(
    (-10.1, 36.6, -7.3, 41.9)
)

print(grid)

print(grid.points.head())

grid.to_csv("grid.csv")

The generated grid is available as a pandas DataFrame through `grid.points`.

Public API

StandardGrid exposes a compact and stable public API.

Most users will only need the Grid class to generate standards-aligned reference grids.

from standardgrid import (
    Grid,
    GridStandard,
    available_standards,
    get_standard,
    standards,
)

The remaining functions provide access to metadata describing the supported spatial reference standards.

Supported Standards

StandardGrid currently supports the following official spatial reference systems.

Standard CRS Units
C-Squares EPSG:4326 Degrees
INSPIRE EPSG:3035 Metres

Additional standards may be incorporated in future releases.

API identifiers

Standards are selected in the API using their identifier (code), while documentation uses their official name.

API identifier Official name
csquares C-Squares
inspire INSPIRE

Example:

grid = Grid(
    standard="csquares",
    resolution=0.01,
)

Supported Resolutions

Each supported standard defines a fixed set of official grid resolutions.

The requested resolution is validated automatically during grid creation.

Standard Resolution Description
C-Squares 10° Global reference grid
C-Squares
C-Squares
C-Squares 0.5°
C-Squares 0.1°
C-Squares 0.05° ICES statistical grid
C-Squares 0.01° Common habitat mapping
INSPIRE 100000 m 100 km
INSPIRE 10000 m 10 km
INSPIRE 1000 m 1 km
INSPIRE 100 m 100 m
INSPIRE 10 m 10 m
INSPIRE 1 m 1 m

Attempting to use an unsupported resolution raises a ValueError.


Working with Standards

The supported standards and their properties can be queried directly from the API.

from standardgrid import available_standards, get_standard

for code in available_standards():

    standard = get_standard(code)

    print(standard.name)
    print(standard.crs)
    print(standard.units)
    print(standard.resolutions)

Alternatively, all supported standards can be accessed directly:

from standardgrid import standards

for standard in standards():
    print(f"{standard.name} ({standard.code})")

Output:

C-Squares
EPSG:4326
degrees
(10.0, 5.0, 1.0, 0.5, 0.1, 0.05, 0.01, 0.005, 0.001, 0.0005, 0.0001, 0.00005, 0.00001)

INSPIRE
EPSG:3035
metres
(100000.0, 10000.0, 1000.0, 100.0, 10.0, 1.0)

Project Background

StandardGrid was originally developed within the EMODnet Seabed Habitats project to support the harmonisation and automation of composite habitat mapping workflows developed under Work Package 3 (WP3).

The library was initially designed to facilitate the production of harmonised pan-European spatial products, including:

  • Essential Fish Habitats (EFH)
  • Vulnerable Marine Ecosystems (VME)
  • Essential Ocean Variables (EOV)

By ensuring that all datasets share exactly the same spatial reference grid, StandardGrid simplifies rasterisation, spatial overlay, data aggregation and reproducible GIS workflows.

Although originally developed for marine habitat mapping, the library is applicable to any GIS workflow requiring official standards-aligned reference grids.


Citation

If StandardGrid contributes to published research or technical reports, please cite the project and acknowledge the EMODnet Seabed Habitats initiative where appropriate.


License

This project is released under the MIT License.


Developed by

Pedro Monteiro CCMAR – Centre of Marine Sciences University of Algarve

Project

EMODnet Seabed Habitats

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

standardgrid-1.0.1.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

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

standardgrid-1.0.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file standardgrid-1.0.1.tar.gz.

File metadata

  • Download URL: standardgrid-1.0.1.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for standardgrid-1.0.1.tar.gz
Algorithm Hash digest
SHA256 395ff5bab384cf9a38f835a09da8c423e784e5e8d3837cc5d1ef977988ceb882
MD5 50fdf6c82a39d48ebd9edff194f46411
BLAKE2b-256 8a1207e73e676218545d4a91151a9bacb7655310db72cd42d696d53b00de4573

See more details on using hashes here.

File details

Details for the file standardgrid-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: standardgrid-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for standardgrid-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 debff1cda4435d782473ca4aaf7b742b1094c1a511a2849edb1000477f04eca5
MD5 82ff83cf062d6030e488748b75e57621
BLAKE2b-256 edf10860c18b2524359025a0613db40586c3914dc4393cef706cd83cb9192aa8

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