ApplySLD creates incorrect filter

Berend Veldkamp berend.veldkamp at ARIS.NL
Thu Sep 30 07:50:38 EDT 2004


Hello all,

I have the following filter in an sld:
<And>
   <PropertyIsBetween>
     <PropertyName>X</PropertyName>
     <LowerBoundary>143692</LowerBoundary>
     <UpperBoundary>145692</UpperBoundary>
   </PropertyIsBetween>
   <PropertyIsBetween>
     <PropertyName>Y</PropertyName>
     <LowerBoundary>461308</LowerBoundary>
     <UpperBoundary>463308</UpperBoundary>
   </PropertyIsBetween>
</And>

When I do a direct getmap request to a Mapserver WMS server (for example
http://localhost/mapserv&map=test.map&service=wms&version=1.1.0&request=getmap&layers=nap&styles=&sld=test.sld),
  it works. However when I use PHP/MapScript it doesn't.

When I call ApplySLD, MapServer creates a class with the following
expression:
EXPRESSION ( ([X]  >= 143692 AND  [X]  <= 145692) And  ([Y]  >= 461308
AND  [Y]  <= 463308))

Since this is a WMS layer, MapServer tries to translate this expression
back to a valid filter when making the getmap request, but fails. I
experimented a bit , and I found that It only works with a maximum of 2
conditions, and only using ">" or "<", not "<=" or ">=", i.e. ( ([X]  >
143692 AND  [X]  < 145692) )
This is the filter that MapServer creates in this case:
<AND>
   <ogc:PropertyIsGreaterThan>
     <ogc:PropertyName>X</ogc:PropertyName>
     <ogc:Literal>143692</ogc:Literal>
   </ogc:PropertyIsGreaterThan>   <ogc:PropertyIsLessThan>
   <ogc:PropertyName>X</ogc:PropertyName>
     <ogc:Literal>145692</ogc:Literal>
   </ogc:PropertyIsLessThan>
</AND>


Now I don't really care if it's "greater than" or greater than or equal
to", but I really would like to be able to use more than 2 conditions.
I'm not sure if this is possible at all, can anyone comment on this?

Thanks, Berend

--
____________________________

Berend Veldkamp - ARIS
http://www.aris.nl/
____________________________



More information about the mapserver-users mailing list