Hi, Yes, the request is url-encoded. The ECQL parser (geoserver log level==debug) gives "..5918, VERSION=1.1.1, SERVICE=WMS, TRANSPARENT=true, CQL_FILTER='Datafångstmetod' = 'Karta över Hagbysjön och Borsten 1950. Handdig'}" and the postgresql logs "..FROM "public"."sokvyx_djupdata_djuppunkter_vy_2" WHERE 0 = 1" instead of "WHERE <proper statement>" when we enclose the attribute and value in single quotation marks. And we then receive a WMS image without features. (If use double quotation marks the Geoserver debug log mentions that the filter could not be parsed). So it looks right from Geoservers debug logs but evidently the right WHERE isn't sent to postgresql (or postresql doesn't throw an error for this but merely "WHERE 0 = 1")
It's the same for attributes with a space in the name as with high ASCIIS like "Datafångstmetod". (These queries work well when put directly to postgresql) I saw this thread http://osgeo-org.1560.x6.nabble.com/ECQL-with-space-in-attribute-name-td5311652.html which indicates that at least spaces in attribute names are impossible for ecql, period, so maybe this is the case and the same for high ASCIIS? Regards On Thu, Apr 22, 2021 at 4:42 PM Ian Turton <ijtur...@gmail.com> wrote: > Did you try urlencoding the filter? in general it's a bad idea to have > spaces in your table or column names. Failing that, you'll need to look at > the log file and see if the request is failing in the ECQL parser or the > query sent to PostGIS. > > Ian > > On Thu, 22 Apr 2021 at 15:14, David Persson <persso...@gmail.com> wrote: > >> Hi, >> >> We've published layers in geoserver based on postgresql views where some >> columns contain spaces and å ä ö currently. Right now we are trying to >> employ ecql filters with getMap requests and are finding it hard/impossible >> to receive an expected reply when the query contains an attribute (column >> name in the view / property) that contains å ä ö or a space. >> >> We've tried a number of combinations with single and double quotes around >> the property and property + value . If the property has single quotation >> marks aroun, or the property and value have single quotations around them, >> the getmap is succesfull but the image returned contains no features even >> if expected to have them. >> >> If seemingly any combination of double quotation marks ( " ) are employed >> we get an ecql exception. >> >> (spaces and high asciis are okay as values to search for) >> >> Is there any way to filter a getMap on a property that contains spaces or >> high ASCIIs? >> >> Friendly regards, >> David. >> _______________________________________________ >> 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 >> > > > -- > Ian Turton >
_______________________________________________ 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