Hi Kylli,
thanks for sharing. And yes, indeed, your previous attempt was based on an
outdated version of CQL2.
For reference, here is the current schema for it:
https://github.com/opengeospatial/ogcapi-features/blob/master/cql2/standard/schema/cql2.json#L87
The draft standard is also available here:
https://docs.opengeospatial.org/DRAFTS/21-065.html

Mind CQL2 is still being modified, the syntax is still being modified, and
the GeoServer implementation
will likely lag behind until they get to a finalized version.

Cheers
Andrea



On Wed, Feb 1, 2023 at 8:16 AM Kylli Ek <kylli...@csc.fi> wrote:

> Hi,
>
> I found a solution myself, writing it down here, so that somebody next
> could find it.
>
> {"limit": 1, "datetime": "2021-08-01T00:00:00Z/2022-12-01T23:59:59Z",
> "collections": ["sentinel2_full_test"], "filter": {"op": *"lte"*, "args":
> [{"property": "eo:cloud_cover"}, 10]}, "filter-lang": "cql2-json"}
>
> .. has to be changed to
>
> {"limit": 1, "datetime": "2021-08-01T00:00:00Z/2022-12-01T23:59:59Z",
> "collections": ["sentinel2_full_test"], "filter": {"op": *"<"*, "args":
> [{"property": "eo:cloud_cover"}, 10]}, "filter-lang": "cql2-json"}
>
>
> Kylli
>
> ------------------------------
> *From: *"Kylli Ek" <kylli...@csc.fi>
> *To: *"geoserver-users" <geoserver-users@lists.sourceforge.net>
> *Sent: *Tuesday, 24 January, 2023 13:46:48
> *Subject: *[Geoserver-users] STAC filtering
>
> Hi,
>
> We have been testing GeoServer STAC and have got it mostly working:
> http://86.50.229.158:8080/geoserver/ogc/stac/
> The last minor problem is that search with a filter does not work,
> although conformance page gives hope for that:
> http://86.50.229.158:8080/geoserver/ogc/stac/conformance?f=text%2Fhtml
>
> Also collections Queryables page looks ok:
>
> http://86.50.229.158:8080/geoserver/ogc/stac/collections/sentinel2_full_test/queryables
>
>
> We have been testing mostly with pystac-client Python package, but the
> same error is given by API request:
>
> http://86.50.229.158:8080/geoserver/ogc/stac/search?f=application%2Fgeo%2Bjson
> POST
> {"limit": 1, "datetime": "2021-08-01T00:00:00Z/2022-12-01T23:59:59Z",
> "collections": ["sentinel2_full_test"], "filter": {"op": "lte", "args":
> [{"property": "eo:cloud_cover"}, 10]}, "filter-lang": "cql2-json"}
>
> The error in the log is:
> 24 Jan 11:26:35 ERROR  [geoserver.ogcapi] - Failed to dispatch API request
> java.lang.NullPointerException
> at
> org.geoserver.ogcapi.stac.TemplatePropertyMapper.mapFilter(TemplatePropertyMapper.java:142)
> at
> org.geoserver.ogcapi.stac.TemplatePropertyMapper.mapPropertiesInternal(TemplatePropertyMapper.java:59)
> at
> org.geoserver.ogcapi.stac.TemplatePropertyMapper.mapProperties(TemplatePropertyMapper.java:49)
> at
> org.geoserver.ogcapi.stac.QueryResultBuilder.parseFilter(QueryResultBuilder.java:508)
> at
> org.geoserver.ogcapi.stac.QueryResultBuilder.build(QueryResultBuilder.java:301)
> at org.geoserver.ogcapi.stac.STACService.searchPost(STACService.java:480)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at
> org.geoserver.ogcapi.APIConfigurationSupport$APIInvocableHandlerMethod.doInvoke(APIConfigurationSupport.java:64)
> at
> org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
> at
> org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)
> at
> org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:878)
> at
> org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:792)
> at
> org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
> at
> org.geoserver.ogcapi.APIDispatcher.handleRequestInternal(APIDispatcher.java:284)
> at
> org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:177)
> at
> org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:52)
> at
> org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1043)
> at
> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
> at
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
> at
> org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:696)
>
> We have been removing fields from default database and from default
> templates, but basic search is working ok, for example POST with
> {"limit": 1, "datetime": "2021-08-01T00:00:00Z/2022-12-01T23:59:59Z",
> "collections": ["sentinel2_full_test"], "intersects": {"type": "Point",
> "coordinates": [25.6, 65.1]}}
>
> So I am not sure where to look next.. Any ideas?
> In Global Queryables we have at the moment:
> id, geometry, eo:cloud_cover
>
> Not actually sure, what should be used here, DB field names or STAC
> attribute names or some EO-Search names.
>
> **
> A comment about EO-search packaging, it seems that gt-cql-json-28.0.jar
> is required by 2.22.0 GeoServer, but that .jar is currently not included in
> GeoServer packages, so I added it manually added from GeoTools
> https://sourceforge.net/projects/geotools/files/GeoTools%2028%20Releases/28.0/
> Best regards,
> Kylli Ek
>
> GIS-coordinator
> CSC - IT Center for Science Ltd
> PL 405, 02101 Espoo
> Tel: +358 50 38 12 838
> gisco...@csc.fi
>
>
> _______________________________________________
> Geoserver-users mailing list
>
> Please make sure you read the following two resources before posting to
> this list:
> - Earning your support instead of buying it, but Ian Turton:
> http://www.ianturton.com/talks/foss4g.html#/
> - The GeoServer user list posting guidelines:
> http://geoserver.org/comm/userlist-guidelines.html
>
> If you want to request a feature or an improvement, also see this:
> https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
>
>
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
> _______________________________________________
> Geoserver-users mailing list
>
> Please make sure you read the following two resources before posting to
> this list:
> - Earning your support instead of buying it, but Ian Turton:
> http://www.ianturton.com/talks/foss4g.html#/
> - The GeoServer user list posting guidelines:
> http://geoserver.org/comm/userlist-guidelines.html
>
> If you want to request a feature or an improvement, also see this:
> https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
>
>
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>


-- 

Regards,

Andrea Aime

==
GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax:     +39 0584 1660272

mob:   +39  339 8844549

https://www.geosolutionsgroup.com/

http://twitter.com/geosolutions_it

-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
precisa che ogni circostanza inerente alla presente email (il suo
contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is
addressed and may contain information that is privileged, confidential or
otherwise protected from disclosure. We remind that - as provided by
European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
e-mail or the information herein by anyone other than the intended
recipient is prohibited. If you have received this email by mistake, please
notify us immediately by telephone or e-mail
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to