[gdal-dev] Change in parsing of OGR where clause
Andrew Bell
andrew.bell.ia at gmail.com
Wed Apr 6 13:02:35 PDT 2016
In version 1.X of GDAL, the following was accepted and worked:
std::string query = "LOCATION=\"some text\"";
OGR_L_SetAttributeFilter(layer, query.c_str());
In version 2.X, this is no longer accepted and the double quotes must be
replaced by single quotes:
std::string query = "LOCATION='some text'";
OGR_L_SetAttributeFilter(layer, query.c_str());
This wouldn't be awful, but the error that occurs tells you nothing about
the actual problem. It yields:
"some text" not recognised as an available field.
Perhaps it should give a parsing error? In 1.11, parsing the query with
double quotes would yield an SNT_OPERATION node with subnodes SNT_COLUMN
and SNT_CONSTANT. In 2.0, the same query yields an SNT_OPERATION with two
SNT_COLUMN subnodes, which seems to cause the confusing error.
Should the parser accept column values with double quotes? If not, can it
provide better feedback?
--
Andrew Bell
andrew.bell.ia at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160406/1d128f10/attachment.html>
More information about the gdal-dev
mailing list