[gdal-dev] OGR SQL: Excecuting select where column name contains "."
Odd Ragnar Lydersen
Odd-Ragnar.Lydersen at powel.no
Mon Oct 8 23:59:06 PDT 2012
Thanks for the response.
I think I will conclude the same as you, and report back to the server developers that this is a bad idea.
>Odd-Ragnar<
-----Original Message-----
From: Rahkonen Jukka [mailto:Jukka.Rahkonen at mmmtike.fi]
Sent: 8. oktober 2012 22:22
To: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] OGR SQL: Excecuting select where column name contains "."
Even Rouault wrote:
>> I can confirm that it is not illegal per se because the following
>> works. I hope that the backslashes and everything go through properly.
>
>> ogrinfo WFS:http://188.64.1.61/cgi-bin/tinyows
>> -sql "select \"nom.dept\" from \"tows:dot.test\""
>
>> It is an open WFS server and you can test it with ogrinfo and from
>> your code too. However, I will remove the dot.test feature type
>> sooner or later. Verify and make your code to work in a similar way than ogrinfo.
> Jukka,
> I didn't do any test up to now, but now that I've tested with your
> above server, here are my findings and conclusions.
> To start, I'm wondering to which extent did you check the result of
> the above ogrinfo command. It "works" for me on GDAL 1.9.2 and GDAL
> trunk on Linux and Windows, but the output is what Odd-Ragna actually observes, something like :
> FIELD_1: String (0.0)
I feel ashamed and made one more test to compansate my lazy interpretation that if TinyOWS is sending something back it is then all right.
HTTP POST tends to be more reliable when making complicated WFS requests so I tried that method by sending directly to the server the following GetFeature:
POST http://188.64.1.61/cgi-bin/tinyows HTTP/1.1
Content-Type: text/xml
User-Agent: Jakarta Commons-HttpClient/3.0-beta1
Host: 188.64.1.61
Connection: Keep-Alive
Content-Length: 404
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0" maxFeatures="1000" outputFormat="GML2"><wfs:Query xmlns:tows="http://www.tinyows.org/" typeName="tows:dot.test"><ogc:PropertyName>tows:nom.dept</ogc:PropertyName><ogc:PropertyName>tows:the_geom</ogc:PropertyName></wfs:Query></wfs:GetFeature>
TinyOWS gives an error
<?xml version="1.0" encoding="UTF-8"?>
<ServiceExceptionReport
xmlns="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wms/1.1.1/OGC-exception.xsd"
version="1.2.0">
<ServiceException code="NoMatching" locator="GetFeature"> propertyname values and typename values don't match</ServiceException> </ServiceExceptionReport>
There may be something wrong with TinyOWS but it must be noted that it has passed all the CITE tests for WFS 1.0.0 and 1.1.0. If so well tested server fails with dots in the field names it is very probable that there are lots of other servers and clients which will fail too.
Conclusion: Do not use dots in names if you hope it to work.
-Jukka-
More information about the gdal-dev
mailing list