Skip to content

feat: generate an OGC API – Moving Features OpenAPI projection (PR #5 follow-up)#13

Open
estebanzimanyi wants to merge 1 commit into
feat/openapi-generatorfrom
feat/movfeat-openapi-generator
Open

feat: generate an OGC API – Moving Features OpenAPI projection (PR #5 follow-up)#13
estebanzimanyi wants to merge 1 commit into
feat/openapi-generatorfrom
feat/movfeat-openapi-generator

Conversation

@estebanzimanyi
Copy link
Copy Markdown
Member

Stacks on #5. Adds the OGC API – Moving Features (OGC 22-003r3) projection alongside the generic RPC-style generate_openapi.py so the catalog has two complementary OpenAPI views:

  • Generic (generator/openapi.py, PR feat: generate an OpenAPI 3.1 contract from the enriched catalog #5): every stateless-exposable MEOS function as one POST /{function} RPC operation. Faithful to MEOS's value-algebra shape but not OGC-aligned.
  • MovFeat (this PR): only the MEOS functions with an OGC analogue, placed under the OGC-defined REST resource hierarchy. x-meos-{function,decode,encode} extensions on every route so a downstream OGC server can dispatch to MEOS without re-deriving the mapping.

Files

File Role
generator/movfeat.py OGC API – Moving Features path map (~16 routes) + build_movfeat_openapi(catalog); reuses _value_schema / _type_schema / _enum_schema from generator/openapi.py so component schemas are byte-identical across the two projections.
generate_movfeat_openapi.py Top-level script: python generate_movfeat_openapi.py [in.json] [out.json] reads the enriched catalog and writes output/meos-movfeat-openapi.json.

Routes covered

OGC path Method MEOS function OGC operation
/collections GET, POST — (persistence-layer) List / create collections
/collections/{collectionId} GET, PUT, DELETE Get / replace / delete collection
/collections/{collectionId}/items GET List items
/collections/{collectionId}/items POST temporal_from_mfjson Create item from MF-JSON
/collections/{collectionId}/items/{featureId} GET temporal_as_mfjson Retrieve item as MF-JSON
/collections/{collectionId}/items/{featureId} DELETE Delete item
/collections/{collectionId}/items/{featureId}/tgsequence GET temporal_as_mfjson Full trajectory geometry
/.../tgsequence/velocity GET tpoint_speed Velocity profile
/.../tgsequence/acceleration GET temporal_derivative Acceleration profile
/.../tgsequence/distance GET tpoint_cumulative_length Distance profile
/.../tgsequence/azimuth GET tpoint_azimuth Azimuth profile
/.../tproperty/{propertyName} GET temporal_as_mfjson Temporal property
/.../tproperty/{propertyName} DELETE Delete property

The MEOS functions referenced are all present in the MobilityDB master catalog (verified against vendor/meos-api/meos-idl.json from MobilityAPI #4). Routes whose MEOS function is absent are tracked in the output document's info.x-meos-coverage.missing_in_catalog so consumers know what's not yet backed.

Dependency chain

Downstream consumer

MobilityAPI's ingestion plan, step 5 replaces 5 hand-written endpoint modules with thin dispatchers over the route map this PR produces. The x-meos-function / x-meos-decode / x-meos-encode extensions are the contract MobilityAPI dispatches against.

…follow-up)

Adds 'generator/movfeat.py' and 'generate_movfeat_openapi.py' as a
second OpenAPI projection alongside the generic RPC-style projection
in 'generator/openapi.py'.

The MovFeat projection maps the subset of MEOS functions that have an
OGC API – Moving Features (OGC 22-003r3) analogue onto the
OGC-defined REST resource hierarchy under
'/collections/{collectionId}/items/{featureId}/…'. Each route carries
'x-meos-{function,decode,encode}' extensions so a downstream OGC
server (MobilityAPI, in this ecosystem) can dispatch each call to the
right MEOS function without re-deriving the mapping.

Reuses the _value_schema / _type_schema / _enum_schema helpers from
'generator/openapi.py' so component schemas and the MeosError
response are byte-identical across the two projections. Smoke-tested
locally on the catalog produced by 'run.py' against MobilityDB master
headers: 10 paths, 5/6 unique MEOS function dependencies present in
the catalog (temporal_as_mfjson, temporal_from_mfjson, tpoint_speed,
temporal_derivative, tpoint_cumulative_length, tpoint_azimuth).

Closes the 'OGC API – Moving Features resource projection' natural
follow-up named in PR #5's body. The MobilityAPI ingestion plan
(MobilityAPI #3, step 5) consumes this projection.
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.

1 participant