Skip to main content
100%

Download data from WFS using GDAL Python bindings

✓ Published0🌍 Public
TThomasG77
Last edited Sep 24, 2024
Created on Sep 23, 2024

This example shows how to download vector data from a WFS (Web Feature Service) endpoint using GDAL’s Python bindings. It demonstrates bulk download of a full layer, plus filtered extracts by bounding box via the `-spat` option, and outputs to GeoPackage, CSV, and GeoJSON formats. The code explicitly configures WFS paging with `OGR_WFS_PAGING_ALLOWED` and `OGR_WFS_PAGE_SIZE`, and uses `gdal.OpenEx` and `gdal.VectorTranslate` to fetch data from the Géoportail WFS service. A separate call requests GeoJSON output directly through the service’s `outputFormat=json` parameter.

AI-generated description

Similar vizzes