[mapserver-users] How use the filteritem with a ogr spatialite db

Andrea Peri aperi2007 at gmail.com
Thu Apr 4 11:30:56 PDT 2013


Thx Steve.

It work ,

Just to do a step forward I try also to define as default a wildcard
using this sintax

I try settings like this:

FILTER "WHERE ID_ING = '%idtpn%' "

metadata
  'default_idtpn' '9%'
...

But the mapserver return an error.

msOGRFileWhichShapes(): OGR error. SetAttributeFilter(ID_ING LIKE '9%')
failed on layer rt_speleologia.idingrotte.rt.
Type mismatch or improper type of arguments to LIKE operator.

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.
So perhaps this could be a real bug of gdal.
I ask to gdal ML.



2013/4/4 Lime, Steve D (MNIT) <Steve.Lime at state.mn.us>

>  Filter should look like:****
>
> ** **
>
>   FILTER (ID_ING = '%idtpn%' )  ****
>
> ** **
>
> If MapServer is to execute it, or:****
>
> ** **
>
>   FILTER "WHERE ID_ING = '%idtpn%' "****
>
> ** **
>
> If OGR is to execute it.****
>
> ** **
>
> Steve****
>
> ** **
>
> *From:* mapserver-users-bounces at lists.osgeo.org [mailto:
> mapserver-users-bounces at lists.osgeo.org] *On Behalf Of *Andrea Peri
> *Sent:* Thursday, April 04, 2013 8:26 AM
> *To:* mapserver-users at lists.osgeo.org
> *Subject:* [mapserver-users] How use the filteritem with a ogr spatialite
> db****
>
> ** **
>
> Hi,
>
> I'm try-ing to apply a filter to a spatialite db by ogr .****
>
> I try this
>
>     CONNECTIONTYPE OGR
>     CONNECTION "/.../tematici.sqlite"
>     DATA "select
> PK_UID,ID_ING,ID_GRO,NUMERO,NOME,CODCOM,COMUNE,ANNO,DATA_AGG,SCHEDA,RILIEVO,CGBEST,CGBNORD,GEOMETRY
> from SPELEOLOGIA_INGRESSI_GROTTE"
>     FILTER "(ID_ING = '%idtpn%' )"
>     FILTERITEM 'ID_ING'
>     VALIDATION
>       'idtpn' '^[a-zA-Z0-9\-_]+$'
>     END
>     .....
>     METADATA
>       'default_idtpn' '901707'
>        .....****
>
> But it don't work.****
>
> There is some sample of filter usage with ogr format ?****
>
> ** **
>
> thx,****
>
>
> ****
>
>
> --
> -----------------
> Andrea Peri
> . . . . . . . . .
> qwerty àèìòù
> -----------------****
>



-- 
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20130404/f0eb15e5/attachment.html>


More information about the mapserver-users mailing list