Skip to content

Support FAO GAUL WFS/WMS for non-GEE workflows #61

@dfguerrerom

Description

@dfguerrerom

Summary

pygaul currently requires Google Earth Engine (GEE) for fetching geometries via pygaul.Items(). This proposal suggests adding native support for FAO's GAUL WFS/WMS services, enabling users to fetch administrative boundaries without GEE authentication:

  • Some users might need admin boundaries but don't have or want GEE credentials
  • Web apps and scripts could use pygaul without GEE infrastructure
  • The package would be using official data
  • pygaul already uses local parquet for names lookups - geometry fetching could follow the same pattern

FAO provides OGC-compliant services:

We could have something like:

import httpx
import geopandas as gpd

params = {
    "service": "WFS",
    "version": "2.0.0", 
    "request": "GetFeature",
    "typeName": "gaul:gaul_2024_l0",
    "outputFormat": "application/json",
    "srsName": "EPSG:4326",
    "CQL_FILTER": "gaul0_code=57",
}

async with httpx.AsyncClient( as client:
    response = await client.get(FAO_WFS_URL, params=params)
    data = response.json()
    
gdf = gpd.GeoDataFrame.from_features(data["features"], crs="EPSG:4326")

Layers:

  • Level 0: gaul:gaul_2024_l0
  • Level 1: gaul:g2024_2023_1
  • Level 2: gaul:g2024_2023_2

I'm implementing this in sepal-ui and it seems to works well. Happy to contribute a PR if there's interest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions