0

I have a few polygon layers in GeoServer (vs. 2.22.2) that are returning empty (or blank) images from WMS GetMap requests.

I have checked to make sure there is data there, WFS (GeoJSON) requests do return features. I have also tested the styling by swapping out the generic GeoServer polygon styling; it works on other layers, but not on the ones in question.

How can I debug this issue?

WMS request: https://nrri-atlas.d.umn.edu/geoserver/nra/wms?service=WMS&version=1.1.0&request=GetMap&layers=nra%3Acensus_tract_proj&bbox=189778.1898%2C4816297.4321%2C761657.1368%2C5472414.1437&width=669&height=768&srs=EPSG%3A26915&styles=polygon&format=image%2Fpng

Relevant portion from the log (log level set at GEOTOOLS_DEVELOPER_LOGGING):

11 Jul 20:51:49 INFO   [geoserver.wms] - 
Request: getServiceInfo
11 Jul 20:51:49 DEBUG  [data.util] - CRSConverterFactory can be applied from Strings to CRS  only.
11 Jul 20:51:49 DEBUG  [data.util] - InterpolationConverterFactory can be applied from Strings to Interpolation  only.
11 Jul 20:51:49 DEBUG  [data.util] - CRSConverterFactory can be applied from Strings to CRS  only.
11 Jul 20:51:49 DEBUG  [data.util] - InterpolationConverterFactory can be applied from Strings to Interpolation  only.
11 Jul 20:51:49 INFO   [geoserver.flow] - Request [WMS 1.1.0 GetMap] starting, processing through flow controllers
11 Jul 20:51:49 INFO   [geoserver.flow] - Request control-flow performed, running requests: 1, blocked requests: 0
11 Jul 20:51:49 DEBUG  [renderer.lite] - Computed scale denominator: 3052951.8844757625
11 Jul 20:51:49 DEBUG  [renderer.lite] - creating rules for scale denominator - 3,052,951.884
11 Jul 20:51:49 DEBUG  [data.util] - CRSConverterFactory can be applied from Strings to CRS  only.
11 Jul 20:51:49 DEBUG  [data.util] - InterpolationConverterFactory can be applied from Strings to Interpolation only.
11 Jul 20:51:49 DEBUG  [renderer.lite] - Processing 1 stylers for http://nrri-atlas.d.umn.edu/geoserver/nra:census_tract_proj
11 Jul 20:51:49 DEBUG  [renderer.lite] - Expanding rendering area by 2 pixels to consider stroke width
11 Jul 20:51:49 DEBUG  [renderer.lite] - Querying layer http://nrri-atlas.d.umn.edu/geoserver/nra:census_tract_proj with bbox: ReferencedEnvelope[188068.53674469356 : 763366.7898553064, 4814588.794830209 : 5474122.780969791] DefaultProjectedCRS[EPSG:NAD83 / UTM zone 15N] AXIS["Easting", EAST] AXIS["Northing", NORTH]
11 Jul 20:51:49 DEBUG  [geotools.jdbc] - CREATE CONNECTION
11 Jul 20:51:49 TRACE  [data.jdbc] - exporting PropertyName
11 Jul 20:51:49 TRACE  [data.jdbc] - exporting LiteralExpression
11 Jul 20:51:49 DEBUG  [data.util] - CRSConverterFactory can be applied from Strings to CRS  only.
11 Jul 20:51:49 DEBUG  [data.util] - InterpolationConverterFactory can be applied from Strings to Interpolation only.
11 Jul 20:51:49 DEBUG  [geotools.jdbc] - SELECT "ogc_fid",encode(ST_AsTWKB(ST_Simplify(ST_Force2D("geom"), 683.4549079164863, true),-2), 'base64') as "geom" FROM "census_tract_proj" WHERE "geom" && ST_GeomFromText('POLYGON ((188068.53674469356 4814588.794830209, 188068.53674469356 5474122.780969791, 763366.7898553064 5474122.780969791, 763366.7898553064 4814588.794830209, 188068.53674469356 4814588.794830209))', 4269)
11 Jul 20:51:49 DEBUG  [geotools.jdbc] - CLOSE CONNECTION
11 Jul 20:51:49 DEBUG  [renderer.label] - TOTAL LINE LABELS : 0
11 Jul 20:51:49 DEBUG  [renderer.label] - PAINTED LINE LABELS : 0
11 Jul 20:51:49 DEBUG  [renderer.label] - REMAINING LINE LABELS : 0
11 Jul 20:51:49 DEBUG  [renderer.lite] - Style cache hit ratio: NaN , hits 0, requests 0
11 Jul 20:51:49 INFO   [geoserver.wms] - 
Request: getMap
    Angle = 0.0
    BaseUrl = https://nrri-atlas.d.umn.edu/geoserver/
    Bbox = SRSEnvelope[189778.1898 : 761657.1368, 4816297.4321 : 5472414.1437]
    BgColor = java.awt.Color[r=255,g=255,b=255]
    Buffer = 0
    Clip = null
    CQLFilter = null
    Crs = PROJCS["NAD83 / UTM zone 15N", 
  GEOGCS["NAD83", 
    DATUM["North American Datum 1983", 
      SPHEROID["GRS 1980", 6378137.0, 298.257222101, AUTHORITY["EPSG","7019"]], 
      TOWGS84[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 
      AUTHORITY["EPSG","6269"]], 
    PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 
    UNIT["degree", 0.017453292519943295], 
    AXIS["Geodetic longitude", EAST], 
    AXIS["Geodetic latitude", NORTH], 
    AUTHORITY["EPSG","4269"]], 
  PROJECTION["Transverse_Mercator", AUTHORITY["EPSG","9807"]], 
  PARAMETER["central_meridian", -93.0], 
  PARAMETER["latitude_of_origin", 0.0], 
  PARAMETER["scale_factor", 0.9996], 
  PARAMETER["false_easting", 500000.0], 
  PARAMETER["false_northing", 0.0], 
  UNIT["m", 1.0], 
  AXIS["Easting", EAST], 
  AXIS["Northing", NORTH], 
  AUTHORITY["EPSG","26915"]]
    Elevation = []
    Env = {}
    Exceptions = SE_XML
    FeatureId = null
    FeatureVersion = null
    Filter = null
    Format = image/png
    FormatOptions = {}
    Get = true
    Height = 768
    Interpolations = []
    Layers = [org.geoserver.wms.MapLayerInfo@96f95a9f]
    MaxFeatures = null
    Palette = null
    RawKvp = {REQUEST=GetMap, SRS=EPSG:26915, FORMAT=image/png, BBOX=189778.1898,4816297.4321,761657.1368,5472414.1437, VERSION=1.1.0, STYLES=polygon, SERVICE=WMS, WIDTH=669, HEIGHT=768, LAYERS=nra:census_tract_proj}
    RemoteOwsType = null
    RemoteOwsURL = null
    Request = GetMap
    RequestCharset = UTF-8
    ScaleMethod = null
    Sld = null
    SldBody = null
    SldVersion = null
    SortBy = null
    SortByArrays = null
    SRS = EPSG:26915
    StartIndex = null
    StyleBody = null
    StyleFormat = sld
    Styles = [StyleImpl[ name=polygon]]
    StyleUrl = null
    StyleVersion = null
    Tiled = false
    TilesOrigin = null
    Time = []
    Transparent = false
    ValidateSchema = false
    Version = 1.1.0
    ViewParams = null
    Width = 669
11 Jul 20:51:49 INFO   [geoserver.flow] - releasing flow controllers for [WMS 1.1.0 GetMap]
11 Jul 20:51:49 INFO   [geoserver.flow] - Request completed, running requests: 0, blocked requests: 0

Here is the generic polygon SLD used:

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
    xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
    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">
    <!-- a named layer is the basic building block of an sld document -->

  <NamedLayer>
    <Name>Default Polygon</Name>
    <UserStyle>
        <!-- they have names, titles and abstracts -->

      <Title>Grey Polygon</Title>
      <Abstract>A sample style that just prints out a grey interior with a black outline</Abstract>
      <!-- FeatureTypeStyles describe how to render different features -->
      <!-- a feature type for polygons -->

      <FeatureTypeStyle>
        <!--FeatureTypeName>Feature</FeatureTypeName-->
        <Rule>
          <Name>Rule 1</Name>
          <Title>Grey Fill and Black Outline</Title>
          <Abstract>Grey fill with a black outline 1 pixel in width</Abstract>

          <!-- like a linesymbolizer but with a fill too -->
          <PolygonSymbolizer>
            <Fill>
              <CssParameter name="fill">#AAAAAA</CssParameter>
            </Fill>
            <Stroke>
              <CssParameter name="stroke">#000000</CssParameter>
              <CssParameter name="stroke-width">1</CssParameter>
            </Stroke>
          </PolygonSymbolizer>
        </Rule>

        </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>
0

1 Answer 1

0

The first thing to check is if the SQL query is returning any features:

SELECT "ogc_fid",encode(ST_AsTWKB(ST_Simplify(ST_Force2D("geom"), 683.4549079164863, true),-2), 'base64') as "geom" FROM "census_tract_proj" WHERE "geom" && ST_GeomFromText('POLYGON ((188068.53674469356 4814588.794830209, 188068.53674469356 5474122.780969791, 763366.7898553064 5474122.780969791, 763366.7898553064 4814588.794830209, 188068.53674469356 4814588.794830209))', 4269)

The most suspicious thing is the projection of the bounding box, those don't look like EPSG:4269 which I would expect to be in degrees not metres, so it's possible that you have misconfigured the SRS of the table or the data layer.

If that is all correct then the next step is to turn off simplification which has been known to remove small polygons completely, there is a checkbox on the data store page that you can uncheck.

1
  • It was an issue with the SRS, after all. Thank you for putting me onto the right track.
    – rumski20
    Commented Jul 12, 2023 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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