2

I want to edit points size based on the scale and also I want to set up colors based on one attribute column (Quantities in ArcMap, 10 classes).

I already wrote SLD rules for colors, but I don't know how to insert maxscale and minscale for the same points.

For example my SLD looks like this:

<sld:Rule>
          <sld:Name>0,000001 - 0,363959</sld:Name>
          <sld:Title>0,000001 - 0,363959</sld:Title>
          <ogc:Filter>
            <ogc:PropertyIsBetween>
              <ogc:PropertyName>attribute</ogc:PropertyName>
              <ogc:LowerBoundary>
                <ogc:Literal>1E-06</ogc:Literal>
              </ogc:LowerBoundary>
              <ogc:UpperBoundary>
                <ogc:Literal>0.363959</ogc:Literal>
              </ogc:UpperBoundary>
            </ogc:PropertyIsBetween>
          </ogc:Filter>
          <sld:PointSymbolizer>
            <sld:Graphic>
              <sld:Mark>
                <sld:WellKnownName>circle</sld:WellKnownName>
                <sld:Fill>
                  <sld:CssParameter name="fill">#5ABA00</sld:CssParameter>
                  <sld:CssParameter name="fill-opacity">1.0</sld:CssParameter>
                </sld:Fill>
              </sld:Mark>
              <sld:Size>4</sld:Size>
              <sld:Rotation>0</sld:Rotation>
            </sld:Graphic>
          </sld:PointSymbolizer>
        </sld:Rule>
        <sld:Rule>
          <sld:Name>0,363960 - 1,414790</sld:Name>
          <sld:Title>0,363960 - 1,414790</sld:Title>
          <ogc:Filter>
            <ogc:PropertyIsBetween>
              <ogc:PropertyName>attribute</ogc:PropertyName>
              <ogc:LowerBoundary>
                <ogc:Literal>0.36396</ogc:Literal>
              </ogc:LowerBoundary>
              <ogc:UpperBoundary>
                <ogc:Literal>1.41479</ogc:Literal>
              </ogc:UpperBoundary>
            </ogc:PropertyIsBetween>
          </ogc:Filter>
          <sld:PointSymbolizer>
            <sld:Graphic>
              <sld:Mark>
                <sld:WellKnownName>circle</sld:WellKnownName>
                <sld:Fill>
                  <sld:CssParameter name="fill">#83CF00</sld:CssParameter>
                  <sld:CssParameter name="fill-opacity">1.0</sld:CssParameter>
                </sld:Fill>
              </sld:Mark>
              <sld:Size>4</sld:Size>
              <sld:Rotation>0</sld:Rotation>
            </sld:Graphic>
          </sld:PointSymbolizer>
        </sld:Rule>

So, where to insert max scale and min scale rule? How to insert it? What value to set up (max zoom out must be Australia).

It is pretty emercency, and thank you so much.

2

When in doubt with SLD you should always read the spec or if you are in a hurry and what you want is pretty simple then check out the SLD Cookbook.

In this case the cookbook provides the answer at http://docs.geoserver.org/stable/en/user/styling/sld-cookbook/points.html#zoom-based-point

  • Thank you, but I need not only zoom-based-point but also attribute-based-point.. my question is how to merge it in one SLD. – againstflow Apr 19 '12 at 15:36
  • just add a min/max scale to each rule for each zoom level. – Ian Turton Apr 19 '12 at 15:48
  • can you explain me how to do it with my example? where to insert min/max scale into the coding? thank you. – againstflow Apr 20 '12 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.