Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to sort search serults#321

AnsweredbyStijnCaerts
piust asked this question inQ&A
Discussion options

Hello.

I am wondering if there is a way to sort the search result.
I tried to use the sintax of STAC-API Sort extension but the service answers with a 400 error.

Thank you.

S.
stac_example.json

You must be logged in to vote

Hi@piust, I had a look at your example and there are a few things that might need to be fixed:

  • properties.published is not a default field in STAC. You can take a look at thecreated/updated field
  • thesortby field should be an array of sort keys

I modified your example into a working query with sorting:

{"filter": {"op":"and","args": [      {"op":"and","args": [          {"op":"=","args": [              {"property":"properties.constellation"              },"sentinel-2"            ]          }        ]      },      {"op":">=","args": [          {"property"

Replies: 2 comments

Comment options

Hi@piust, I had a look at your example and there are a few things that might need to be fixed:

  • properties.published is not a default field in STAC. You can take a look at thecreated/updated field
  • thesortby field should be an array of sort keys

I modified your example into a working query with sorting:

{"filter": {"op":"and","args": [      {"op":"and","args": [          {"op":"=","args": [              {"property":"properties.constellation"              },"sentinel-2"            ]          }        ]      },      {"op":">=","args": [          {"property":"properties.updated"          },          {"timestamp":"2024-11-10T00:00:00.000Z"          }        ]      }    ]  },"collections": ["sentinel-2-l2a"  ],"fields": {"include": ["properties","geometry","type","id","bbox","stac_version","assets","collection"    ]  },"limit":100,"sortby": [    {"field":"properties.updated","direction":"desc"    }  ]}

I hope this helps!

You must be logged in to vote
0 replies
Answer selected bypiust
Comment options

Thank you@StijnCaerts. You are right. I Fixed it and now it works perfectly.

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@piust@StijnCaerts

[8]ページ先頭

©2009-2025 Movatter.jp