[gdal-dev] A CSW query that seems to me works badly

Even Rouault even.rouault at spatialys.com
Wed Nov 16 02:51:27 PST 2022


Hi,
> I need to run a CSW query using exact strings.
>
> Via curl it's in this way '<ogc:Literal>"Impianti e strutture 
> ricettive"</ogc:Literal>' (using the double quotes inside):

hum, well you actually hit a bug in the OGR OGC Filter code I've just 
fixed per https://github.com/OSGeo/gdal/pull/6713

With the fix the query sent is now:

HTTP: These POSTFIELDS were sent:<?xml version="1.0" 
encoding="UTF-8"?><csw:GetRecords resultType="results" service="CSW" 
version="2.0.2" startPosition="1" maxRecords="500" 
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" 
xmlns:gml="http://www.opengis.net/gml" 
xmlns:dc="http://purl.org/dc/elements/1.1/" 
xmlns:dct="http://purl.org/dc/terms/" 
xmlns:ogc="http://www.opengis.net/ogc" 
xmlns:ows="http://www.opengis.net/ows" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 
http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd"><csw:Query 
typeNames="csw:Record"><csw:ElementSetName>full</csw:ElementSetName><csw:Constraint 
version="1.1.0"><ogc:Filter><ogc:PropertyIsLike wildCard='*' 
singleChar='_' escapeChar='!' 
matchCase='true'><ogc:PropertyName>dct:abstract</ogc:PropertyName><ogc:Literal>"Impianti 
e strutture 
ricettive"</ogc:Literal></ogc:PropertyIsLike></ogc:Filter></csw:Constraint></csw:Query></csw:GetRecords>

That returns zero feature. That said, I'm not sure that is what you want 
to do, since the server should really look for a dc:subject whose value 
is "Impianti e strutture ricettive", with the double quotes.

Probably -where "abstract = 'Impianti e strutture ricettive'"  is more 
what you want. But that returns also 0 features

Even

-- 
http://www.spatialys.com
My software is free, but my time generally not.



More information about the gdal-dev mailing list