feat: generate an OGC API – Moving Features OpenAPI projection (PR #5 follow-up)#13
Open
estebanzimanyi wants to merge 1 commit into
Open
feat: generate an OGC API – Moving Features OpenAPI projection (PR #5 follow-up)#13estebanzimanyi wants to merge 1 commit into
estebanzimanyi wants to merge 1 commit into
Conversation
…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.
8b7a86a to
efe2400
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacks on #5. Adds the OGC API – Moving Features (OGC 22-003r3) projection alongside the generic RPC-style
generate_openapi.pyso the catalog has two complementary OpenAPI views:generator/openapi.py, PR feat: generate an OpenAPI 3.1 contract from the enriched catalog #5): every stateless-exposable MEOS function as onePOST /{function}RPC operation. Faithful to MEOS's value-algebra shape but not OGC-aligned.x-meos-{function,decode,encode}extensions on every route so a downstream OGC server can dispatch to MEOS without re-deriving the mapping.Files
generator/movfeat.pybuild_movfeat_openapi(catalog); reuses_value_schema/_type_schema/_enum_schemafromgenerator/openapi.pyso component schemas are byte-identical across the two projections.generate_movfeat_openapi.pypython generate_movfeat_openapi.py [in.json] [out.json]reads the enriched catalog and writesoutput/meos-movfeat-openapi.json.Routes covered
/collections/collections/{collectionId}/collections/{collectionId}/items/collections/{collectionId}/itemstemporal_from_mfjson/collections/{collectionId}/items/{featureId}temporal_as_mfjson/collections/{collectionId}/items/{featureId}/collections/{collectionId}/items/{featureId}/tgsequencetemporal_as_mfjson/.../tgsequence/velocitytpoint_speed/.../tgsequence/accelerationtemporal_derivative/.../tgsequence/distancetpoint_cumulative_length/.../tgsequence/azimuthtpoint_azimuth/.../tproperty/{propertyName}temporal_as_mfjson/.../tproperty/{propertyName}The MEOS functions referenced are all present in the MobilityDB master catalog (verified against
vendor/meos-api/meos-idl.jsonfrom MobilityAPI #4). Routes whose MEOS function is absent are tracked in the output document'sinfo.x-meos-coverage.missing_in_catalogso consumers know what's not yet backed.Dependency chain
generate_openapi.py+generator/openapi.py) — reuses the helpers.parser/enrich.py) at runtime — the generator needs an enriched catalog (network/wire/typeEncodingsfields). When feat: derive service-projection metadata for the catalog #4 + feat: generate an OpenAPI 3.1 contract from the enriched catalog #5 reach master, this PR's diff narrows to just the two new files.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-encodeextensions are the contract MobilityAPI dispatches against.