Using WFS to Download Spatial Data
Learn how to query and download spatial data from a Web Feature Service (WFS). Understand GetFeature requests and output formats.
The Web Feature Service (WFS) is the OGC standard for downloading vector data from the web. Unlike WMS (which returns images), WFS returns the actual geometry and attributes of the features.
The GetFeature Request
To download data from a WFS, you construct a `GetFeature` request. This is a URL that tells the server exactly what data to return.
https://example.com/geoserver/wfs?service=WFS&version=2.0.0&request=GetFeature&typeName=my:layer&outputFormat=application/jsonKey Parameters
- service=WFS: Identifies the service type.
- version=2.0.0: The version of the WFS protocol.
- request=GetFeature: The operation you are performing.
- typeName=my:layer: The specific layer you want to download. This is usually a namespace and layer name.
- outputFormat=application/json: Tells the server to return the data as GeoJSON. Other options include GML and Shapefile.
- count=1000: Limits the number of returned features.
- bbox=minx,miny,maxx,maxy: A spatial filter to download only features within a specific bounding box.
Handling the Output
When you hit the URL, the server will return a file or a JSON response. If you use `outputFormat=application/json`, the browser will display the GeoJSON text. You can save this as a `.geojson` file.
If you use `outputFormat=shapefile`, the server will return a ZIP file containing the shapefile components.
The Limitation of WFS
Many WFS servers have a feature count limit (often 1,000 or 10,000 features). If you try to download a large dataset, the server will truncate the results. Unlike ArcGIS REST services, WFS does not have a standardized pagination mechanism (though some servers support `startIndex`).
Using a Browser-Based Tool
Because constructing WFS requests manually is error-prone, many users prefer a GUI. Geo Server Data Downloader handles WFS parsing by fetching the `GetCapabilities` document and allowing you to select layers from a list, then managing the download process.
Summary
WFS is the standard for downloading vector data from OGC servers. While the URL syntax can be complex, understanding the core parameters allows you to extract data from government and research servers worldwide.
Ready to try it yourself?
Export ArcGIS REST services, WFS endpoints, and ArcGIS Online datasets to Shapefile, GeoJSON, KML, or GeoPackage — all in your browser.
Open the Downloader