Skip to content

09. GeoServer

GeoServer is the spatial data server that serves climate and agroclimatic information as map layers and data services. It is the bridge between the processed spatial data stored in the database and the interactive maps that users see in the frontend.

How AClimate Uses GeoServer

The frontend consumes GeoServer services primarily through the spatial maps module. When users navigate to the spatial section and select a climate variable like precipitation or temperature, the frontend requests map tiles from GeoServer using the Web Map Service (WMS) protocol. These tiles are rendered as raster layers on top of a Leaflet base map, with a time dimension slider that users can drag to animate climate data across different dates.

Behind the scenes, the ETL pipelines are responsible for keeping GeoServer updated with fresh data. After the spatial ETL processes gridded climate data from sources like ERA5 and CHIRPS, it uploads the resulting rasters to GeoServer using the raster upload tool. This tool creates or updates the appropriate stores in the correct workspace, making the new data immediately available for visualization.

The WebAPI also interacts with GeoServer through two dedicated endpoints. One endpoint allows users to extract values from rasters at specific geographic coordinates and dates, which is useful for getting precise data for a particular farm or field without downloading the entire raster. The other endpoint allows exporting raster data as GeoTIFF files, either individually for a single date or as a ZIP archive for multiple dates. These exports can optionally be clipped to a specific area of interest using administrative boundaries stored in GeoServer.

Workspaces and Stores

GeoServer is organized into workspaces and stores that separate different types of climate data. The workspaces and their naming conventions are configured through a configuration file used by the spatial ETL pipeline.

For daily raw data, the workspace is named climate_historical_daily and contains stores for each climate variable. For example, a store named climate_historical_daily_co_tmax would contain daily maximum temperature rasters for Colombia, with the country code co being replaced dynamically based on the country being processed. The same pattern applies to minimum temperature, precipitation, and solar radiation stores.

Monthly aggregated data follows the same structure under the climate_historical_monthly workspace, with stores like climate_historical_monthly_co_tmax containing monthly averages. Climatological normals are stored under the climate_historical_climatology workspace.

For derived climate indices, there is a dedicated workspace called climate_index with stores containing indicators such as TXx (maximum temperature) and TR20 (tropical nights). Additional indicators can be added as new stores within this workspace as they become available.

The stores and workspaces for each country and climate measure can also be configured from the admin portal. When administrators configure country climate measures or country indicators, they can specify the GeoServer store and workspace where the spatial data for that measure or indicator is published.

Configuration

The frontend is configured with a default GeoServer URL that points to the WMS service. This URL is set through the NEXT_PUBLIC_GEOSERVER_URL environment variable and can be changed for different deployment environments.

OGC Services

Beyond map visualization, GeoServer also provides Web Feature Service (WFS) for accessing vector data like station locations and administrative boundaries, and Web Coverage Service (WCS) for accessing the full raster data. These services enable other systems to consume AClimate spatial data directly through standard OGC protocols.