Skip to content

cut_spatial_data

Preprocesses and segments spatial data by clipping global/regional climate datasets to areas of interest.

Clipping Methods

The package provides 4 clipping methods through the clippers/ module:

Shapefile Clipping

raster_clipper_shapefile.py

Clips raster data (NetCDF, GeoTIFF) using vector shapefile boundaries. Used for administrative boundaries or custom AOIs.

Inputs: Raster file + Shapefile boundary Outputs: Clipped raster matching the shapefile extent

GeoServer Clipping

raster_clipper_geoserver.py

Uses GeoServer WMS/WCS services to clip spatial data. Integrates with the platform's spatial infrastructure.

Inputs: GeoServer layer + bounding geometry Outputs: Clipped raster from GeoServer

PostGIS Clipping

raster_clipper_postgis.py

Clips raster data using geometries stored in PostGIS (PostgreSQL spatial extension).

Inputs: Raster file + PostGIS geometry Outputs: Clipped raster

General Raster Clipper

raster_clipper.py

Base implementation for raster clipping operations. Supports both NetCDF and GeoTIFF formats.

Data Types

The types/ module defines:

  • Geometry types: Vector geometries for clipping boundaries
  • Raster types: Raster data formats and metadata structures

Repository

github.com/CIAT-DAPA/aclimate_v3_cut_spatial_data