Skip to content

OGC API Features - Part 5 : implement /collections/{collid}/schema and /collections/{collid}/sortables API calls - #7443

Merged
rouault merged 6 commits into
MapServer:mainfrom
rouault:ogcapi_part5_schema
Mar 9, 2026
Merged

rouault merged 6 commits into
MapServer:mainfrom
rouault:ogcapi_part5_schema

Conversation

@rouault

@rouault rouault commented Feb 25, 2026 •

Copy link
Copy Markdown
Contributor
  • Elements returned in /schema are those determined by existing
    [oga]_include_items and [oga]_exclude_items metadata items.

  • Elements returned in /sortables are those listed in a new
    "oga_sortable_items" whose value is "all" or a comma separated list of
    items. If not specified, defaults to no sortable items.

  • Implement the 'sortby=[+-]?' query parameters of
    /collections/{collid}/items (draft Part 8 - Sortables)

(on top of PR #7440 )

New query parameters: filter, filter-lang and filter-crs

New layer metadata:
- "oga_geometry_name": geometry field name. Defaults to 'geom'
- "oga_geometry_type": among "geometry-point", "geometry-multipoint",
  "geometry-linestring", "geometry-multilinestring", "geometry-polygon",
  "geometry-multipolygon", and "geometry-geometrycollection".
  Or "geometry-any" which is the default
@rouault rouault added this to the 8.8.0 Release milestone Feb 25, 2026
…d /collections/{collid}/sortables API calls

- Elements returned in /schema are those determined by existing
  [oga]_include_items and [oga]_exclude_items metadata items.

- Elements returned in /sortables are those listed in a new
  "oga_sortable_items" whose value is "all" or a comma separated list of
  items. If not specified, defaults to no sortable items.

- Implement the 'sortby=[+-]?<item-name>' query parameters of
  /collections/{collid}/items (draft Part 8 - Sortables)
@geographika

Copy link
Copy Markdown
Member

@rouault - amazing work, and great to get this in to MapServer. I've been testing out the 3 PRs altogether, and will add all comments to this PR.

(for my reference) - to build:

# Start from PR #7436
git fetch origin pull/7436/head:pr-7436
git checkout pr-7436

# add #7440
git fetch origin pull/7440/head:pr-7440
git merge pr-7440

# add #7443
git fetch origin pull/7443/head:pr-7443
git merge pr-7443

Initial notes from testing below:

Schemas (schema?f=json):

For geometry fields, we can customise the field name and format:

LAYER
  METADATA
            "oga_geometry_format" "geometry-linestring"
            "oga_geometry_name" "mygeom"
..
    "mygeom": {
      "description": "The geometry of the collection.",
      "format": "geometry-linestring",
      "title": "mygeom",
      "x-ogc-role": "primary-geometry"
    },
  • Would it be appropriate to try and map a MapServer LAYER TYPE automatically rather than rely solely on oga_geometry_format? Or fallback to gml_geom_type?
  • We already lookup the msOWSLookupMetadata(&(layer->metadata), "AGFO", "featureid"); - should this field be given an additional "x-ogc-role": "id" property?

CQL2

When testing querying for this Boolean field:

    "isAbandoned": {
      "description": "Queryable item 'isAbandoned'",
      "type": "boolean"
    },
  • items?isAbandoned=true works
  • items?filter=isAbandoned=1 - works-
  • items?filter=isAbandoned=true - fails
{"code":"InvalidParameterValue","description":"Cannot parse filter: CQL2Text Expression Parsing Error: syntax error, unexpected true. Occurred around :\nisAbandoned=true\n            ^"}

Other

The following bootstrap templates are required (I can look at adding these in a follow-up PR):

  • collection-queryables.html
  • collection-schema.html
  • collection-sortables.html

Several of the conformance links return 404s - I presume beause parts 5 and 8 are still in draft. E.g http://www.opengis.net/spec/ogcapi-features-5/1.0/conf/queryables

@rouault

rouault commented Mar 5, 2026

Copy link
Copy Markdown
Contributor Author
  • Would it be appropriate to try and map a MapServer LAYER TYPE automatically rather than rely solely on oga_geometry_format? Or fallback to gml_geom_type?

done in e14a55a

should this field be given an additional "x-ogc-role": "id" property?

done in 31405ea

items?filter=isAbandoned=true - fails

fixed in f3f7a79

The following bootstrap templates are required (I can look at adding these in a follow-up PR):

added in 5166f66

@rouault
rouault merged commit 1496819 into MapServer:main Mar 9, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants