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" <[email protected]>
To: "geoserver-users" <[email protected]>
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 |
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
|
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
|
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
[email protected]
_______________________________________________
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
[email protected]
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users