expressions problem with Postgis

Steve Lime steve.lime at DNR.STATE.MN.US
Mon Jan 9 12:50:19 PST 2006


You'd really have to ellaborate a bit more on the column content to give a complete answer. If you just have Interstates vs. State Routes then:

CLASSITEM 'name'
CLASS
  EXPRESSION /Interstates/
  ...
END
CLASS
  # no expression
  ....
END

Would work. The first class catches the Interstates and the second, everything else. This would run a good bit faster than what you started with. The proper way to do negation would be:

  EXPRESSION (!('[name]' =~ /Interstates/))

Since you're using PostGIS you may want to use a case statement in postgresql to make this cleaner, where the case statement would return a simple code for each situation. This would allow for simpler MapServer expressions which, again, would be even faster to evaluate.

Steve

>>> Carola Jesch <cjesch at CCT.LSU.EDU> 01/09/06 1:18 PM >>>
Dear All,
 
I have been running into a problem splitting a postgresql layer into two
classes via MapServer expressions and I am hoping someone of you can help
me.
 
I have a postgresql table containing roads. There is a column 'name' where
you can see the road's status like 'Interstates' or 'State Routes'. So far
so good. But (there is always a 'but :-) )...
some records are looking like that:
Interstate Route 75, State Route 401

I tried to seperate my classes with some MapServer expression. I succeeded
in getting the Interstates by:

CLASS

  NAME       "Interstates"    
  EXPRESSION ("[name]" =~ /Interstate/)  

...


Now I want to seperate the State Routes by filtering all records that DO NOT
contain the substring "Interstates".

CLASS

  NAME       "Interstates"    
  EXPRESSION ("[name]" !=~ /Interstate/)  

...

It isn't working :-(. The documentation doesn't tell anything about this
case. Do you have any tip?

Thanks, Carola

  _____  

From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Chau,Philip [PYR]
Sent: Monday, January 09, 2006 11:50 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU 
Subject: [UMN_MAPSERVER-USERS] SLD http header problem




I'm trying to display the layer and using SLD to change the symbol
(ActiveFedProv) and it seems to be giving me a problem

 
<http://excise.pyr.ec.gc.ca/cgi-bin/pyrwqmp.asp?version=1.1.1&service=WMS&re 
quest=GetMap&layers=ActiveFedProv&SLD=http://map.ns.ec.gc.ca/kyw/sld/kyw_sld
.xml>
http://excise.pyr.ec.gc.ca/cgi-bin/pyrwqmp.asp?version=1.1.1&service=WMS&req 
uest=GetMap&layers=ActiveFedProv&SLD=http://map.ns.ec.gc.ca/kyw/sld/kyw_sld.
xml

WMS GetCapabilities seems to say that it supports SLD however I get a CGI
error 

"CGI Error 
The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:

" 

Cheers, 
Phil 


Philip Chau, PMP 
Water Quality Monitoring Division 
Environmental Stewardship Branch 
Environment Canada 
201-401 Burrard Street 
Vancouver, BC V6C 3S5 
Tel: 604.664.4066 
Fax: 604.664.9126 



More information about the MapServer-users mailing list