<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html><head><meta http-equiv="Content-Type" content="text/html;charset=us-ascii">
<style>BODY{font:10pt Tahoma, Verdana, sans-serif}</style></head><body>
Thanks for the info. <br>Will the LayerFeatureConstraints options be available in the future, or is filtering only supported in an UserStyle? Couldn't find it in the trac.<br><br>Met vriendelijke groet,<br><br>Meine Toonen<br>B3Partners BV<br>Tel: 030 214 2083<br><blockquote style="padding-left: 5px; margin-left: 5px; border-left: #0000ff 2px solid; margin-right: 0px"><hr><b>From:</b> Kralidis,Tom [Ontario] [mailto:Tom.Kralidis@ec.gc.ca]<br><b>To:</b> Meine Toonen [mailto:meinetoonen@b3partners.nl], mapserver-users@lists.osgeo.org<br><b>Sent:</b> Mon, 12 Sep 2011 16:56:33 +0200<br><b>Subject:</b> RE: [mapserver-users] SLD with LayerFeatureConstraints<br><br><br>
<br>
&gt; -----Original Message-----<br>
&gt; From: <a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a> [mailto:mapserver-users-<br>
&gt; <a href="mailto:bounces@lists.osgeo.org">bounces@lists.osgeo.org</a>] On Behalf Of Meine Toonen<br>
&gt; Sent: Monday, 12 September 2011 10:22<br>
&gt; To: <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
&gt; Subject: [mapserver-users] SLD with LayerFeatureConstraints<br>
&gt; <br>
&gt; Hi list,<br>
&gt; <br>
&gt; I'm currently trying to filter features from a layer via a SLD, but<br>
using<br>
&gt; the style defined by the service. I managed to get a NamedStyle by<br>
defining<br>
&gt; a classgroup and assigning the class with the group.<br>
&gt; <br>
&gt; When I set the style via SLD to mv2, it works perfectly, but when I<br>
add the<br>
&gt; filterpart (LayerFeatureConstraints) it fails: the default style is<br>
used<br>
&gt; and no filtering occurs.<br>
&gt; <br>
&gt; Am I doing something wrong, of is filtering nog possible via<br>
&gt; LayerFeatureConstraints?<br>
&gt; <br>
&gt; Mapfile:<br>
&gt; <br>
&gt; layer<br>
&gt;   name telpunten_motorvoertuig_punt<br>
&gt;   CLASSGROUP "mv"<br>
&gt;   metadata<br>
&gt;     "wms_title" "telpunten_points"<br>
&gt;     "gml_include_items" "all"<br>
&gt;     "wfs_featureid" "id"<br>
&gt;   end<br>
&gt;   group telpunten<br>
&gt;   status off<br>
&gt;   type point<br>
&gt;   dump true<br>
&gt;   template bla<br>
&gt;   connectiontype postgis<br>
&gt;   connection CONNECTIONSTATEMENT<br>
&gt;   data "locatie from (select id, nummer, locatie,<br>
&gt; coalesce(soort,'Onbekend') as wb_soort, wegnummer from telpunt ) as<br>
foo<br>
&gt; using srid=28992 using unique id"<br>
&gt;   projection<br>
&gt;     "init=epsg:28992"<br>
&gt;   end<br>
&gt;   classitem wb_soort<br>
&gt; <br>
&gt;   class<br>
&gt;     NAME "motorvoertuig"<br>
&gt;     group "mv"<br>
&gt;     expression "MOTORVOERTUIG"<br>
&gt;     style<br>
&gt; <br>
&gt;         symbol "square"<br>
&gt;         color 0 204 204<br>
&gt;         outlinecolor 0 0 0<br>
&gt;         size 8<br>
&gt;     end<br>
&gt;   end<br>
&gt; <br>
&gt;   class<br>
&gt;     NAME "motorvoertuig2"<br>
&gt;     group "mv2"<br>
&gt;     expression "MOTORVOERTUIG"<br>
&gt;     style<br>
&gt; <br>
&gt;         symbol "square"<br>
&gt;         color 255 0 0<br>
&gt;         outlinecolor 0 0 0<br>
&gt;         size 8<br>
&gt;     end<br>
&gt;   end<br>
&gt; <br>
&gt; <br>
&gt;   processing "CLOSE_CONNECTION=DEFER"<br>
&gt; end<br>
&gt; <br>
&gt; The SLD:<br>
&gt; &lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>
&gt; <br>
&gt; &lt;sld:StyledLayerDescriptor xmlns:app="<a href="http://www.deegree.org/app%22" target="_blank">http://www.deegree.org/app"</a><br>
&gt; xmlns:deegreeogc="<a href="http://www.deegree.org/ogc%22" target="_blank">http://www.deegree.org/ogc"</a><br>
&gt; xmlns:gml="<a href="http://www.opengis.net/gml%22" target="_blank">http://www.opengis.net/gml"</a><br>
&gt; xmlns:ogc="<a href="http://www.opengis.net/ogc%22" target="_blank">http://www.opengis.net/ogc"</a><br>
&gt; xmlns:sld="<a href="http://www.opengis.net/sld%22" target="_blank">http://www.opengis.net/sld"</a><br>
&gt; xmlns:xlink="<a href="http://www.w3.org/1999/xlink%22" target="_blank">http://www.w3.org/1999/xlink"</a><br>
&gt; xmlns:se="<a href="http://www.opengis.net/se%22" target="_blank">http://www.opengis.net/se"</a> version="1.0.0"&gt;<br>
&gt;     &lt;sld:NamedLayer xmlns="<a href="http://www.opengis.net/sld%22" target="_blank">http://www.opengis.net/sld"</a>&gt;<br>
&gt;         &lt;se:Name&gt;telpunten_motorvoertuig_punt&lt;/se:Name&gt;<br>
&gt;         &lt;sld:NamedStyle&gt;<br>
&gt;             &lt;se:Name&gt;mv&lt;/se:Name&gt;<br>
&gt;         &lt;/sld:NamedStyle&gt;<br>
&gt;         &lt;sld:LayerFeatureConstraints&gt;<br>
&gt;             &lt;Fsld:eatureTypeConstraint&gt;<br>
&gt;                 &lt;ogc:Filter&gt;<br>
&gt;                     &lt;ogc:PropertyIsEqualTo&gt;<br>
&gt;                         &lt;ogc:PropertyName&gt;wegnummer&lt;/ogc:PropertyName&gt;<br>
&gt;                         &lt;ogc:Literal&gt;A28&lt;/ogc:Literal&gt;<br>
&gt;                     &lt;/ogc:PropertyIsEqualTo&gt;<br>
&gt;                 &lt;/ogc:Filter&gt;<br>
&gt;             &lt;/sld:FeatureTypeConstraint&gt;<br>
&gt;         &lt;/sld:LayerFeatureConstraints&gt;<br>
&gt;     &lt;/sld:NamedLayer&gt;<br>
&gt; &lt;/sld:StyledLayerDescriptor&gt;<br>
&gt; <br>
&gt; <br>
&gt; Thanks in advance!<br>
&gt; <br>
<br>
Sld:LayerFeatureConstraints is not supported by MapServer, or SLD 1.0.0.<br>
FYI here's an example of applying filters to SLD:<br>
<br>
&lt;StyledLayerDescriptor  version="1.0.0"<br>
                        xmlns="<a href="http://www.opengis.net/sld%22" target="_blank">http://www.opengis.net/sld"</a><br>
                        xmlns:ogc="<a href="http://www.opengis.net/ogc%22" target="_blank">http://www.opengis.net/ogc"</a><br>
                        xmlns:xlink="<a href="http://www.w3.org/1999/xlink%22" target="_blank">http://www.w3.org/1999/xlink"</a><br>
        <br>
xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance%22" target="_blank">http://www.w3.org/2001/XMLSchema-instance"</a><br>
                        xsi:schemaLocation="<a href="http://www.opengis.net/sld" target="_blank">http://www.opengis.net/sld</a><br>
<a href="http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd%22" target="_blank">http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd"</a>&gt;<br>
        &lt;Name&gt;ms_ogc_workshop&lt;/Name&gt;<br>
        &lt;Title&gt;SLD for MapServer OGC Web Services Workshop&lt;/Title&gt;<br>
        &lt;Abstract&gt;This is an SLD to show how one can make a custom style<br>
without having to change the data style at the server-side&lt;/Abstract&gt;<br>
        &lt;NamedLayer&gt;<br>
                &lt;Name&gt;rivers&lt;/Name&gt;<br>
                &lt;UserStyle&gt;<br>
                        &lt;Name&gt;sld_01&lt;/Name&gt;<br>
                        &lt;Title&gt;sld_01&lt;/Title&gt;<br>
                        &lt;IsDefault&gt;1&lt;/IsDefault&gt;<br>
                        &lt;FeatureTypeStyle&gt;<br>
                                &lt;Rule&gt;<br>
                                        &lt;ogc:Filter&gt;<br>
                                                &lt;ogc:PropertyIsEqualTo&gt;<br>
        <br>
&lt;ogc:PropertyName&gt;NAME&lt;/ogc:PropertyName&gt;<br>
        <br>
&lt;ogc:Literal&gt;Japura&lt;/ogc:Literal&gt;<br>
                                                &lt;/ogc:PropertyIsEqualTo&gt;<br>
                                        &lt;/ogc:Filter&gt;<br>
                                        &lt;LineSymbolizer&gt;<br>
                                                &lt;Stroke&gt;<br>
                                                        &lt;CssParameter<br>
name="stroke"&gt;#FFCC00&lt;/CssParameter&gt;<br>
                                                        &lt;CssParameter<br>
name="stroke-width"&gt;5&lt;/CssParameter&gt;<br>
                                                &lt;/Stroke&gt;<br>
                                        &lt;/LineSymbolizer&gt;<br>
                                &lt;/Rule&gt;<br>
                        &lt;/FeatureTypeStyle&gt;<br>
                &lt;/UserStyle&gt;<br>
        &lt;/NamedLayer&gt;<br>
&lt;/StyledLayerDescriptor&gt;<br>
</blockquote><style>
</style>
</body></html>