[Geoserver-users] Not all polygons shown in WMS

HI all,

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 in advance.

Cheers,

1.png

2.png

···

Hugo Martins

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.

Cheers,
Jonathan

---- On Wed, 02 Mar 2016 09:18:08 +0000 Hugohfpmartins@anonymised.com wrote ----

HI all,

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 in advance.

Cheers,

Hugo Martins


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_______________________________________________
Geoserver-users mailing list
Geoserver-users@anonymised.com.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi Jonathan,

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,

···

2016-03-02 17:06 GMT+01:00 Jonathan Moules <jonathan-lists@anonymised.com221…>:

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.

Cheers,
Jonathan

---- On Wed, 02 Mar 2016 09:18:08 +0000 Hugo<hfpmartins@anonymised.com> wrote ----

HI all,

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 in advance.

Cheers,

Hugo Martins


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_______________________________________________
Geoserver-users mailing list
Geoserver-users@anonymised.comnet
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hugo Martins

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?

Ian

···

On 2 March 2016 at 16:26, Hugo <hfpmartins@anonymised.com> wrote:

Hi Jonathan,

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


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

2016-03-02 17:06 GMT+01:00 Jonathan Moules <jonathan-lists@anonymised.com>:

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.

Cheers,
Jonathan

---- On Wed, 02 Mar 2016 09:18:08 +0000 Hugo<hfpmartins@anonymised.com> wrote ----

HI all,

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 in advance.

Cheers,

Hugo Martins


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_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hugo Martins

Ian Turton

Thanks Ian,

I totally missed that option :slight_smile:

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 :slight_smile:

So, quick question is there any possiblity to have Geoserver adding this flag to the internal query it is doing?

Cheers,

···

2016-03-02 17:49 GMT+01:00 Ian Turton <ijturton@anonymised.com…84…>:

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?

Ian

On 2 March 2016 at 16:26, Hugo <hfpmartins@anonymised.com> wrote:

Hi Jonathan,

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


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Ian Turton

2016-03-02 17:06 GMT+01:00 Jonathan Moules <jonathan-lists@anonymised.com>:

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.

Cheers,
Jonathan

---- On Wed, 02 Mar 2016 09:18:08 +0000 Hugo<hfpmartins@anonymised.com> wrote ----

HI all,

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 in advance.

Cheers,

Hugo Martins


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_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hugo Martins

Hugo Martins

Il 02/mar/2016 12:04, “Hugo”

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

Cheers
Andrea

Cheers,

2016-03-02 17:49 GMT+01:00 Ian Turton <ijturton@anonymised.com>:

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?

Ian

On 2 March 2016 at 16:26, Hugo <hfpmartins@anonymised.com> wrote:

Hi Jonathan,

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,

2016-03-02 17:06 GMT+01:00 Jonathan Moules <jonathan-lists@anonymised.com>:

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.

Cheers,
Jonathan

---- On Wed, 02 Mar 2016 09:18:08 +0000 Hugo<hfpmartins@anonymised.com> wrote ----

HI all,

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 in advance.
Cheers,


Hugo Martins

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_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Hugo Martins


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


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Ian Turton


Hugo Martins


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


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users