<div dir="ltr"><div><div><div><div><div>Hi Jukka,<br><br>after an update I try using<br><br></div>'default_idtpn'  'S%'<br><br></div>and surprising me it work !<br></div><div><br></div>Meanwhile I try to define the default as a simply %<br>
<br>'default_idtpn'  '%'<br><br></div>but it don't work.<br><br></div>So it need not only a text field but a text field starting with a character. Very rarely situation in our primarykey fields. :(<br>
<div><br></div><div>Thx for support,<br><br>Andrea.<br><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/4 Rahkonen Jukka <span dir="ltr"><<a href="mailto:jukka.rahkonen@mmmtike.fi" target="_blank">jukka.rahkonen@mmmtike.fi</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Andrea,<br>
<br>
Could you make test by using something else than '9%' as variable default value, for example 'K9%'?  We have had troubles with selecting atrribute values like "04.186.1.004" with SLD_BODY. We had to update the attributes into "K04.186.1.004" for making filtering to work.  Obviously Mapserver was surprised in seeing two dots in a string that starts with a numeric character. Your type mismatch error makes me wonder if there could be something similar in your case.<br>

<br>
-Jukka Rahkonen-<br>
<br>
<br>
________________________________<br>
<div class="im">Andrea Peri wrote:<br>
<br>
> Thx Steve.<br>
<br>
> It work ,<br>
<br>
> Just to do a step forward I try also to define as default a wildcard<br>
> using this sintax<br>
<br>
> I try settings like this:<br>
<br>
> FILTER "WHERE ID_ING = '%idtpn%' "<br>
<br>
> metadata<br>
>   'default_idtpn' '9%'<br>
...<br>
<br>
> But the mapserver return an error.<br>
<br>
> msOGRFileWhichShapes(): OGR error. SetAttributeFilter(ID_ING LIKE '9%') failed on layer rt_speleologia.idingrotte.rt.<br>
> Type mismatch or improper type of arguments to LIKE operator.<br>
<br>
> Reading the gdal/ogr documentation this sintax should be allowed in the OGRSQL. I use gdal 1.9.1 and it seem to support the wildcard option.<br>
> So perhaps this could be a real bug of gdal.<br>
> I ask to gdal ML.<br>
<br>
<br>
<br>
</div>2013/4/4 Lime, Steve D (MNIT) <<a href="mailto:Steve.Lime@state.mn.us">Steve.Lime@state.mn.us</a><mailto:<a href="mailto:Steve.Lime@state.mn.us">Steve.Lime@state.mn.us</a>>><br>
<div class="im">Filter should look like:<br>
<br>
  FILTER (ID_ING = '%idtpn%' )<br>
<br>
If MapServer is to execute it, or:<br>
<br>
  FILTER "WHERE ID_ING = '%idtpn%' "<br>
<br>
If OGR is to execute it.<br>
<br>
Steve<br>
<br>
</div>From: <a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a><mailto:<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a>> [mailto:<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a><mailto:<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a>>] On Behalf Of Andrea Peri<br>

<div class="im">Sent: Thursday, April 04, 2013 8:26 AM<br>
</div>To: <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><mailto:<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>><br>
<div class="HOEnZb"><div class="h5">Subject: [mapserver-users] How use the filteritem with a ogr spatialite db<br>
<br>
Hi,<br>
<br>
I'm try-ing to apply a filter to a spatialite db by ogr .<br>
I try this<br>
<br>
    CONNECTIONTYPE OGR<br>
    CONNECTION "/.../tematici.sqlite"<br>
    DATA "select PK_UID,ID_ING,ID_GRO,NUMERO,NOME,CODCOM,COMUNE,ANNO,DATA_AGG,SCHEDA,RILIEVO,CGBEST,CGBNORD,GEOMETRY from SPELEOLOGIA_INGRESSI_GROTTE"<br>
    FILTER "(ID_ING = '%idtpn%' )"<br>
    FILTERITEM 'ID_ING'<br>
    VALIDATION<br>
      'idtpn' '^[a-zA-Z0-9\-_]+$'<br>
    END<br>
    .....<br>
    METADATA<br>
      'default_idtpn' '901707'<br>
       .....<br>
But it don't work.<br>
There is some sample of filter usage with ogr format ?<br>
<br>
thx,<br>
<br>
<br>
--<br>
-----------------<br>
Andrea Peri<br>
. . . . . . . . .<br>
qwerty àèìòù<br>
-----------------<br>
<br>
<br>
<br>
--<br>
-----------------<br>
Andrea Peri<br>
. . . . . . . . .<br>
qwerty àèìòù<br>
-----------------<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>-----------------<br>Andrea Peri<br>. . . . . . . . . <br>qwerty àèìòù<br>-----------------<br>
</div>