MapServer / MapServer-import

3 stars 2 forks source link

Intersect filter not working with WMS GetMap #917

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: b.veldkamp@zonnet.nl Date: 2004/09/30 - 10:58

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>
tbonfort commented 12 years ago

Author: dmorissette Date: 2004/09/30 - 16:31

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.
tbonfort commented 12 years ago

Author: dmorissette Date: 2004/09/30 - 16:44

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

Author: assefa Date: 2004/09/30 - 17:05

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. 
tbonfort commented 12 years ago

Author: dmorissette Date: 2004/09/30 - 17:14

Assefa, did you really do filters *in SLD*?
tbonfort commented 12 years ago

Author: assefa Date: 2004/09/30 - 17:54

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.
tbonfort commented 12 years ago

Author: b.veldkamp@zonnet.nl Date: 2004/10/01 - 10:40

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.
tbonfort commented 12 years ago

Author: assefa Date: 2004/10/29 - 01:57

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
tbonfort commented 12 years ago

Author: b.veldkamp@zonnet.nl Date: 2004/10/29 - 08:29

Ah, OK. I had only tried wms_filter in the metadata. Is wms_sld_url documented
somewhere?
tbonfort commented 12 years ago

Author: assefa Date: 2004/10/29 - 15:40

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.