Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Collection as output #7

Open
fabricebrito opened this issue Oct 17, 2024 · 4 comments
Open

Feature Collection as output #7

fabricebrito opened this issue Oct 17, 2024 · 4 comments

Comments

@fabricebrito
Copy link
Contributor

@rconway in commit 4de092c you introduced pystac.ItemCollection as output.

What is the rational?

@rconway
Copy link
Contributor

rconway commented Oct 17, 2024

@fabricebrito
This commit did not introduce the ItemCollection as output - this was already the case before the commit...

The goal of this commit was regarding the stage-out S3 location - with additional logic to either use the workspace storage or to fall back to the S3 details provided by the passed in environment variables...

Looks like the ItemCollection fix was initiated here - c51772d

I think this was an attempt to 'make it work' during integration - i.e. the stageout was failing with exceptions and this solved the exceptions. It was trying to be equivalent to what was there before - i.e. not change behaviour.

Note that the return of the feature_collection goes back before these fixes -

outputs["stac"]["value"] = execution_handler.feature_collection

The origin seems to be here - dd435f1#diff-ff92bc281255f901080e4a4dabb6ecca853909ede8cf01bca6a05d3249a529dcR368

@fabricebrito
Copy link
Contributor Author

The origin seems to be here - dd435f1#diff-ff92bc281255f901080e4a4dabb6ecca853909ede8cf01bca6a05d3249a529dcR368

This actually returns the URL of the collection while your commits provide an inline feature collection and this is what I wanted to understand.

I've implemented the same approach here: https://github.com/eoap/zoo-service-template/blob/b6144a91781092c3b83b3e29034ed39ac27c759f/%7B%7Bcookiecutter.service_name%7D%7D/service.py#L104-L155 (in the context of the https://github.com/eoap/ogc-api-processes-with-zoo/ e-learning module)

client wise it's quite easy to consume/understand the results but was wondering about the rationale behind this approach

@rconway
Copy link
Contributor

rconway commented Oct 17, 2024

I don't think there was a rationale. More likely a misunderstanding of what was being returned in the first place.

Is this not returning a Collection (json) rather than a URL...

self.feature_collection = requests.get(f"https://workspace-api.{self.domain}/workspaces/{self.workspace_prefix}-{decoded['user_name']}/collections/{collection.id}", headers=headers).json()

@rconway
Copy link
Contributor

rconway commented Oct 17, 2024

Perhaps the real question is what should be returned - e.g. according to the standard / best practice?

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

No branches or pull requests

2 participants