[Geoserver-users] display scale

Hi everybody

I'm sorry if this is a dumb question, but I can't seem to figure out how to display features only at certain scales.

I'm assuming this is somewhere in the geosever FeatureType configs, but I can't pin point where.

You guys have any pointers?

Kind regards from Iceland,

Gissur

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.19.9/1238 - Release Date: 22.1.2008 20:12

Hi Gissur,

Not a dumb question at all :). The way you do scale dependent rendering
in GeoServer is with SLD, in particular a Min/Max ScaleDenominator
element in a rule. In your geoserver install, check out
'data_dir/styles/popshade.sld' and search for MinScaleDenominator. This
should give you an example of how to use it.

If you have any more questions please don't hesitate to ask.

-Justin

Gissur Þórhallsson wrote:

Hi everybody

I’m sorry if this is a dumb question, but I can’t seem to figure out how
to display features only at certain scales.

I’m assuming this is somewhere in the geosever FeatureType configs, but
I can’t pin point where.

You guys have any pointers?

Kind regards from Iceland ,

Gissur

!DSPAM:4007,47977d2a150571961014482!

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.19.9/1238 - Release Date:
22.1.2008 20:12

------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

!DSPAM:4007,47977d2a150571961014482!

------------------------------------------------------------------------

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

!DSPAM:4007,47977d2a150571961014482!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Hi!
I was trying to figure that out as well, thanks for asking Gissur.
Now I tried to change my SLD file to show cities as circles in different colors for different number of inhabitants and visible depending to the scale. Big cities should already be visible on a small scale whereas small villages should only be visible on high scales.
I especially don't get around with Propertyname. Should there be the name of the column of the shapefile where the expression is that changes to indicate different size of cities? Or the Expression itself to indicate which size I want to be displayed that way? Or just scale if that's what should be indicating. But then I have to let Geoserver know which expression to use at which scale.
Because in the example it seems to me that there is a column that is called PERSONS and comprises the values that are used for LowerBoundary and UpperBoundary. Ion the other hand have a table with a column with the names of the city and a column called class with values from 1 to 10. 10 are big cities 1 are small villages. That is not indicated otherwise in the table, I just know thats what the numbers stand for.
Another question, do I have to put the rules twice, once for circle once for label or is there a way to combine that?
By the way it's geoserver 1.5.4 and shapefiles.
Thanks for helping me
Kathrin

<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
xmlns="http://www.opengis.net/sld&quot; xmlns:ogc="http://www.opengis.net/ogc&quot;
xmlns:xlink="http://www.w3.org/1999/xlink&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
<NamedLayer>
<Name>habitpnt</Name>
<UserStyle>
<Name>habitpnt_style</Name>
<Title>geoserver style</Title>
<Abstract>Generated by GeoServer</Abstract>
<FeatureTypeStyle>
<Rule>
<ogc:Filter xmlns:gml="http://www.opengis.net/gml&quot;&gt;
<ogc:PropertyIsBetween>
<ogc:PropertyName>Scale</ogc:PropertyName> //Name of column
<ogc:LowerBoundary>
<ogc:Literal>0</ogc:Literal> //MinScale
</ogc:LowerBoundary>
<ogc:UpperBoundary>
<ogc:Literal>1500000</ogc:Literal> //Maxscale
</ogc:UpperBoundary>
</ogc:PropertyIsBetween>
</ogc:Filter>
<PointSymbolizer>
<Graphic>
<Mark>
<WellKnownName>circle</WellKnownName>
<Fill>
<CssParameter name="fill">#CC0000</CssParameter>
<CssParameter name="fill-opacity">1</CssParameter>
</Fill>
</Mark>
<Opacity>1</Opacity>
<Size>2</Size>
</Graphic>
</PointSymbolizer>

<TextSymbolizer>
<Label>
<ogc:PropertyName>NAME</ogc:PropertyName>
</Label>
<Font>
<CssParameter name="font-family">Times New Roman</CssParameter>
<CssParameter name="font-style">Normal</CssParameter>
<CssParameter name="font-size">12</CssParameter>
</Font>
<Fill>
<CssParameter name="fill">#000000</CssParameter>
<CssParameter name="fill-opacity">1</CssParameter>
</Fill>
</TextSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>

Justin Deoliveira wrote:

Hi Gissur,

Not a dumb question at all :). The way you do scale dependent rendering
in GeoServer is with SLD, in particular a Min/Max ScaleDenominator
element in a rule. In your geoserver install, check out
'data_dir/styles/popshade.sld' and search for MinScaleDenominator. This
should give you an example of how to use it.

