I have a really strange problem which I don't know how to solve. I have shp file I've import into PostGIS using PostGIS Loader (made sure the srs is 4326 same is shp file) .

In geoserver (2.6.1) I've created a postgres store and published the table I've imported , set it SRS (WGS84) and style (default Polygon).

Now this is where things go weird and I have no idea how to approach this problem:

  1. If I Preview the layer via WFS (KML/GeoJson/CSV etc...) I get the txt files with all features inside.

  2. If I try to preview via openlayers or any other WMS (like geotiff) either I see empty map or get error

  3. When I create a store of shp files with the data I've imported , it shows fine as wms.

Here is example that I do see features via wfs (csv) but error in wms.

Any idea ?!

enter image description here

EDIT 1: It was pointed out in comments that "width=78450&height=330" is a strange size (although this is what geoserver auto generate in preview) so I've manually edited the request to :


and now I get empty image: enter image description here

Since I do see the data in the shp files preview :


I tend to think that the problem is somewhere from reading the data from PostGIS.

enter image description here

Last thing I did is comparing the shp layer settings to the postgis layer settings but I don't see anything that might hint on the problem I have:

enter image description here

Update 2:

I've checked geoserver log and noticed that the following query returns null:

SELECT encode(ST_AsBinary(ST_Simplify(ST_Force_2D("the_geom"), 0.002246433788820923)),'base64') as "the_geom" FROM datatable

Now , the_geom column is geometry type and is not null . When running ST_Simplify it brings back null :

This is working :

SELECT ST_Force_2D("the_geom") as "the_geom" FROM "public"."datatable"

This brings the nulls :

SELECT ST_Simplify(ST_Force_2D("the_geom"), 0.002246433788820923) as "the_geom" FROM "public"."datatable"

Any idea why ?

  • "width=78450&height=330" That seems like a strange size to request, but it isn't inconsistent with your BBOX. It seems weird though that your BBOX is a slim area from 0 to 127W. Perhaps the request is malformed, or some null geometry snuck into your shapefile.
    – DPierce
    Jan 17, 2015 at 18:07
  • Thank you for your comment , based on it I've updated my question with more information
    – Alophind
    Jan 17, 2015 at 18:25
  • Can you find a reason for why the bounding box between the shapefile and the postgis layer are a little off? Have you tried re-computing them, and forcing the shape file native SRS to 4326. Also, your data looks like multipolgyons in the csv, but renders more like points in one of those screenshots.
    – DPierce
    Jan 17, 2015 at 18:46
  • I will delete and import again.
    – Alophind
    Jan 17, 2015 at 19:12
  • 1
    Set GeoServer logging into geotools developer level and you should see the actual SQL that is sent to PostGIS. I would also check that some reasonable style is attached to your layer, though the default styles usually work and render the features with some visible style.
    – user30184
    Jan 18, 2015 at 14:14

1 Answer 1


The solution to this is to remove the checkbox from the store definition : enter image description here

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.