Skip to content

Simple search returns items onlly with properties.datetime field #642

Closed
@iliion

Description

@iliion

Dear all.
I have already opened an issue in stac-fastapi-elasticsearch repository and I will report it here as well. See issue.


Simple search http://localhost:8000/search?limit=10 returns items onlly with properties.datetime field

In particular in line
https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/blob/987f0b924b45e3f63302758b6e63d38ba504964f/stac_fastapi/core/stac_fastapi/core/core.py#L593C12-L593C64

filter_kwargs = search_request.fields.filter_fields

filter_fields is equal to

{'exclude': {}, 'include': {'assets': Ellipsis, 'bbox': Ellipsis, 'collection': Ellipsis, 'geometry': Ellipsis, 'id': Ellipsis, 'links': Ellipsis, 'properties': {'datetime'}, 'stac_version': Ellipsis, 'type': Ellipsis}}

As a response i get the FeatureCollection

{
  "type": "FeatureCollection",
  "features": [ {
    "type": "Feature",
    "properties": {
      "datetime": "2015-07-04T10:10:06.027000+00:00"
    },
    . . .
  ]
  . . .
}

Shouldnt the filter_kwargs` be equal to

{'exclude': {}, 'include': {'assets': Ellipsis, 'bbox': Ellipsis, 'collection': Ellipsis, 'geometry': Ellipsis, 'id': Ellipsis, 'links': Ellipsis, 'properties': Ellipsis, 'stac_version': Ellipsis, 'type': Ellipsis}}

FYI.
The item has the following properties

"properties": {
  "sat:relative_orbit": 22,
  "start_datetime": "2015-07-04T10:10:06.027Z",
  "end_datetime": "2015-07-04T10:10:06.027Z",
  "processing:facility": "EPA_",
  "title": "S2A_MSIL2A_20150704T101006_N0204_R022_T30NYK_20150704T102420.SAFE",
  "platform": "Sentinel-2A",
  "view:sun_elevation": 30.130819756471,
  "datetime": "2015-07-04T10:10:06.027Z",
  "instruments": [],
  "constellation": "sentinel-2",
  "sat:orbit_state": "descending",
  "eo:cloud_cover": 84.456044,
  "grid:code": "MGRS-30NYK",
  "processing:level": "L2A",
  "view:incidence_angle": 9.82920248878181,
  "created": "2019-08-05T14:29:54Z",
  "sentinel:product_id": "S2A_MSIL2A_20150704T101006_N0204_R022_T30NYK_20150704T102420",
  "view:sun_azimuth": 49.058168068692,
  "sentinel:datastrip_id": "S2A_USER_MSI_L2A_DS_EPA__20160808T224207_S20150704T102420_N02.04",
  "sentinel:processing_baseline": "02.04",
  "proj:bbox": [],
  "proj:epsg": 32630,
  "bdap:additional_attributes": {},
  "processed": "2019-08-05T14:53:58.579614Z",
  "mission": "Sentinel-2",
  "view:azimuth": 100.76592332834346,
  "gsd": 10,
  "sat:absolute_orbit": 162,
  "sentinel:acquisition_station": "EPA_"
}

Addendum:

I think it would be best to follow the STAC API specs https://api.stacspec.org/v1.0.0/item-search/ .

There are also implementations like STAC Browser that use the search endpoint in order to return items. As a user I would expect to see all the properties of an Item and filter them only if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions