Handling apostrophes in field namesand class expressions

Pagurek,Debbie [NCR] Debbie.Pagurek at EC.GC.CA
Mon Oct 24 11:56:04 PDT 2005


Thanks for clarifying this, Steve.
Clearly then, the problem I was having had to do with the apostrophe in
my classitem, and the chameleon query widget not liking that. 

Debbie
-----Original Message-----
From: Steve Lime [mailto:steve.lime at dnr.state.mn.us] 
Sent: Monday, October 24, 2005 2:34 PM
To: Pagurek,Debbie [NCR]; MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] Handling apostrophes in field
namesand class expressions


Debbie: Your example exression should work just fine. MapServer doesn't
support escaping of characters within string espressions. That shouldn't
be a problem unless you have strings with both single and double qoutes
in them. You just need to use the quoting method opposite of the
characters. I have data here full of the name O'Brien and I just tested
with a layer defiinition
like:

LAYER
  NAME 'test'
  TYPE POLYGON
  STATUS ON
  DATA 'lakes'
  CLASSITEM 'name'
  CLASS
     EXPRESSION "O'Brien"
     COLOR 255 0 0
  END
  CLASS
    EXPRESSION /O'Brien/
    COLOR 0 0 255
  END
END

and I get what I expected. Features with the exact match are red and
those with O'Brien as a substring are blue. This is 4.7 on Linux but
there have be few if any changes in that area of the code since 4.6.1
was released.

Steve

>>> "Pagurek,Debbie [NCR]" <Debbie.Pagurek at EC.GC.CA> 10/21/05 4:10 PM 
>>> >>>
Hi all,
I'm experiencing some difficulties with a mapfile that I'm using that
has apostrophes in fieldnames and also apostrophes in class expressions.

Funny - I thought my problems would all happen because of the French
characters, but that doesn't appear to be the problem.

For instance - can someone confirm that a CLASS Expression "Cours d'eau"
will work?

Mapserver 4.6.1, Windows.

Can anyone comment on what Mapserver does with encoding? 

D. Pagurek



More information about the MapServer-users mailing list