[mapserver-users] Trouble with last dev in the GetFeatureInfo.

Lime, Steve D (MNIT) Steve.Lime at state.mn.us
Tue Oct 21 08:07:05 PDT 2014


You can certainly do:

  DATA "geometry from (select * mytest.layer1 where FOGLIO like '%idtpn%') using unique gid srid=25832"

and access all attributes. All of the database back-ends, including OGR, support a similar syntax where a "where" clause is embedded in the DATA statement.

Steve

-----Original Message-----
From: Andrea Peri [mailto:aperi2007 at gmail.com] 
Sent: Monday, October 20, 2014 2:53 PM
To: Lime, Steve D (MNIT)
Cc: Even Rouault; mapserver-users at lists.osgeo.org; Andrea Peri
Subject: Re: [mapserver-users] Trouble with last dev in the GetFeatureInfo.

Hi Steve,

thx for hint ,

>DATA "geometry from (select geometry mytest.layer1 where FOGLIO like '%idtpn%') using unique gid srid=25832"

I dont know this sintax.
It will support the access to all the attributes of the table without need to list them ?
I like the old sintax because access all the fields without need to list them one by one in the query.

Also I like to know if this alternative sintax is supported from Spatialite (by ogr)

We use it with mapserver more often then postgis.

Thx,

Andrea.



2014-10-20 21:20 GMT+02:00 Lime, Steve D (MNIT) <Steve.Lime at state.mn.us>:
> Hmmm... This should have still been interpreted as native SQL without adding the FILTERITEM (did that work by the way?). This is an example of a configuration that will change once 7.0 is completely ready.
>
> Regardless, instead of using a FILTER, it would be simpler to just put the where clause in the DATA statement itself, e.g.:
>
>   DATA "geometry from (select geometry mytest.layer1 where FOGLIO like '%idtpn%') using unique gid srid=25832"
>
> Steve
>
> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org 
> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Andrea 
> Peri
> Sent: Sunday, October 19, 2014 11:11 AM
> To: Even Rouault
> Cc: mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] Trouble with last dev in the GetFeatureInfo.
>
> Hi Even,
>
> thx for precious info.
>
> So is sufficient add the
> FILTERITEM.
> :)
>
> Thx,
>
> A.
>
>
> 2014-10-19 17:37 GMT+02:00 Even Rouault <even.rouault at spatialys.com>:
>> Le dimanche 19 octobre 2014 10:39:19, Andrea Peri a écrit :
>>> Hi,
>>> I upgrade to the last dev of mapserver.
>>>
>>> After this, I'm having some troubles when go to do Identify on a 
>>> layer with a GetFeatureInfo.
>>>
>>> Now I'm havig this error:
>>>
>>> [Sun Oct 19 10:32:25 2014].523176 msEvalExpression(): General error 
>>> message. Cannot evaluate expression, no item index defined.
>>>
>>> I'm using a postgis to host the layer and this is the setting:
>>>
>>>     CONNECTIONTYPE POSTGIS
>>>     CONNECTION "host=localhost dbname=test user=test password=test 
>>> port=5432" DATA "geometry from mytest.layer1 using unique gid srid=25832"
>>> FILTER "(FOGLIO like '%idtpn%')"
>>>     VALIDATION
>>>       'idtpn' '^[a-zA-Z0-9\-_]+$'
>>>       'default_idtpn' '%'
>>>     END
>>>
>>> This setting work for me before, so I guess there is some change to 
>>> do in mapfile settings, but I don't understand what.
>>>
>>> Any hints ?
>>
>> Andrea,
>>
>> I believe this is a consequence of
>> http://mapserver.org/development/rfc/ms-
>> rfc-91.html where FILTER without FILTERITEM is now interpreted as a 
>> MapServer expression in all cases, and not a SQL filter for PostGIS connections.
>>
>> Although there are following disucssions on that email. See the 
>> following thread :
>> http://lists.osgeo.org/pipermail/mapserver-dev/2014-September/014228.
>> h
>> tml
>>
>> Even
>>
>> --
>> Spatialys - Geospatial professional services http://www.spatialys.com
>
>
>
> --
> -----------------
> Andrea Peri
> . . . . . . . . .
> qwerty àèìòù
> -----------------
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users



--
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------


More information about the MapServer-users mailing list