Hello, I'm having some difficulty creating dynamic choropleth maps. I'd like to design an SLD so that it will create new maps based on the variable (i.e., total, female, male) the breaks and the color ramp values. So far my XML is only incorporating the color values.
Specifically, I need help understanding how and where to place the filter property/propertyName so that in the WMS request to change values. Help with the WMS request would be appreciated as well. I need more information on this sentence "Allows property names to be computed or specified by Variable substitution in SLD <https://docs.geoserver.org/stable/en/user/styling/sld/extensions/substitution.html#sld-variable-substitution> ." ( https://docs.geoserver.org/stable/en/user/filter/function_reference.html#feature-functions ) http://localhost:8080/geoserver/solap/wms?service=WMS&version=1.1.0&request=GetMap&layers=solap%3Astate_county_query&bbox=-93.2279029997203%2C44.8873990001825%2C-92.9841920001164%2C45.1245330004032&width=768&height=747&srs=EPSG%3A4326&styles=choro2&env=color1:343deb&format=application/openlayers#toggle <?xml version="1.0" encoding="UTF-8"?> <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" xmlns:gml=" http://www.opengis.net/gml" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd"> <NamedLayer> <Name>USA states population</Name> <UserStyle> <Name>population</Name> <Title>Population in the United States</Title> <Abstract>A sample filter that filters the United States into three categories of population, drawn in different colors</Abstract> <FeatureTypeStyle> <Rule> <Title>< 2M</Title> <ogc:Filter> <ogc:PropertyIsLessThan> <ogc:PropertyName>total</ogc:PropertyName> <ogc:Literal>2000</ogc:Literal> </ogc:PropertyIsLessThan> </ogc:Filter> <PolygonSymbolizer> <Fill> <!-- CssParameters allowed are fill (the color) and fill-opacity --> <CssParameter name="fill"> #<ogc:Function name="env"> <ogc:Literal>color1</ogc:Literal> <ogc:Literal>4DFF4D</ogc:Literal> </ogc:Function> </CssParameter> </Fill> </PolygonSymbolizer> </Rule> <Rule> <Title>2M - 4M</Title> <ogc:Filter> <ogc:PropertyIsBetween> <ogc:PropertyName>total</ogc:PropertyName> <ogc:LowerBoundary> <ogc:Literal>2000</ogc:Literal> </ogc:LowerBoundary> <ogc:UpperBoundary> <ogc:Literal>4000</ogc:Literal> </ogc:UpperBoundary> </ogc:PropertyIsBetween> </ogc:Filter> <PolygonSymbolizer> <Fill> <!-- CssParameters allowed are fill (the color) and fill-opacity --> <CssParameter name="fill"> #<ogc:Function name="env"> <ogc:Literal>color2</ogc:Literal> <ogc:Literal>FF4D4D</ogc:Literal> </ogc:Function> </CssParameter> </Fill> </PolygonSymbolizer> </Rule> <Rule> <Title>> 4M</Title> <!-- like a linesymbolizer but with a fill too --> <ogc:Filter> <ogc:PropertyIsGreaterThan> <ogc:PropertyName>total</ogc:PropertyName> <ogc:Literal>4000</ogc:Literal> </ogc:PropertyIsGreaterThan> </ogc:Filter> <PolygonSymbolizer> <Fill> <!-- CssParameters allowed are fill (the color) and fill-opacity --> <CssParameter name="fill"> #<ogc:Function name="env"> <ogc:Literal>color3</ogc:Literal> <ogc:Literal>4D4DFF</ogc:Literal> </ogc:Function> </CssParameter> </Fill> </PolygonSymbolizer> </Rule> </FeatureTypeStyle> </UserStyle> </NamedLayer> </StyledLayerDescriptor>
_______________________________________________ Geoserver-users mailing list Please make sure you read the following two resources before posting to this list: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
