Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am creating some sld's using QGIS for use in Geoserver and wanted to view the current zoom level so that I can then define it in the zoom level. Is this possible?

For example

    <!-- Local Roads 1787 - 3573-->
    <FeatureTypeStyle>
        <Rule>
            <ogc:Filter>
                <ogc:PropertyIsEqualTo>
                    <ogc:PropertyName>State_cont</ogc:PropertyName>
                    <ogc:Literal>Y</ogc:Literal>
                </ogc:PropertyIsEqualTo>
            </ogc:Filter>
            <MinScaleDenominator>1787</MinScaleDenominator>
            <MaxScaleDenominator>3573</MaxScaleDenominator>
            <LineSymbolizer>
                <Stroke>
                    <CssParameter name="stroke">#CDAA66</CssParameter>
                    <CssParameter name="stroke-width">7</CssParameter>
                    <CssParameter name="stroke-linecap">round</CssParameter>
                </Stroke>
            </LineSymbolizer>
        </Rule>
    </FeatureTypeStyle>
    <FeatureTypeStyle>
        <Rule>
            <ogc:Filter>
                <ogc:PropertyIsEqualTo>
                    <ogc:PropertyName>State_cont</ogc:PropertyName>
                    <ogc:Literal>Y</ogc:Literal>
                </ogc:PropertyIsEqualTo>
            </ogc:Filter>
            <MinScaleDenominator>1787</MinScaleDenominator>
            <MaxScaleDenominator>3573</MaxScaleDenominator>
            <LineSymbolizer>
                <Stroke>
                    <CssParameter name="stroke">#FFFFFF</CssParameter>
                    <CssParameter name="stroke-width">6</CssParameter>
                    <CssParameter name="stroke-linecap">round</CssParameter>
                </Stroke>
            </LineSymbolizer>
            <TextSymbolizer>
                <Label>
                    <ogc:PropertyName>road_name2</ogc:PropertyName>
                </Label>
                <Font>
                    <CssParameter name="font-family">Arial</CssParameter>
                    <CssParameter name="font-size">10</CssParameter>
                    <CssParameter name="font-style">normal</CssParameter>
                </Font>
                <LabelPlacement>
                    <LinePlacement/>
                </LabelPlacement>
                <Halo>
                    <Radius>
                        <ogc:Literal>1</ogc:Literal>
                    </Radius>
                    <Fill>
                        <CssParameter name="fill">
                            <ogc:Literal>#FFFFFF</ogc:Literal>
                        </CssParameter>
                        <CssParameter name="fill-opacity">
                            <ogc:Literal>1</ogc:Literal>
                        </CssParameter>
                    </Fill>
                </Halo>                        
                <Fill>
                    <CssParameter name="fill">#000000</CssParameter>
                </Fill>
                <VendorOption name="followLine">true</VendorOption>
                <VendorOption name="maxAngleDelta">30</VendorOption>
                <VendorOption name="maxDisplacement">800</VendorOption>
                <VendorOption name="repeat">1000</VendorOption>
            </TextSymbolizer>
        </Rule>
    </FeatureTypeStyle>

    <!-- Local Roads 3573 - 28573-->
    <FeatureTypeStyle>
        <Rule>
            <ogc:Filter>

where

<!-- Local Roads 

and

             <MinScaleDenominator>3573</MinScaleDenominator>
            <MaxScaleDenominator>28573</MaxScaleDenominator>

defines what to do at different zoom levels. I need QGIS to display the above scale denominator values.

Over 150k over 150k zoom

30k-150k enter image description here

<30k enter image description here

TOC enter image description here

The idea is to do rapid prototyping of different style options in QGIS and then export the SLD's to Geoserver for production. So people can zoom in out and turn on/off the relevant symbology. This would be easier if you can set zoom levels for different symbology from within the properties-->style tab like in arcgis. What I found for QGIS http://qgis.spatialthoughts.com/2012/02/styling-vector-data-in-qgis-using-size.html doesn't do the job as I want the layer turned on/off at different zoom levels.

share|improve this question
1  
Do you want to create a style for each scale in one SLD? –  Nathan W Jun 11 '13 at 6:37
    
yes I do. I think it will be easier to visualize this in QGIS and do rapid prototyping this way and then export the sld's to geoserver. See edited post for the way my layers are set up in the TOC. Any advice on different ways to achieve the result is appreciated as well... –  GeorgeC Jun 11 '13 at 11:55

1 Answer 1

up vote 4 down vote accepted

Something you should try, which IMO is one of the cooler QGIS features, is the rule based rendering

enter image description here

If you export this as a SLD it will contain the style for each zoom level in a single SLD.

Note: You can't turn each rule on and off in the TOC but there is a feature request for that which hopefully might happen for 2.1.

Also Note: Labels can be done using the expression based labels using a CASE WHEN..THEN and the $scale variable but I don't know if that would export to SLD well.

share|improve this answer
    
Thanks. I looked there but didn't notice Min/Max scale till now. Also found -anitagraser.com/2012/06/03/… ... I guess the saving process will automatically add in the zoom levels according to Geoserver standards as in my example. –  GeorgeC Jun 11 '13 at 13:26
    
If you highlight a bunch of rules and use Add scales to rules it will generate what you see in my image for you without having to do all the hard work. –  Nathan W Jun 11 '13 at 13:27
    
One other related question. Is it possible to get QGIS to group point symbols. So if they are x distance apart at y scale factor they are grouped at the mid point and the number of features displayed? I will add an example shortly. –  GeorgeC Jun 11 '13 at 13:32
    
Yes there is, best to ask a new question :) –  Nathan W Jun 11 '13 at 13:33
    
I'm trying work on the labels to change at different zoom levels and my layer properties looks different to yours. It is a strip on the top and it doesn't have "Labels Depreciated" and "Display". I am on the latest version but not the Dev. QGIS version 1.8.0-Lisboa Compiled against Qt 4.7.1, QGIS code revision ac2970b –  GeorgeC Jun 14 '13 at 6:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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