1

I have 4 layers added from my PostGIS database, which I have shown below. When I click OpenLayers preview for the top two, they are displayed fine. However, for the bottom two layers it just displays an empty map.

enter image description here

When I view the layers on QGIS from DB manager, the preview shows. Furthermore, I can open the GML and see that there are polygons with coordinates. The only difference I can think of is that the bottom two layers are too complex to render. Here's an image of what the peat_lands layer looks like:

enter image description here

UPDATE: I tested my theory by removing all rows from peat_lands except 1, and when I tried previewing it worked. So it seems like Geoserver can't handle large layers with complex shapes. I'm wondering if this is because of Geoserver, or the AWS EC2 instance I'm running on (t2.micro). I don't think it's the latter since when I check it's CPU utilization it barely reaches 15%.

DEVELOPER LOGS:

16 Apr 01:41:36 INFO   [geoserver.wms] - 
Request: getServiceInfo
16 Apr 01:41:37 INFO   [geoserver.wms] - 
Request: getMap
    Angle = 0.0
    BaseUrl = http://example-ec2.ap-southeast-1.compute.amazonaws.com:8080/geoserver/
    Bbox = SRSEnvelope[9319883.0 : 1.3845872E7, -1055984.625 : 935772.0625]
    BgColor = java.awt.Color[r=255,g=255,b=255]
    Buffer = 0
    Clip = null
    CQLFilter = null
    Crs = GEOGCS["WGS 84", 
  DATUM["World Geodetic System 1984", 
    SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], 
    AUTHORITY["EPSG","6326"]], 
  PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 
  UNIT["degree", 0.017453292519943295], 
  AXIS["Geodetic longitude", EAST], 
  AXIS["Geodetic latitude", NORTH], 
  AUTHORITY["EPSG","4326"]]
    Elevation = []
    Env = {}
    Exceptions = SE_XML
    FeatureId = null
    FeatureVersion = null
    Filter = null
    Format = application/openlayers
    FormatOptions = {}
    Get = true
    Height = 337
    Interpolations = []
    Layers = [org.geoserver.wms.MapLayerInfo@24440c10]
    MaxFeatures = null
    Palette = null
    RawKvp = {REQUEST=GetMap, SRS=EPSG:4326, FORMAT=application/openlayers, BBOX=9319883.0,-1055984.625,1.3845872E7,935772.0625, VERSION=1.1.0, STYLES=, SERVICE=WMS, WIDTH=768, HEIGHT=337, LAYERS=rspo:peat_lands}
    RemoteOwsType = null
    RemoteOwsURL = null
    Request = GetMap
    RequestCharset = UTF-8
    ScaleMethod = null
    Sld = null
    SldBody = null
    SldVersion = null
    SortBy = null
    SortByArrays = null
    SRS = EPSG:4326
    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 = 768
16 Apr 01:41:37 INFO   [geoserver.wms] - 
Request: getServiceInfo
16 Apr 01:41:37 INFO   [geoserver.wms] - 
Request: getMap
    Angle = 0.0
    BaseUrl = http://example-ec2.ap-southeast-1.compute.amazonaws.com:8080/geoserver/
    Bbox = SRSEnvelope[1.158233765625E7 : 1.158341765625E7, -60342.890625 : -59868.984375]
    BgColor = java.awt.Color[r=255,g=255,b=255]
    Buffer = 0
    Clip = null
    CQLFilter = null
    Crs = GEOGCS["WGS 84", 
  DATUM["World Geodetic System 1984", 
    SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], 
    AUTHORITY["EPSG","6326"]], 
  PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 
  UNIT["degree", 0.017453292519943295], 
  AXIS["Geodetic longitude", EAST], 
  AXIS["Geodetic latitude", NORTH], 
  AUTHORITY["EPSG","4326"]]
    Elevation = []
    Env = {}
    Exceptions = application/vnd.ogc.se_inimage
    FeatureId = null
    FeatureVersion = null
    Filter = null
    Format = image/png
    FormatOptions = {}
    Get = true
    Height = 337
    Interpolations = []
    Layers = [org.geoserver.wms.MapLayerInfo@24440c10]
    MaxFeatures = null
    Palette = null
    RawKvp = {EXCEPTIONS=application/vnd.ogc.se_inimage, REQUEST=GetMap, FORMAT=image/png, SRS=EPSG:4326, BBOX=11582337.65625,-60342.890625,11583417.65625,-59868.984375, VERSION=1.1.1, STYLES=, SERVICE=WMS, WIDTH=768, HEIGHT=337, TRANSPARENT=true, LAYERS=rspo:peat_lands}
    RemoteOwsType = null
    RemoteOwsURL = null
    Request = GetMap
    RequestCharset = UTF-8
    ScaleMethod = null
    Sld = null
    SldBody = null
    SldVersion = null
    SortBy = null
    SortByArrays = null
    SRS = EPSG:4326
    StartIndex = null
    StyleBody = null
    StyleFormat = sld
    Styles = [StyleImpl[ name=polygon]]
    StyleUrl = null
    StyleVersion = null
    Tiled = false
    TilesOrigin = null
    Time = []
    Transparent = true
    ValidateSchema = false
    Version = 1.1.1
    ViewParams = null
    Width = 768
6
  • 1
    Did you calculate the extents in GeoServer before publishing?
    – Matt
    Apr 14, 2023 at 8:18
  • What does the log file say?
    – Ian Turton
    Apr 14, 2023 at 12:02
  • Yes, the extents match the ones I have in QGIS. The log file doesn't have any errors, just info for getMap
    – Will
    Apr 14, 2023 at 12:21
  • Welcome to Geographic Information Systems! You need to turn up the logging level to developer in the global settings page, and then make the request again. Then edit your question with the relevant part of the log file.
    – Ian Turton
    Apr 15, 2023 at 16:26
  • @IanTurton Thanks for clarifying, I've updated my question with the relevant part of the log file.
    – Will
    Apr 16, 2023 at 1:49

1 Answer 1

2

Your projections for the data are wrong! If you look at the log file you will see:

Bbox = SRSEnvelope[1.158233765625E7 : 1.158341765625E7, -60342.890625 : -59868.984375]
BgColor = java.awt.Color[r=255,g=255,b=255]
Buffer = 0
Clip = null
CQLFilter = null
Crs = GEOGCS["WGS 84", 
DATUM["World Geodetic System 1984", 
SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], 
AUTHORITY["EPSG","6326"]], 
PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 
UNIT["degree", 0.017453292519943295], 
AXIS["Geodetic longitude", EAST], 
AXIS["Geodetic latitude", NORTH], 
AUTHORITY["EPSG","4326"]]

So you (or the preview page) have requested a map with bounds of 1.158233765625E7 : 1.158341765625E7, -60342.890625 : -59868.984375 in EPSG:4326 (lat/lon degrees -90,90/-180,180) which is clearly wrong. So if that is the correct projection then your data will all be plotted in a small (probably subpixel) dot off the edge of the screen.

I think you need to go back to your original data import and check what projection your data is really in.

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.