0

I Created one generic layer in the GeoServer for the open layer ( OL3) and add a few features in the same layer, I'm trying to do the spatial search but the call is not returning any features.

Here is the post-call I'm making to WFS ( Geoserver ) URL http://xyz:5002/geoserver/wfs

In Form Data we are sending query parameter

cql_filter : INTERSECTS(geometry,POLYGON((13.222566632788059 78.15759658813475,13.201844057837434 78.15141677856444,13.211202857957346 78.17956924438474,13.222900853445154 78.17888259887692,13.222566632788059 78.15759658813475)))

service : WFS

request : GetFeature

version :1.1.0

typename : layerName

outputFormat : json

srsname : EPSG:4326


The result I'm getting

{
    "type": "FeatureCollection",
    "features": [],
    "totalFeatures": 0,
    "numberMatched": 0,
    "numberReturned": 0,
    "timeStamp": "2022-02-03T09:23:51.415Z",
    "crs": null
}

Geoserver I'm using 2.20.2

Can anyone please let me know what is the mistake I'm doing when I doing the spatial search query

Harish CHH
  • 104
  • 11
  • Your SRS is EPSG:3857 but the filter coordinates look like EPSG:4326 – Mike Feb 03 '22 at 09:52
  • even if change to 4326 its not working – Harish CHH Feb 03 '22 at 09:55
  • as I said in https://stackoverflow.com/questions/70847313/open-layer-geoserver-spatial-search-not-working don't use form data you need to use get with KVP or POST with XML data – Ian Turton Feb 03 '22 at 12:18
  • Does this answer your question? [Open Layer ( Geoserver ) Spatial Search not working](https://stackoverflow.com/questions/70847313/open-layer-geoserver-spatial-search-not-working) – Ian Turton Feb 03 '22 at 12:18
  • I tried with XML payload in post method still same issue not getting empty features – Harish CHH Feb 03 '22 at 12:43
  • please [edit] your question with the corrected payload and the response from the server, and the relevant part of the log file – Ian Turton Feb 04 '22 at 16:39
  • when the layer data is stored in the PostGIS ( Postgres) CQL_FILTER is working but is when the layer is connected HANA DB CQL_FILTER is not working. connector I'm using to connect HANA DB is ( GT-JDBC-Hana 26.1.06 ) – Harish CHH Feb 07 '22 at 06:20
  • that is important information that needs to be in the question! Seems like a bug in the HANA module, try contacting SAP – Ian Turton Feb 09 '22 at 11:57

0 Answers0