<!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>
> -----Original Message-----<br>
> From: <a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a> [mailto:mapserver-users-<br>
> <a href="mailto:bounces@lists.osgeo.org">bounces@lists.osgeo.org</a>] On Behalf Of Meine Toonen<br>
> Sent: Monday, 12 September 2011 10:22<br>
> To: <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
> Subject: [mapserver-users] SLD with LayerFeatureConstraints<br>
> <br>
> Hi list,<br>
> <br>
> I'm currently trying to filter features from a layer via a SLD, but<br>
using<br>
> the style defined by the service. I managed to get a NamedStyle by<br>
defining<br>
> a classgroup and assigning the class with the group.<br>
> <br>
> When I set the style via SLD to mv2, it works perfectly, but when I<br>
add the<br>
> filterpart (LayerFeatureConstraints) it fails: the default style is<br>
used<br>
> and no filtering occurs.<br>
> <br>
> Am I doing something wrong, of is filtering nog possible via<br>
> LayerFeatureConstraints?<br>
> <br>
> Mapfile:<br>
> <br>
> layer<br>
> name telpunten_motorvoertuig_punt<br>
> CLASSGROUP "mv"<br>
> metadata<br>
> "wms_title" "telpunten_points"<br>
> "gml_include_items" "all"<br>
> "wfs_featureid" "id"<br>
> end<br>
> group telpunten<br>
> status off<br>
> type point<br>
> dump true<br>
> template bla<br>
> connectiontype postgis<br>
> connection CONNECTIONSTATEMENT<br>
> data "locatie from (select id, nummer, locatie,<br>
> coalesce(soort,'Onbekend') as wb_soort, wegnummer from telpunt ) as<br>
foo<br>
> using srid=28992 using unique id"<br>
> projection<br>
> "init=epsg:28992"<br>
> end<br>
> classitem wb_soort<br>
> <br>
> class<br>
> NAME "motorvoertuig"<br>
> group "mv"<br>
> expression "MOTORVOERTUIG"<br>
> style<br>
> <br>
> symbol "square"<br>
> color 0 204 204<br>
> outlinecolor 0 0 0<br>
> size 8<br>
> end<br>
> end<br>
> <br>
> class<br>
> NAME "motorvoertuig2"<br>
> group "mv2"<br>
> expression "MOTORVOERTUIG"<br>
> style<br>
> <br>
> symbol "square"<br>
> color 255 0 0<br>
> outlinecolor 0 0 0<br>
> size 8<br>
> end<br>
> end<br>
> <br>
> <br>
> processing "CLOSE_CONNECTION=DEFER"<br>
> end<br>
> <br>
> The SLD:<br>
> <?xml version="1.0" encoding="UTF-8"?><br>
> <br>
> <sld:StyledLayerDescriptor xmlns:app="<a href="http://www.deegree.org/app%22" target="_blank">http://www.deegree.org/app"</a><br>
> xmlns:deegreeogc="<a href="http://www.deegree.org/ogc%22" target="_blank">http://www.deegree.org/ogc"</a><br>
> xmlns:gml="<a href="http://www.opengis.net/gml%22" target="_blank">http://www.opengis.net/gml"</a><br>
> xmlns:ogc="<a href="http://www.opengis.net/ogc%22" target="_blank">http://www.opengis.net/ogc"</a><br>
> xmlns:sld="<a href="http://www.opengis.net/sld%22" target="_blank">http://www.opengis.net/sld"</a><br>
> xmlns:xlink="<a href="http://www.w3.org/1999/xlink%22" target="_blank">http://www.w3.org/1999/xlink"</a><br>
> xmlns:se="<a href="http://www.opengis.net/se%22" target="_blank">http://www.opengis.net/se"</a> version="1.0.0"><br>
> <sld:NamedLayer xmlns="<a href="http://www.opengis.net/sld%22" target="_blank">http://www.opengis.net/sld"</a>><br>
> <se:Name>telpunten_motorvoertuig_punt</se:Name><br>
> <sld:NamedStyle><br>
> <se:Name>mv</se:Name><br>
> </sld:NamedStyle><br>
> <sld:LayerFeatureConstraints><br>
> <Fsld:eatureTypeConstraint><br>
> <ogc:Filter><br>
> <ogc:PropertyIsEqualTo><br>
> <ogc:PropertyName>wegnummer</ogc:PropertyName><br>
> <ogc:Literal>A28</ogc:Literal><br>
> </ogc:PropertyIsEqualTo><br>
> </ogc:Filter><br>
> </sld:FeatureTypeConstraint><br>
> </sld:LayerFeatureConstraints><br>
> </sld:NamedLayer><br>
> </sld:StyledLayerDescriptor><br>
> <br>
> <br>
> Thanks in advance!<br>
> <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>
<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>><br>
        <Name>ms_ogc_workshop</Name><br>
        <Title>SLD for MapServer OGC Web Services Workshop</Title><br>
        <Abstract>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</Abstract><br>
        <NamedLayer><br>
                <Name>rivers</Name><br>
                <UserStyle><br>
                        <Name>sld_01</Name><br>
                        <Title>sld_01</Title><br>
                        <IsDefault>1</IsDefault><br>
                        <FeatureTypeStyle><br>
                                <Rule><br>
                                        <ogc:Filter><br>
                                                <ogc:PropertyIsEqualTo><br>
        <br>
<ogc:PropertyName>NAME</ogc:PropertyName><br>
        <br>
<ogc:Literal>Japura</ogc:Literal><br>
                                                </ogc:PropertyIsEqualTo><br>
                                        </ogc:Filter><br>
                                        <LineSymbolizer><br>
                                                <Stroke><br>
                                                        <CssParameter<br>
name="stroke">#FFCC00</CssParameter><br>
                                                        <CssParameter<br>
name="stroke-width">5</CssParameter><br>
                                                </Stroke><br>
                                        </LineSymbolizer><br>
                                </Rule><br>
                        </FeatureTypeStyle><br>
                </UserStyle><br>
        </NamedLayer><br>
</StyledLayerDescriptor><br>
</blockquote><style>
</style>
</body></html>