[mapserver-commits] [MapServer/MapServer] a53a18: Add OGR_EXPOSE_FID=TRUE processing option to add G...

Seth G noreply at github.com
Tue Jun 23 05:27:17 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/MapServer/MapServer
  Commit: a53a187c5c0fd5ad488b2bdca08689efd02fb883
      https://github.com/MapServer/MapServer/commit/a53a187c5c0fd5ad488b2bdca08689efd02fb883
  Author: Seth G <sethg at geographika.co.uk>
  Date:   2026-06-23 (Tue, 23 Jun 2026)

  Changed paths:
    A msautotest/wxs/expected/wfs_filter_ogr_fid.xml
    A msautotest/wxs/expected/wfs_filter_ogr_fid_describe.xml
    A msautotest/wxs/expected/wfs_filter_ogr_fid_native.xml
    A msautotest/wxs/expected/wfs_filter_ogr_fid_native_describe.xml
    A msautotest/wxs/expected/wfs_filter_ogr_fid_native_range.xml
    A msautotest/wxs/expected/wfs_filter_ogr_fid_range.xml
    A msautotest/wxs/expected/wfs_ogr_gpkg_expose_fid.xml
    A msautotest/wxs/wfs_200_fid.map
    M msautotest/wxs/wfs_ogr_gpkg.map
    M src/mapgml.c
    M src/mapogcfilter.cpp
    M src/mapogr.cpp

  Log Message:
  -----------
  Add OGR_EXPOSE_FID=TRUE processing option to add GDAL/OGR Feature Id field to LAYER attributes (#7533)

Both GDAL and QGIS show the FID column when opening through GDAL. For example the *fid* column below:

```bash
gdal info .\buildings.gpkg
INFO: Open of `.\buildings.gpkg'
      using driver `GPKG' successful.
Layer name: buildings
Geometry: Multi Polygon
...
FID Column = fid
Geometry Column = geom
osm_id: String (0.0)
name: String (0.0)
building: String (0.0)
```

MapServer however does not make this field available as an attribute. For example:

```
LAYER
  NAME "buildings"
  # interestingly adding fid below also makes the field available, but the "all" option cannot then be used
  # PROCESSING "ITEMS=fid,building"
  # new PROCESSING  keyword added in this pull request
  PROCESSING "OGR_EXPOSE_FID=TRUE"
  CONNECTIONTYPE OGR
  CONNECTION "data/osm/timisoara/buildings.gpkg"
  METADATA
    "ows_title" "Buildings"
    "gml_include_items" "all"
    "gml_featureid" "fid"
    "gml_types" "auto"
    "oga_queryable_items" "all"
END
```

Without the changes in this pull request a query such as http://localhost:7000//timisoara/ogcapi/collections/buildings/items?f=json

will return the following error (as `"gml_featureid" "fid"` is not found):

```
{"code":"ServerError","description":"Error getting feature. Feature id not found."}
```

With the new `PROCESSING "OGR_EXPOSE_FID=TRUE"` the FID is now available, and can be used as the unique Id field, as labels, expressions etc.



To unsubscribe from these emails, change your notification settings at https://github.com/MapServer/MapServer/settings/notifications


More information about the MapServer-commits mailing list