[Python] queryByAttributes()

Yves Jacolin yjacolin at FREE.FR
Wed Feb 14 00:38:24 PST 2007


Thank for your answer but the problem seems to be due to string quoting. If I 
don't write the quote, the result is an error about the column Paris which 
don't exist (normal). So I can't write quote but I need them !
Python seems not accept the escape \ character.

Y.
Le Mardi 13 Février 2007 23:02, vous avez écrit :
> Yves,
>
> I recently started using mapscript in a java environment. I got
> the queryByAttributes working by changing the where clause.
>
> String cColumn= "ville";
> String cTmp= "Paris";
> String cWhere= "/"+cTmp.trim()+"/";
> objLayers.queryByAttributes(myMap, cColumn, cWhere,
> mapscript.MS_SINGLE)
>
> This workes in my application.  I am using version 4.10.0.
> So,  may be you can test removing 'ville='
>
> Hans Wapenaar
> GIS Innovations
> The Netherlands
> hans.wapenaar at gis-innovations.nl
>
> ----- Original Message -----
> From: "Yves Jacolin" <yjacolin at FREE.FR>
> To: <MAPSERVER-USERS at LISTS.UMN.EDU>
> Sent: Tuesday, February 13, 2007 4:17 PM
> Subject: [UMN_MAPSERVER-USERS] [Python] queryByAttributes()
>
> > Hi,
> >
> > I am trying to create a map using a python script. I got a
>
> problem with the
>
> > getByAttributes() method :
> > myLayer.queryByAttributes(mapobject,"ville","ville=Paris",1)
> >
> > The "Paris" string is viewed as a column name, and I can't
>
> change this, I
>
> > tried to used double and simple quote (" and '), tired to escape
>
> quote (\"
>
> > and \'), but all this failed !
> >
> > Thanks,
> >
> > Y.
> > PS : I am a newby to python and use mapscript 4.10.0
> > --
> > Yves Jacolin
> > ---
> > http://yjacolin.gloobe.org

-- 
Yves Jacolin
---
http://yjacolin.gloobe.org



More information about the MapServer-users mailing list