I’m facing some weird behavior with one polygon layer. The layer is stored in postgis using EPSG:4326. The geometries are simply buffers for some points from other table. I have a very simple SLD style with one rule only specifying for the PolygonSymbolizer the fill and the stroke.
The issue is that not all polygons get displayed in different scales (see images attached). Even worse is that at smaller scales no polygons get rendered at all. From postgis i could see that all geometries are valid.
I have also tried to use a PointSymbolizer in the geometry centroid for smaller scales but the results are the same.
Looking at the logs I don’t see anything wrong concerning this situation.
Does anyone have any hints on what might be happening?
Hi Hugo,
I know that ArcSDE exhibits exactly that behaviour when it encounters bad data. I see you’ve confirmed the data is valid in PostGIS - have you tried viewing it in a separate GIS like QGIS?
It may also be worth turning up the GeoServer logging to Geotools Developer level and seeing what they say. I think it should show the exact query being sent to PostGIS so you’ll be able to confirm what PostGIS is sending GeoServer by running the query yourself using PgAdmin or similar.
I’m facing some weird behavior with one polygon layer. The layer is stored in postgis using EPSG:4326. The geometries are simply buffers for some points from other table. I have a very simple SLD style with one rule only specifying for the PolygonSymbolizer the fill and the stroke.
The issue is that not all polygons get displayed in different scales (see images attached). Even worse is that at smaller scales no polygons get rendered at all. From postgis i could see that all geometries are valid.
I have also tried to use a PointSymbolizer in the geometry centroid for smaller scales but the results are the same.
Looking at the logs I don’t see anything wrong concerning this situation.
Does anyone have any hints on what might be happening?
Thanks for the answer. I’ve defined Geotools Developer option for the Geoserver logging and got the query. I see the problem immediately…
Geoserver is using ST_Simplify in the polygon geometries. This is very cool and indeed the most sensible way to generate WMS images faster. However, in my case the ST_simplify is returning “MULTIPOLYGON EMPTY”.
The query being issued is (I have changed it so that I could see the geometries being returned as text):
SELECT “gid”,“name”,st_astext(ST_Simplify(ST_Force_2D(“geom”), 0.10616339071444258)) as “geom” FROM “spatial”.“port_area” WHERE “geom” && ST_GeomFromText(‘POLYGON ((-46.75781250000001 -1.7575368113083254, -46.75781250000001 42.29356419217008, 1.7578124999999918 42.29356419217008, 1.7578124999999918 -1.7575368113083254, -46.75781250000001 -1.7575368113083254))’, 4326)
If I remove ST_Simplify I can confirmed that the geometries are correct and not empty. So my next question would be: is there a way to force Geoserver not to apply ST_Simplify for this layer? Do you have other suggestions?
Hi Hugo,
I know that ArcSDE exhibits exactly that behaviour when it encounters bad data. I see you’ve confirmed the data is valid in PostGIS - have you tried viewing it in a separate GIS like QGIS?
It may also be worth turning up the GeoServer logging to Geotools Developer level and seeing what they say. I think it should show the exact query being sent to PostGIS so you’ll be able to confirm what PostGIS is sending GeoServer by running the query yourself using PgAdmin or similar.
I’m facing some weird behavior with one polygon layer. The layer is stored in postgis using EPSG:4326. The geometries are simply buffers for some points from other table. I have a very simple SLD style with one rule only specifying for the PolygonSymbolizer the fill and the stroke.
The issue is that not all polygons get displayed in different scales (see images attached). Even worse is that at smaller scales no polygons get rendered at all. From postgis i could see that all geometries are valid.
I have also tried to use a PointSymbolizer in the geometry centroid for smaller scales but the results are the same.
Looking at the logs I don’t see anything wrong concerning this situation.
Does anyone have any hints on what might be happening?
Look for the checkbox “Support on the fly geometry simplification” towards the bottom of the postgis store page and uncheck it. This will fix your issue.
For future reference can you say why your polygons become empty when simplified?
Thanks for the answer. I’ve defined Geotools Developer option for the Geoserver logging and got the query. I see the problem immediately…
Geoserver is using ST_Simplify in the polygon geometries. This is very cool and indeed the most sensible way to generate WMS images faster. However, in my case the ST_simplify is returning “MULTIPOLYGON EMPTY”.
The query being issued is (I have changed it so that I could see the geometries being returned as text):
SELECT “gid”,“name”,st_astext(ST_Simplify(ST_Force_2D(“geom”), 0.10616339071444258)) as “geom” FROM “spatial”.“port_area” WHERE “geom” && ST_GeomFromText(‘POLYGON ((-46.75781250000001 -1.7575368113083254, -46.75781250000001 42.29356419217008, 1.7578124999999918 42.29356419217008, 1.7578124999999918 -1.7575368113083254, -46.75781250000001 -1.7575368113083254))’, 4326)
If I remove ST_Simplify I can confirmed that the geometries are correct and not empty. So my next question would be: is there a way to force Geoserver not to apply ST_Simplify for this layer? Do you have other suggestions?
Cheers,
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
Hi Hugo,
I know that ArcSDE exhibits exactly that behaviour when it encounters bad data. I see you’ve confirmed the data is valid in PostGIS - have you tried viewing it in a separate GIS like QGIS?
It may also be worth turning up the GeoServer logging to Geotools Developer level and seeing what they say. I think it should show the exact query being sent to PostGIS so you’ll be able to confirm what PostGIS is sending GeoServer by running the query yourself using PgAdmin or similar.
I’m facing some weird behavior with one polygon layer. The layer is stored in postgis using EPSG:4326. The geometries are simply buffers for some points from other table. I have a very simple SLD style with one rule only specifying for the PolygonSymbolizer the fill and the stroke.
The issue is that not all polygons get displayed in different scales (see images attached). Even worse is that at smaller scales no polygons get rendered at all. From postgis i could see that all geometries are valid.
I have also tried to use a PointSymbolizer in the geometry centroid for smaller scales but the results are the same.
Looking at the logs I don’t see anything wrong concerning this situation.
Does anyone have any hints on what might be happening?
My table has multipolygon geometry type. Reading Postgis docs one can see that if the returned geometries are too small given the specified tolerance they are not kept. Also in docs there is a third optional boolean flag (preserveCollapsed) that can be used to preserve geometries in such cases. I’ve tried the query Geoserver is issuing with that option and… well, geometries are returned
So, quick question is there any possiblity to have Geoserver adding this flag to the internal query it is doing?
Look for the checkbox “Support on the fly geometry simplification” towards the bottom of the postgis store page and uncheck it. This will fix your issue.
For future reference can you say why your polygons become empty when simplified?
Thanks for the answer. I’ve defined Geotools Developer option for the Geoserver logging and got the query. I see the problem immediately…
Geoserver is using ST_Simplify in the polygon geometries. This is very cool and indeed the most sensible way to generate WMS images faster. However, in my case the ST_simplify is returning “MULTIPOLYGON EMPTY”.
The query being issued is (I have changed it so that I could see the geometries being returned as text):
SELECT “gid”,“name”,st_astext(ST_Simplify(ST_Force_2D(“geom”), 0.10616339071444258)) as “geom” FROM “spatial”.“port_area” WHERE “geom” && ST_GeomFromText(‘POLYGON ((-46.75781250000001 -1.7575368113083254, -46.75781250000001 42.29356419217008, 1.7578124999999918 42.29356419217008, 1.7578124999999918 -1.7575368113083254, -46.75781250000001 -1.7575368113083254))’, 4326)
If I remove ST_Simplify I can confirmed that the geometries are correct and not empty. So my next question would be: is there a way to force Geoserver not to apply ST_Simplify for this layer? Do you have other suggestions?
Cheers,
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
Hi Hugo,
I know that ArcSDE exhibits exactly that behaviour when it encounters bad data. I see you’ve confirmed the data is valid in PostGIS - have you tried viewing it in a separate GIS like QGIS?
It may also be worth turning up the GeoServer logging to Geotools Developer level and seeing what they say. I think it should show the exact query being sent to PostGIS so you’ll be able to confirm what PostGIS is sending GeoServer by running the query yourself using PgAdmin or similar.
I’m facing some weird behavior with one polygon layer. The layer is stored in postgis using EPSG:4326. The geometries are simply buffers for some points from other table. I have a very simple SLD style with one rule only specifying for the PolygonSymbolizer the fill and the stroke.
The issue is that not all polygons get displayed in different scales (see images attached). Even worse is that at smaller scales no polygons get rendered at all. From postgis i could see that all geometries are valid.
I have also tried to use a PointSymbolizer in the geometry centroid for smaller scales but the results are the same.
Looking at the logs I don’t see anything wrong concerning this situation.
Does anyone have any hints on what might be happening?
So, quick question is there any possiblity to have Geoserver adding this flag to the internal query it is doing?
Not right now, but it would be something nice to add, maybe as an extra option… In more recent versions of postgis there are also other functions to play with… Generally speaking there is now room for improvement in how we read and transfer data from postgis recent versions that are really just waiting for funding in order to be implemented
Look for the checkbox “Support on the fly geometry simplification” towards the bottom of the postgis store page and uncheck it. This will fix your issue.
For future reference can you say why your polygons become empty when simplified?
Thanks for the answer. I’ve defined Geotools Developer option for the Geoserver logging and got the query. I see the problem immediately…
Geoserver is using ST_Simplify in the polygon geometries. This is very cool and indeed the most sensible way to generate WMS images faster. However, in my case the ST_simplify is returning “MULTIPOLYGON EMPTY”.
The query being issued is (I have changed it so that I could see the geometries being returned as text):
SELECT “gid”,“name”,st_astext(ST_Simplify(ST_Force_2D(“geom”), 0.10616339071444258)) as “geom” FROM “spatial”.“port_area” WHERE “geom” && ST_GeomFromText(‘POLYGON ((-46.75781250000001 -1.7575368113083254, -46.75781250000001 42.29356419217008, 1.7578124999999918 42.29356419217008, 1.7578124999999918 -1.7575368113083254, -46.75781250000001 -1.7575368113083254))’, 4326)
If I remove ST_Simplify I can confirmed that the geometries are correct and not empty. So my next question would be: is there a way to force Geoserver not to apply ST_Simplify for this layer? Do you have other suggestions?
Hi Hugo,
I know that ArcSDE exhibits exactly that behaviour when it encounters bad data. I see you’ve confirmed the data is valid in PostGIS - have you tried viewing it in a separate GIS like QGIS?
It may also be worth turning up the GeoServer logging to Geotools Developer level and seeing what they say. I think it should show the exact query being sent to PostGIS so you’ll be able to confirm what PostGIS is sending GeoServer by running the query yourself using PgAdmin or similar.
I’m facing some weird behavior with one polygon layer. The layer is stored in postgis using EPSG:4326. The geometries are simply buffers for some points from other table. I have a very simple SLD style with one rule only specifying for the PolygonSymbolizer the fill and the stroke.
The issue is that not all polygons get displayed in different scales (see images attached). Even worse is that at smaller scales no polygons get rendered at all. From postgis i could see that all geometries are valid.
I have also tried to use a PointSymbolizer in the geometry centroid for smaller scales but the results are the same.
Looking at the logs I don’t see anything wrong concerning this situation.
Does anyone have any hints on what might be happening?
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140