Skip to content

catch EDR instance queries in Starlette#2317

Merged
tomkralidis merged 1 commit intomasterfrom
starlette-edr-instances
Apr 17, 2026
Merged

catch EDR instance queries in Starlette#2317
tomkralidis merged 1 commit intomasterfrom
starlette-edr-instances

Conversation

@tomkralidis
Copy link
Copy Markdown
Member

Overview

This PR handles Starlette greedy routing for EDR instance queries.

Related Issue / discussion

Additional information

None

Dependency policy (RFC2)

  • I have ensured that this PR meets RFC2 requirements

Updates to public demo

Contributions and licensing

(as per https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md#contributions-and-licensing)

  • I'd like to contribute [feature X|bugfix Y|docs|something else] to pygeoapi. I confirm that my contributions to pygeoapi will be compatible with the pygeoapi license guidelines at the time of contribution
  • I have already previously agreed to the pygeoapi Contributions and Licensing Guidelines

@tomkralidis tomkralidis added this to the 0.24.0 milestone Apr 16, 2026
@tomkralidis tomkralidis requested a review from a team April 16, 2026 12:12
@tomkralidis tomkralidis added bug Something isn't working OGC API - Environmental Data Retrieval OGC API - Environmental Data Retrieval labels Apr 16, 2026
Comment thread pygeoapi/starlette_app.py
Comment on lines 523 to 532
if 'collection_id' in request.path_params:
collection_id = request.path_params['collection_id']

if '/instances/' in collection_id:
tokens = collection_id.split('/instances/')
collection_id = tokens[0]
instance_id = tokens[-1]

if 'instance_id' in request.path_params:
instance_id = request.path_params['instance_id']
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this function make use of collection_id, instance_id, location_id? or are they provided as expected inputs that L523-532 resolves from the request parameters?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moreover, what is the circumstance in which instance_id is derived from this PR instead of the subsequent lines that parse the Route params for instance_id

    if 'instance_id' in request.path_params:
        instance_id = request.path_params['instance_id']

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moreover, what is the circumstance in which instance_id is derived from this PR instead of the subsequent lines that parse the Route params for instance_id

    if 'instance_id' in request.path_params:
        instance_id = request.path_params['instance_id']

instance_id is utilizied in the above when the route is /collections/{collection_id}/instances/{instance_id}.

When the route is /collections/{collection_id}/instances/{instance_id}/position (or other instance_id based query types), instance_id is not picked up, which is what this PR fixes for the EDR query type routing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh:
path returns the rest of the path, including any additional / characters.

@tomkralidis tomkralidis merged commit e80347d into master Apr 17, 2026
9 checks passed
@tomkralidis tomkralidis deleted the starlette-edr-instances branch April 17, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working OGC API - Environmental Data Retrieval OGC API - Environmental Data Retrieval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants