Opened 20 years ago

Closed 20 years ago

Last modified 20 years ago

#917 closed defect (invalid)

Intersect filter not working with WMS GetMap

Reported by: b.veldkamp@… Owned by: mapserverbugs
Priority: high Milestone: 4.4 release
Component: WMS Server Version: 4.3
Severity: normal Keywords:
Cc: mapserver@…, valik.solorzano.barboza@…

Description

We are unable to get the Intersect filter working with a WMS GetMap request.
Ordinary requests such as
http://localhost/cgi-bin/mapserv.exe?map=test.map&service=wms&version=1.1.0&request=getmap&layers=nap&styles=
work without any problem, but using an sld with an embedded intersect filter
(i.e.
http://localhost/cgi-bin/mapserv.exe?map=test.map&service=wms&version=1.1.0&request=getmap&layers=nap&styles=&sld=http://localhost/intersect.sld)
results in an empty image.

Other filters in an sld, such as PropertyIsLike, PropertyIsEqualTo of
PropertyIsBetween work correctly. 
I tried a recent nightly build (sep 20), where a bug concerning spatial filters
was fixed, but still no luck. Maybe a simple example of how to apply a spatial
filter would clarify things?

Berend Veldkamp



Here's an example sld-file:
<StyledLayerDescriptor version='1 0 0'>
  <NamedLayer>
    <Name>nap</Name>
    <UserStyle>
      <Title>nap</Title>
      <FeatureTypeStyle>
        <Rule>
          <Filter>
            <Intersect>
              <PropertyName>geometry</PropertyName>
              <Polygon srsName="EPSG:28992">
                <outerBoundaryIs>
                  <LinearRing>
                    <coordinates>258964.100000,557394.600000
259215.900000,557073.900100 259842.100000,556199.199900
261295.200000,554253.600000 258964.100000,557394.600000</coordinates>
                  </LinearRing>
                </outerBoundaryIs>
              </Polygon>
            </Intersect>
          </Filter>

          <PointSymbolizer>
            <Graphic>
              <Size>5</Size>
              <Mark>
                <WellKnownName>circle</WellKnownName>
                <Fill>
                  <CssParameter name="fill">#0000ff</CssParameter>
                </Fill>
              </Mark>
            </Graphic>
          </PointSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

Change History (10)

comment:1 by mapserver@…, 20 years ago

Cc: mapserver@… added

comment:2 by dmorissette, 20 years ago

Since spatial filters don't map well into MapServer classes, it is quite likely
that spatial filters are just not supported for SLD. I'll let Assefa comment
further on that.

comment:3 by dmorissette, 20 years ago

Quick clarification, in my previous comment, of course I meant: "spatial filters
not supported for SLD *in MapServer*".

comment:4 by assefa, 20 years ago

I had actually added the support for the spatial filters for WMS couple of
months ago. The main addtion was for BBOX filters but I also added Intersect and
Dwithin. I did some tests a couple of weeks ago and did some corrections related
to these filters (sep 17) and my test case was passing.

 I can check what is wrong with filter if you provide me with sample data that
goes with the filter. It takes me a  considerable amount of time to reproduce
any problems without sample data. You can e-mail me your data personnaly if
possible. 

comment:5 by dmorissette, 20 years ago

Assefa, did you really do filters *in SLD*?

comment:6 by assefa, 20 years ago

Yes in was added in SLD. I have created a bug 919 to update the SLD docs and add
sld with spatial filters examples using the world_test data.

comment:7 by b.veldkamp@…, 20 years ago

Never mind, after two weeks of pulling my hairs out, it now all of a sudden
works :-| I have no idea what I changed to make it work, but if I find out, I'll
let you know.

BTW does Mapserver as WMS *client* also support sld filters? I believe that what
Mapserver does now, is try to convert a filter to classes *) and then, when
making a WMS request, it converts these classes back to an sld filter. Or is it? 
Obviously this can't work for spatial filter, due to the nature of Mapserver
classes, but I think that if a valid filter is already known, there's no need to
create classes in the first place, right?

Berend


*) I'm talking about php/mapscript and applysld() here.

comment:8 by assefa, 20 years ago

Milestone: 4.4 release
Resolution: invalid
Status: newclosed
Marking this as Invalid. Please reopen if there are still issues.

Regarding the question in comment #6, If I understant well, You can specifify 
on a wms client layer (in the map file) the following metadata :

wms_sld_url : value would be an url to a valid sld document. The WMS request 
will be send using SLD=

wms_sld_body : 2 possible values
   - full sld document (eg ("wms_sld_body" "StyledLayerDescriptor version='1 0 
0'>...</StyledLayerDescriptor>"
   - or the value can be AUTO ("wms_sld_body" "AUTO") : this will genarate an 
SLD from your classes
 When using the wms_sld_body, the WMS request will be send using SLD_BODY

comment:9 by b.veldkamp@…, 20 years ago

Ah, OK. I had only tried wms_filter in the metadata. Is wms_sld_url documented
somewhere?

comment:10 by assefa, 20 years ago

The docs are in mapserver wiki right now :
http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?SLDMapServer

It should make it to the official docs location before the 4.4. release.  
Note: See TracTickets for help on using tickets.