<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi List,<br>
<br>
I have a PostGIS database.<br>
I have a point table representing plots.<br>
I have to select a plot using several fields :<br>
<ul>
<li>num_dep (string) : departement code,</li>
<li>nom_com (string) : city name,</li>
<li>section (string) : section number,</li>
<li>numero (string) : plot number.</li>
</ul>
I use MapServer 4.99 and Postgersql 8.1.<br>
<br>
All my fields are strings.<br>
Result of DescribeFeatureType request :<br>
<complexType name="bdparcellaire_numeroType"><br>
<complexContent><br>
<extension base="gml:AbstractFeatureType"><br>
<sequence><br>
<element name="geometry" type="gml:PointPropertyType"
minOccurs="0" maxOccurs="1"/><br>
<element name="code_dep" type="string"/><br>
<element name="nom_com" type="string"/><br>
<element name="section" type="string"/><br>
<element name="numero" type="string"/><br>
<element name="gid" type="string"/><br>
<element name="oid" type="string"/><br>
</sequence><br>
</extension><br>
</complexContent><br>
</complexType><br>
<br>
When I do a WFS GetFeature request, mapserver doesn't format correctly
strings fields that contains only numbers.<br>
Example : (to select the plot where num_dep='66' and nom_com='Baixas'
and section='0A' and numero='2651')<br>
<a class="moz-txt-link-freetext" href="http://mapserver_i2.cete-mediterranee.i2/maps/mapserv?map=%2Fdata%2Fcarto%2Fref%2Fbdparcellaire%2Fbdparcellaire_2007_iso.map&=&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=bdparcellaire_numero&FILTER=%28%3CFilter%3E%3CAnd%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Ecode_dep%3C%2FPropertyName%3E%3CLiteral%3E66%3C%2FLiteral%3E%3C%2FPropertyIsEqualTo%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Enom_com%3C%2FPropertyName%3E%3CLiteral%3EBaixas%3C%2FLiteral%3E%3C%2FPropertyIsEqualTo%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Esection%3C%2FPropertyName%3E%3CLiteral%3E0A%3C%2FLiteral%3E%3C%2FPropertyIsEqualTo%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Enumero%3C%2FPropertyName%3E%3CLiteral%3E2651%3C%2FLiteral%3E%3C%2FPropertyIsEqualTo%3E%3C%2FAnd%3E%3C%2FFilter%3E%29">http://mapserver_i2.cete-mediterranee.i2/maps/mapserv?map=%2Fdata%2Fcarto%2Fref%2Fbdparcellaire%2Fbdparcellaire_2007_iso.map&=&SERVICE=WFS&VERSION=1.0.0&REQUES
T=GetFeature&TYPENAME=bdparcellaire_numero&FILTER=%28%3CFilter%3E%3CAnd%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Ecode_dep%3C%2FPropertyName%3E%3CLiteral%3E66%3C%2FLiteral%3E%3C%2FPropertyIsEqualTo%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Enom_com%3C%2FPropertyName%3E%3CLiteral%3EBaixas%3C%2FLiteral%3E%3C%2FPropertyIsEqualTo%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Esection%3C%2FPropertyName%3E%3CLiteral%3E0A%3C%2FLiteral%3E%3C%2FPropertyIsEqualTo%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Enumero%3C%2FPropertyName%3E%3CLiteral%3E2651%3C%2FLiteral%3E%3C%2FPropertyIsEqualTo%3E%3C%2FAnd%3E%3C%2FFilter%3E%29</a><br>
<br>
For human people :<br>
map=/data/carto/ref/bdparcellaire/bdparcellaire_2007_iso.map&=<br>
&SERVICE=WFS<br>
&VERSION=1.0.0<br>
&REQUEST=GetFeature<br>
&TYPENAME=bdparcellaire_numero<br>
&FILTER=(<br>
<Filter><br>
<And><br>
<PropertyIsEqualTo><br>
<PropertyName>code_dep</PropertyName><br>
<Literal>66</Literal><br>
</PropertyIsEqualTo><br>
<PropertyIsEqualTo><br>
<PropertyName>nom_com</PropertyName><br>
<Literal>Baixas</Literal><br>
</PropertyIsEqualTo><br>
<PropertyIsEqualTo><br>
<PropertyName>section</PropertyName><br>
<Literal>0A</Literal><br>
</PropertyIsEqualTo><br>
<PropertyIsEqualTo><br>
<PropertyName>numero</PropertyName><br>
<Literal>2651</Literal><br>
</PropertyIsEqualTo><br>
</And><br>
</Filter>)<br>
<br>
MapServer sends this instruction to PostGIS :<br>
LOG: instruction : DECLARE mycursor BINARY CURSOR FOR SELECT
asbinary(force_collection(force_2d(the_geom)),'NDR'),oid::text from
(select code_dep, nom_com, section, numero, gid, the_geom, oid FROM
localisant) as foo WHERE ( (code_dep= 66) And ( (nom_com= 'Baixas')
And ( (section= '0A') And (numero= 2651) ) ) ) and (the_geom
&& setSRID( 'BOX3D(47650 1620400,1197850
2677450)'::BOX3D,27582) )<br>
<br>
We can see that code_dep and numero are not quoted. It's not a problem
in this example, but when I search the plot with the numero=0256,
search returned no results. The plot exists ! The right request in
PostGIS returns the plot.<br>
It seems that not '0256' is search but 256.<br>
Is it a bug ? I think so !<br>
For me it's very very very very disturbing.<br>
I can't use mapserver as a WFS server to select plot !<br>
I hope someone could help me !<br>
<br>
Regards<br>
<br>
Laurent<br>
</body>
</html>