If you have any more questions please don't hesitate to ask.

-Justin

Gissur Þórhallsson wrote:
  

Hi everybody

I’m sorry if this is a dumb question, but I can’t seem to figure out how
to display features only at certain scales.

I’m assuming this is somewhere in the geosever FeatureType configs, but
I can’t pin point where.

You guys have any pointers?

Kind regards from Iceland ,

Gissur

!DSPAM:4007,47977d2a150571961014482!

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.19.9/1238 - Release Date:
22.1.2008 20:12

------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

!DSPAM:4007,47977d2a150571961014482!

------------------------------------------------------------------------

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

!DSPAM:4007,47977d2a150571961014482!
    

Kathrin KÖHL ha scritto:

Hi!
I was trying to figure that out as well, thanks for asking Gissur.
Now I tried to change my SLD file to show cities as circles in different colors for different number of inhabitants and visible depending to the scale. Big cities should already be visible on a small scale whereas small villages should only be visible on high scales.
I especially don't get around with Propertyname. Should there be the name of the column of the shapefile where the expression is that changes to indicate different size of cities? Or the Expression itself to indicate which size I want to be displayed that way? Or just scale if that's what should be indicating. But then I have to let Geoserver know which expression to use at which scale.
Because in the example it seems to me that there is a column that is called PERSONS and comprises the values that are used for LowerBoundary and UpperBoundary. Ion the other hand have a table with a column with the names of the city and a column called class with values from 1 to 10. 10 are big cities 1 are small villages. That is not indicated otherwise in the table, I just know thats what the numbers stand for.
Another question, do I have to put the rules twice, once for circle once for label or is there a way to combine that?

Hum, tons of questions :slight_smile:
I suggest you have a look at the SLD 1.0 specification here:
http://portal.opengeospatial.org/files/?artifact_id=1188
That may answer various of your questions.
We also have samples here (dead slow today):
http://docs.codehaus.org/display/GEOSDOC/OGC+SLD+Explanations+and+Samples

To briefly answer your questions, the scale denominator rules
apply only to scale denominator, not to other properties. Yet
you can use whatever attribute is in your attribute type in Rule
to create an OGC Filter to match the features you want to symbolize.
And yes, you can put as many symbolizers as you want in a single rule.

I also suggest you look at samples SLD we ship along with GeoServer,
population.sld, poly_landmarks.sld and tiger_roads.sld, the first two
use attribute based filtering, the latter use scale based filtering.

Hope this helps
Cheers
Andrea
the other scale based one. Hope this helps

Hi!
Thanks I more or less solved my request with the different examples. It's not completely how I want it but good for a start :slight_smile:
Thanks for the help
Kathrin

Andrea Aime wrote:

Kathrin KÖHL ha scritto:

Hi!
I was trying to figure that out as well, thanks for asking Gissur.
Now I tried to change my SLD file to show cities as circles in different colors for different number of inhabitants and visible depending to the scale. Big cities should already be visible on a small scale whereas small villages should only be visible on high scales.
I especially don't get around with Propertyname. Should there be the name of the column of the shapefile where the expression is that changes to indicate different size of cities? Or the Expression itself to indicate which size I want to be displayed that way? Or just scale if that's what should be indicating. But then I have to let Geoserver know which expression to use at which scale.
Because in the example it seems to me that there is a column that is called PERSONS and comprises the values that are used for LowerBoundary and UpperBoundary. Ion the other hand have a table with a column with the names of the city and a column called class with values from 1 to 10. 10 are big cities 1 are small villages. That is not indicated otherwise in the table, I just know thats what the numbers stand for.
Another question, do I have to put the rules twice, once for circle once for label or is there a way to combine that?

Hum, tons of questions :slight_smile:
I suggest you have a look at the SLD 1.0 specification here:
http://portal.opengeospatial.org/files/?artifact_id=1188
That may answer various of your questions.
We also have samples here (dead slow today):
http://docs.codehaus.org/display/GEOSDOC/OGC+SLD+Explanations+and+Samples

To briefly answer your questions, the scale denominator rules
apply only to scale denominator, not to other properties. Yet
you can use whatever attribute is in your attribute type in Rule
to create an OGC Filter to match the features you want to symbolize.
And yes, you can put as many symbolizers as you want in a single rule.

I also suggest you look at samples SLD we ship along with GeoServer,
population.sld, poly_landmarks.sld and tiger_roads.sld, the first two
use attribute based filtering, the latter use scale based filtering.

Hope this helps
Cheers
Andrea
the other scale based one. Hope this helps