Docs Use cases

neoserver 0.2.0

Serve PostGIS and DuckDB as WFS

Publish PostGIS and DuckDB tables as WFS 2.0 feature types with FES filters, GeoJSON and GeoPackage export, and PostGIS transactions.

WFS gives GIS clients the actual features, not a rendered picture. Users can query, download, and (with PostGIS) edit them. neoserver implements WFS 2.0.0 and 2.0.2 on top of PostGIS tables and DuckDB Spatial databases.

What you get

  • GetFeature in GML 3.2, GeoJSON, CSV, and, when the GDAL drivers are available, GeoPackage and zipped Shapefile
  • Paging, sorting, property selection, bounding boxes, output CRS, and hit counts
  • FES 2.0 filters: comparison, logical, resource-ID, and spatial predicates, over GET or XML POST
  • Stored queries, including GetFeatureById, with custom definitions for administrators
  • Transactions (insert, update, replace, delete) and feature locking for PostGIS layers
  • Per-layer visibility: clients only see the feature types they may read
Source Read Transactions and locking
PostGIS tables Yes Yes
DuckDB Spatial Yes No, read-only
GeoParquet and vector files Yes No, read-only
SQL views on any source Yes No, read-only

In the console

  1. Connect the source. Choose Add store, pick PostGIS or DuckDB, and test the connection. For transactional editing, the PostGIS account needs INSERT, UPDATE, and DELETE on the published tables, in addition to SELECT.
  2. Publish layers with Add layer. Each public ID becomes a WFS feature type name. See Discover and publish layers.
  3. Enable WFS in the workspace’s service settings, with a title, feature limits, and default page size. WFS must also be enabled on the server (WFS.Enabled, or NEOSRV_WFS_ENABLED=true). See Workspace settings.
  4. Control access. Read-only clients need a scoped API key with the viewer role. Only give the editor role to clients that are meant to edit data.
  5. Connect clients. Endpoints lists the workspace’s service URLs and shows whether each is active. For QGIS, the console’s example uses the OGC API Features connection for reading and querying. Write transactions are for integrations that send WFS Transaction requests. Editing through QGIS WFS-T is not a supported client workflow.

With the API

curl -X PUT http://localhost:9000/api/v1/workspaces/demo/settings/wfs \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"enabled": true, "title": "Demo WFS", "max_features": 10000, "default_count": 100}'

curl -H "X-API-Key: $NEOSRV_API_KEY" \
  "http://localhost:9000/workspaces/demo/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&TYPENAMES=buildings&COUNT=10&OUTPUTFORMAT=application/json"

curl -o buildings.gpkg -H "X-API-Key: $NEOSRV_API_KEY" \
  "http://localhost:9000/workspaces/demo/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&TYPENAMES=buildings&OUTPUTFORMAT=application/geopackage%2Bsqlite3"

Transactions are sent as XML POST requests to the same endpoint with an editor credential. They are atomic and can only reference layers from one store. See transactions.

WFS or OGC API Features?

Both are served from the same published layers, so you don’t have to choose. Existing integrations often expect WFS, especially ones that write through WFS transactions or need GML and stored queries. New web and scripting clients are usually simpler with OGC API Features, which uses GeoJSON and CQL2 over plain HTTP.

Search documentation

Type to search guides and reference pages.