Edward,

 

Thanks for that but I’m OK with the symbology. The problem I’m having is with 
the Filter. I can leave out the <IsLessTHanOrEqualTo> condition and I get all 
over 30%. But I want to cap the filter to between 30 and 80 % and that is when 
I have the problem. It seems that I have got something wrong with that 
condition but I just can’t see it.

 

Can you look at the syntax of the Filter for me?

 

Cheers, Brad….

 

From: Edward Mac Gillavry <edw...@webmapper.net> 
Sent: 26 March 2020 18:41
To: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] SLD on Geoserver

 

Hiya, 

The part with the PolygonSymbolizers in the SLD

<PolygonSymbolizer>
  <Fill>
    <CssParameter name='fill'>#FF0000</CssParameter>
    <CssParameter name='fill-opacity'>1</CssParameter>
  </Fill>
</PolygonSymbolizer>
<PolygonSymbolizer>
  <Stroke>
    <CssParameter name='stroke'>#000000</CssParameter>
    <CssParameter name='stroke-width'>1</CssParameter>
    <CssParameter name='stroke-opacity'>1</CssParameter>
  </Stroke>
</PolygonSymbolizer>

seems odd. You can either wrap it in one PolygonSymbolizer to achieve a fill 
AND a stroke for each and every polygon like this:

<PolygonSymbolizer>
  <Fill>
    <CssParameter name='fill'>#FF0000</CssParameter>
    <CssParameter name='fill-opacity'>1</CssParameter>
  </Fill>
  <Stroke>
    <CssParameter name='stroke'>#000000</CssParameter>
    <CssParameter name='stroke-width'>1</CssParameter>
    <CssParameter name='stroke-opacity'>1</CssParameter>
  </Stroke>
</PolygonSymbolizer>

or you may want to achieve only an outer line around polygons with the same 
value? In that case, have to repeat the FeatureTypeStyle: once for the outline, 
once for the fill (painter's model, so it starts "painting" according to the 
instructions at the top)

<FeatureTypeStyle>
  <Rule>
    <Name>outline</Name>
    <Filter>...</Filter>
    <PolygonSymbolizer>
      <Stroke>
        <CssParameter name='stroke'>#000000</CssParameter>
        <CssParameter name='stroke-width'>1</CssParameter>
        <CssParameter name='stroke-opacity'>1</CssParameter>
      </Stroke>
    </PolygonSymbolizer>
  </Rule>
</FeatureTypeStyle>
<FeatureTypeStyle>
  <Rule>
    <Name>fill</Name>
    <Filter>...</Filter>
    <PolygonSymbolizer>
      <Fill>
        <CssParameter name='fill'>#FF0000</CssParameter>
        <CssParameter name='fill-opacity'>1</CssParameter>
      </Fill>
    </PolygonSymbolizer>
  </Rule>
</FeatureTypeStyle>

Hopefully, it gives you some food for thought to overcome the issue you're 
seeing in the map.

 

Kind regards,

Edward

 

On 26-03-2020 07:59, Brad Hards wrote:

What were you expecting to see, and what are you seeing instead?

 

Brad

 

From: Brad Spencer  <mailto:b...@numaps.com.au> <b...@numaps.com.au> 
Sent: Thursday, 26 March 2020 5:48 PM
To: geoserver-users@lists.sourceforge.net 
<mailto:geoserver-users@lists.sourceforge.net> 
Subject: [Geoserver-users] SLD on Geoserver

 

Guys, I have the following SLD that is just not rendering correctly. 

 

Can someone look over this and advise if this does not make any sense.

 

Cheers, Brad…

 

<?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"; 
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd 
<http://www.opengis.net/sld%20StyledLayerDescriptor.xsd> "><NamedLayer>

<Name>undefined</Name>

<UserStyle>

<Title>braddles tester7</Title>

<Name>braddles tester7</Name>

<FeatureTypeStyle>

<Rule>

              <Name>Stress Between 30% and 80%</Name>

              <Filter>

                             <And>

                                           <And>

<!—make sure that the attributes are not zero to avoid zero divide -->

                                                          
<PropertyIsGreaterThan>

                                                                        <Mul>

                                                                                
      <PropertyName>median_tot_hhd_inc_weekly</PropertyName>

                                                                                
      <Literal>4.33333333</Literal>

                                                                        </Mul>

                                                                        
<Literal>0.0</Literal>

                                                          
</PropertyIsGreaterThan>

                                                          
<PropertyIsGreaterThan>

                                                                   
<PropertyName>median_mortgage_repay_monthly</PropertyName>

                                                                        
<Literal>0.0</Literal>

                                                          
</PropertyIsGreaterThan>

                                           <\And>

                                           <And>

                                                          <!—given no zero 
divides, include all polygons that have a mortgage stress greater than 30% AND 
less than 80%-->

                                                          
<PropertyIsGreaterThanOrEqualTo>

                                                                        <Mul>

                                                                                
      <Div>

                                                                                
               <PropertyName>median_mortgage_repay_monthly</PropertyName>

                                                                                
                     <Mul>

                                                                                
                                   
<PropertyName>median_tot_hhd_inc_weekly</PropertyName>

                                                                                
                                   <Literal>4.33333333</Literal>

                                                                                
                     </Mul>

                                                                                
      </Div>

                                                                                
      <Literal>100</Literal>

                                                                        </Mul>

                                                                        
<Literal>30</Literal>

                                                          
</PropertyIsGreaterThanOrEqualTo>

                                                          
<PropertyIsLessThanOrEqualTo>

                                                                        <Mul>

                                                                                
      <Div>

                                                                                
               <PropertyName>median_mortgage_repay_monthly</PropertyName>

                                                                                
                     <Mul>

                                                                                
                    <PropertyName>median_tot_hhd_inc_weekly</PropertyName>

                                                                                
                     <Literal>4.33333333</Literal>

                                                                                
                     </Mul>

                                                                                
      </Div>

                                                                                
      <Literal>100</Literal>

                                                                        </Mul>

                                                                        
<Literal>80</Literal>

                                                          
</PropertyIsLessThanOrEqualTo>

                                           </And>

                             </And>

              </Filter>

 

              <PolygonSymbolizer>

                             <Fill>

                                           <CssParameter 
name='fill'>#FF0000</CssParameter>

                                           <CssParameter 
name='fill-opacity'>1</CssParameter>

                             </Fill>

              </PolygonSymbolizer>

              <PolygonSymbolizer>

                             <Stroke>

                                           <CssParameter 
name='stroke'>#000000</CssParameter>

                                           <CssParameter 
name='stroke-width'>1</CssParameter>

                                           <CssParameter 
name='stroke-opacity'>1</CssParameter>

                             </Stroke>

              </PolygonSymbolizer>

</Rule>

</FeatureTypeStyle>

</UserStyle>

</NamedLayer>

</StyledLayerDescriptor>

 

Brad Spencer

Managing Director



 <http://www.numaps.com.au/> http://www.numaps.com.au/

mob: 0404 841 131

 <https://www.facebook.com/pg/numaps.com.au/photos/?ref=page_internal> BradArt

 

 

 

 






_______________________________________________
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
 
 
Geoserver-users@lists.sourceforge.net 
<mailto:Geoserver-users@lists.sourceforge.net> 
https://lists.sourceforge.net/lists/listinfo/geoserver-users

_______________________________________________
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


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to