LandscapeGeoinformatics / pygeoapi

pygeoapi is a Python server implementation of the OGC API suite of standards. The project emerged as part of the next generation OGC API efforts in 2018 and provides the capability for organizations to deploy a RESTful OGC API endpoint using OpenAPI, GeoJSON, and HTML. pygeoapi is open source and released under an MIT license.
https://pygeoapi.io
MIT License
0 stars 0 forks source link

STAC Search implementation #3

Open tik65536 opened 6 months ago

tik65536 commented 6 months ago

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

image

tik65536 commented 6 months ago

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

tik65536 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

intermediate Result on Search API

image

image

image

Error while clicking add to layer :

image

tik65536 commented 6 months ago

The last mile .......

image

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

tik65536 commented 6 months ago

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

image

image

image