Spatial filter in SLD

Yewondwossen Assefa assefa at DMSOLUTIONS.CA
Fri Sep 17 12:38:46 EDT 2004


i There,

  I have checked a bit this issue. There were a couple of bugs related
with DWithin and Intersect spatial filters. There is a new version of
mapogcfilter.c (r 1.31). You should give it a try.
Another note on using the applysld from php with spatial filter (based
on your example) : there are no class created for the layer since the
filter is only a spatial filer. What happens is that the spatial filter
is converted into a query in mapserver and applied to the layer. If you
are doing your tests throuh php you should use drawquery to see the
effect of the sld.

Let me know how it goes.

Later,

Anja Berkhout wrote:

> Dear list,
>
> I try to create an SLD string (in PHP) with a spatial filter as follows:
>
>
> $szSLD = '<StyledLayerDescriptor version="1.0.0">'.
>          '<NamedLayer>'.
>          '<Name>Testlayer</Name>'.
>          '<UserStyle>'.
>          '<FeatureTypeStyle>'.
>          '<Rule>'.
>          '<Filter>'.
>          "<Intersect><PropertyName>Geometry</PropertyName>".
>          "<gml:Polygon srsName='EPSG:28992'>".
>          '<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>'.
>          '130036,477272 130256,477116 '.
>          '130664,477865 130819,477642'.
>          '</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>'.
>          '</gml:Polygon></Intersect>'.
>          '</Filter>'.
>          '<PointSymbolizer>'.
>          '<Graphic>'.
>          '<Size>5</Size>'.
>          '<Mark>'.
>          '<WellKnownName>square</WellKnownName>'.
>          '<Fill>'.
>          '<CssParameter name="fill">#ffff00</CssParameter>'.
>          '</Fill>'.
>          '</Mark>'.
>          '</Graphic>'.
>          '</PointSymbolizer>'.
>          '</Rule>'.
>          '</FeatureTypeStyle>'.
>          '</UserStyle>'.
>          '</NamedLayer>'.
>          '</StyledLayerDescriptor>';
>
> After that I use applySLD to apply the spatial filter to a layer, but
> nothing happens. What am I doing wrong?
> When I use a filter like <PropertyIsGreaterThanOrEqualTo> it works fine,
> and two classes are created in the layer.
>
> Greetings,
> Anja
>
>
> --
> ______________________________________________________________
>
> ARIS - Adviesburo voor Ruimtelijke Informatie Systemen
>        Hooghiemstraplein 126    Tel.  +31-(0)30-2769180
>        3514 AZ  UTRECHT         Fax.  +31-(0)30-2733578
>        The Netherlands          Email Anja.Berkhout at aris.nl
>                                 Http://www.aris.nl
> _____________________________________________________________
>


--
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst

Email: assefa at dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925
----------------------------------------------------------------



More information about the mapserver-users mailing list