[mapserver-users] SLD with LayerFeatureConstraints
Meine Toonen
meinetoonen at b3partners.nl
Tue Sep 13 02:55:35 PDT 2011
Thanks for the info.
Will the LayerFeatureConstraints options be available in the future, or is filtering only supported in an UserStyle? Couldn't find it in the trac.
Met vriendelijke groet,
Meine Toonen
B3Partners BV
Tel: 030 214 2083
_____
From: Kralidis,Tom [Ontario] [mailto:Tom.Kralidis at ec.gc.ca]
To: Meine Toonen [mailto:meinetoonen at b3partners.nl], mapserver-users at lists.osgeo.org
Sent: Mon, 12 Sep 2011 16:56:33 +0200
Subject: RE: [mapserver-users] SLD with LayerFeatureConstraints
> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-
> bounces at lists.osgeo.org] On Behalf Of Meine Toonen
> Sent: Monday, 12 September 2011 10:22
> To: mapserver-users at lists.osgeo.org
> Subject: [mapserver-users] SLD with LayerFeatureConstraints
>
> Hi list,
>
> I'm currently trying to filter features from a layer via a SLD, but
using
> the style defined by the service. I managed to get a NamedStyle by
defining
> a classgroup and assigning the class with the group.
>
> When I set the style via SLD to mv2, it works perfectly, but when I
add the
> filterpart (LayerFeatureConstraints) it fails: the default style is
used
> and no filtering occurs.
>
> Am I doing something wrong, of is filtering nog possible via
> LayerFeatureConstraints?
>
> Mapfile:
>
> layer
> name telpunten_motorvoertuig_punt
> CLASSGROUP "mv"
> metadata
> "wms_title" "telpunten_points"
> "gml_include_items" "all"
> "wfs_featureid" "id"
> end
> group telpunten
> status off
> type point
> dump true
> template bla
> connectiontype postgis
> connection CONNECTIONSTATEMENT
> data "locatie from (select id, nummer, locatie,
> coalesce(soort,'Onbekend') as wb_soort, wegnummer from telpunt ) as
foo
> using srid=28992 using unique id"
> projection
> "init=epsg:28992"
> end
> classitem wb_soort
>
> class
> NAME "motorvoertuig"
> group "mv"
> expression "MOTORVOERTUIG"
> style
>
> symbol "square"
> color 0 204 204
> outlinecolor 0 0 0
> size 8
> end
> end
>
> class
> NAME "motorvoertuig2"
> group "mv2"
> expression "MOTORVOERTUIG"
> style
>
> symbol "square"
> color 255 0 0
> outlinecolor 0 0 0
> size 8
> end
> end
>
>
> processing "CLOSE_CONNECTION=DEFER"
> end
>
> The SLD:
> <?xml version="1.0" encoding="UTF-8"?>
>
> <sld:StyledLayerDescriptor xmlns:app="http://www.deegree.org/app"
> xmlns:deegreeogc="http://www.deegree.org/ogc"
> xmlns:gml="http://www.opengis.net/gml"
> xmlns:ogc="http://www.opengis.net/ogc"
> xmlns:sld="http://www.opengis.net/sld"
> xmlns:xlink="http://www.w3.org/1999/xlink"
> xmlns:se="http://www.opengis.net/se" version="1.0.0">
> <sld:NamedLayer xmlns="http://www.opengis.net/sld">
> <se:Name>telpunten_motorvoertuig_punt</se:Name>
> <sld:NamedStyle>
> <se:Name>mv</se:Name>
> </sld:NamedStyle>
> <sld:LayerFeatureConstraints>
> <Fsld:eatureTypeConstraint>
> <ogc:Filter>
> <ogc:PropertyIsEqualTo>
> <ogc:PropertyName>wegnummer</ogc:PropertyName>
> <ogc:Literal>A28</ogc:Literal>
> </ogc:PropertyIsEqualTo>
> </ogc:Filter>
> </sld:FeatureTypeConstraint>
> </sld:LayerFeatureConstraints>
> </sld:NamedLayer>
> </sld:StyledLayerDescriptor>
>
>
> Thanks in advance!
>
Sld:LayerFeatureConstraints is not supported by MapServer, or SLD 1.0.0.
FYI here's an example of applying filters to SLD:
<StyledLayerDescriptor version="1.0.0"
xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
<Name>ms_ogc_workshop</Name>
<Title>SLD for MapServer OGC Web Services Workshop</Title>
<Abstract>This is an SLD to show how one can make a custom style
without having to change the data style at the server-side</Abstract>
<NamedLayer>
<Name>rivers</Name>
<UserStyle>
<Name>sld_01</Name>
<Title>sld_01</Title>
<IsDefault>1</IsDefault>
<FeatureTypeStyle>
<Rule>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>NAME</ogc:PropertyName>
<ogc:Literal>Japura</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<LineSymbolizer>
<Stroke>
<CssParameter
name="stroke">#FFCC00</CssParameter>
<CssParameter
name="stroke-width">5</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110913/60314a14/attachment.htm>
More information about the MapServer-users
mailing list