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

STAC Search implementation #3

Open
tik65536 opened this issue Mar 13, 2024 · 6 comments
Open

STAC Search implementation #3

tik65536 opened this issue Mar 13, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@tik65536
Copy link
Collaborator

Currently when using QGIS , the search function is missing from the pygeoapi as following screen cap.

image

@tik65536 tik65536 added the enhancement New feature or request label Mar 13, 2024
@tik65536
Copy link
Collaborator Author

Reference for API implementation :
https://api.stacspec.org/v1.0.0-rc.1/item-search/#tag/Item-Search

@tik65536
Copy link
Collaborator Author

tik65536 commented Mar 15, 2024

During the implementation, it was found that for items with pystac generated with catalog type = "Relative Path", the pystac validator in qgis plug-in will complain abt the item's collection link is in relative path format without "self" defined, which cause error after clicking search in the STAC api browser.

  1. pstac with relative path will generate self rel for catalog and collections but not items, try with abs path, it doesn't fit pygeoapi
  2. So the self link is added back from hateoas.py as follow :

image

@tik65536
Copy link
Collaborator Author

tik65536 commented Mar 15, 2024

When click on the item from the QGIS , it cause the following error :

image

After checking the plugin, it was found that the item had 2 assets attached, but from the original STAC json , only one is found ( the image) , the following screen cap from QGIS log shows the additional asset is with type=None .
image

Going back to the hateoas.py, the additional "default" element is add by the function _modify_content_for_display.

image

SInce it is for html display and to maintain consistency, the changes is suggested to be done in api.py to change if the heard application is HTML , if not , will remove it from the asset.

api.py - get_stac_path
image

Update - It is not necessary to modify either api.py or hateoas.py , as the search api is a separated function, we can modify the assets return inside the search api without touching the original design.

@tik65536
Copy link
Collaborator Author

intermediate Result on Search API

image

image

image

Error while clicking add to layer :

image

@tik65536
Copy link
Collaborator Author

The last mile .......

image

Possible to change the QGIS STAC API assets_diaglog.py to visgs ?
image

@tik65536
Copy link
Collaborator Author

After changing the stac plugin , those geotiff is able to download to QGIS .

image

image

image

tik65536 pushed a commit that referenced this issue Mar 18, 2024
	Issue #3
	1. implementation of search api
	modified:   pygeoapi/api.py
	modified:   pygeoapi/flask_app.py
	modified:   pygeoapi/openapi.py
	modified:   pygeoapi/provider/hateoas.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant