1

I am trying to display vector data of state borders, downloaded from GeoServer as GeoTiff, in QGIS. By default downloaded raster looks like this: image with NoData Value

After disabling NoData value in raster->Properties->(uncheck)NoData Value: image without NoData Value

Current SDL code is:

        <FeatureTypeStyle>              
            <Rule>
                <Name>Ime</Name>
                <MinScaleDenominator>70000</MinScaleDenominator>
                <MaxScaleDenominator>170000</MaxScaleDenominator>
                <PolygonSymbolizer>
                    <Fill>
                        <CssParameter name="fill">#FFFFFF</CssParameter>
                        <CssParameter name="fill-opacity">0.1</CssParameter>
                    </Fill>
                    <Stroke>
                        <CssParameter name="stroke">#000000</CssParameter>
                        <CssParameter name="stroke-width">0</CssParameter>
                    </Stroke>
                </PolygonSymbolizer>
                <TextSymbolizer>
                    <Geometry>
                        <ogc:Function name="centroid">
                            <ogc:PropertyName>SHAPE</ogc:PropertyName>
                        </ogc:Function>
                    </Geometry>
                    <Label>
                        <ogc:PropertyName>NAZIV</ogc:PropertyName>
                    </Label>
                    <Font>
                        <CssParameter name="font-family">Verdana, Geneva, sans-serif</CssParameter>
                        <CssParameter name="font-size">16</CssParameter>
                        <CssParameter name="font-weight">bold</CssParameter>
                    </Font>
                    <LabelPlacement>
                        <PointSymbolizer>
                            <AnchorPoint>
                                <AnchorPointX>0</AnchorPointX>
                                <AnchorPointY>0</AnchorPointY>
                            </AnchorPoint>
                        </PointSymbolizer>
                    </LabelPlacement>
                    <VendorOption name="autoWrap">80</VendorOption>
                    <VendorOption name="maxDisplacement">20</VendorOption>
                </TextSymbolizer>
            </Rule>             
        </FeatureTypeStyle>

Is there any way to disable NoData Value in Geoserver?

  • 2
    I honestly don't understand the question. This no data is applied on the QGIS side not by GeoServer, correct? If so, GeoServer has nothing to do with it. – simogeo Aug 3 '15 at 9:51
1

First of all, you are using a Polygon symbolizer (for vector data) on a GeoTiff (raster data), which won't work. On the raster data, if it is a single channel raster, you GeoTiff will have a value that represents NoData (usually a very large negative value like -9999 - QGIS can tell you what it is). From your pictures, I believe you want NoData to appear black, so just add a ColorMapEntry in a suitable RasterSymbolizer and set the numeric value of NoData to black. See here for more information on the RasterSymbolizer.

Alternatively, if you are doing this in QGIS (your question is a little ambiguous), you can use an SLD but you may just want to set the appearance of NoData in the layer properties style tab (or possibly set it to transparent in the transparancy tab.

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.