[Geoserver-users] Transform fails on Multipolygon but not on polygon

Hi, I just found a weird behavior in GeoServer.

Having a table with just this geometry[1] in EPSG:32717 makes this
exception[2] while rendering on EPSG:900913. The exception message in
English is something like "latitude 90°00.0'S is too near to the
Pole".

However, just removing the MULTIPOLYGON and having a simple POLYGON
with exactly the same coordinates makes the rendering work.

GeoServer version is 2.5.4. Is this a known issue? If it is useful I
could try to reproduce with geotools and report in its users list.

Best.

[1] MULTIPOLYGON(((697803.658648209 9621031.75598731,697322.091746693
9621032.64972812,697322.979469726 9621511.86060929,697804.548540555
9621510.96799324,697803.658648209 9621031.75598731)))

[2]
09 oct 14:43:34 ERROR [geotools.rendering] - La Latitud 90°00.0'S esta
muy próxima al Polo.
org.geotools.referencing.operation.projection.ProjectionException: La
Latitud 90°00.0'S esta muy próxima al Polo.
        at org.geotools.referencing.operation.projection.Mercator$Spherical.transformNormalized(Mercator.java:209)
        at org.geotools.referencing.operation.projection.MapProjection.transform(MapProjection.java:883)
        at org.geotools.referencing.operation.projection.MapProjection.transform(MapProjection.java:924)
        at org.geotools.referencing.operation.transform.ConcatenatedTransformDirect.transform(ConcatenatedTransformDirect.java:81)
        at org.geotools.referencing.operation.transform.ConcatenatedTransformDirect.transform(ConcatenatedTransformDirect.java:80)
        at org.geotools.renderer.ScreenMap.checkAndSet(ScreenMap.java:105)
        at org.geotools.renderer.lite.StreamingRenderer$RenderableFeature.getShape(StreamingRenderer.java:3244)

Hi,

That multipolygon in EPSG:4326 is

MULTIPOLYGON ((( -79.21951189395617 -3.4269410394638835, -79.2238452277241 -3.426941039463947, -79.2238452277241 -3.422607705695983, -79.21951189395617 -3.422607705695945, -79.21951189395617 -3.4269410394638835 )))

Thus the error message that talks about latitude 90°00.0'S is not correct.

-Jukka Rahkonen-
________________________________________
Fernando Gonzalez wrote:

Hi, I just found a weird behavior in GeoServer.

Having a table with just this geometry[1] in EPSG:32717 makes this
exception[2] while rendering on EPSG:900913. The exception message in
English is something like "latitude 90°00.0'S is too near to the
Pole".

However, just removing the MULTIPOLYGON and having a simple POLYGON
with exactly the same coordinates makes the rendering work.

GeoServer version is 2.5.4. Is this a known issue? If it is useful I
could try to reproduce with geotools and report in its users list.

Best.

[1] MULTIPOLYGON(((697803.658648209 9621031.75598731,697322.091746693
9621032.64972812,697322.979469726 9621511.86060929,697804.548540555
9621510.96799324,697803.658648209 9621031.75598731)))

[2]
09 oct 14:43:34 ERROR [geotools.rendering] - La Latitud 90°00.0'S esta
muy próxima al Polo.
org.geotools.referencing.operation.projection.ProjectionException: La
Latitud 90°00.0'S esta muy próxima al Polo.
        at org.geotools.referencing.operation.projection.Mercator$Spherical.transformNormalized(Mercator.java:209)
        at org.geotools.referencing.operation.projection.MapProjection.transform(MapProjection.java:883)
        at org.geotools.referencing.operation.projection.MapProjection.transform(MapProjection.java:924)
        at org.geotools.referencing.operation.transform.ConcatenatedTransformDirect.transform(ConcatenatedTransformDirect.java:81)
        at org.geotools.referencing.operation.transform.ConcatenatedTransformDirect.transform(ConcatenatedTransformDirect.java:80)
        at org.geotools.renderer.ScreenMap.checkAndSet(ScreenMap.java:105)
        at org.geotools.renderer.lite.StreamingRenderer$RenderableFeature.getShape(StreamingRenderer.java:3244)

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

Thanks for your answer. Indeed, the geometry is in Ecuador and I get
the same results using PostGIS ST_Transform, but I think the latitude
is the second component. Am I wrong? If I transform with postgis and
visualize qith QGIS, the -79 is the X and the -3 is the Y, which makes
sense.

It is driving me crazy. On a layer with such a geometry I get no
exception if I use a bbox around this square[1], but it fails if the
bounding box takes the whole original layer[2]. Always in 900913 to
force the transform.

If the layer is a polygon instead of a multipolygon it works in both
cases. The multipolygon is created so[3] and the polygon so[4].

[1] -8819252.1,-381855.7,-8818634.6,-381204.3
[2] -9314310.518718,-1101232.202228,-8061966.247294,391603.390185
[3] st_multi(st_buffer(geom, 0))::geometry(multipolygon,32717)
[4] st_buffer(geom, 0)::geometry(polygon,32717)

On 9 October 2015 at 19:02, Rahkonen Jukka (MML)
<jukka.rahkonen@anonymised.com> wrote:

Hi,

That multipolygon in EPSG:4326 is

MULTIPOLYGON ((( -79.21951189395617 -3.4269410394638835, -79.2238452277241 -3.426941039463947, -79.2238452277241 -3.422607705695983, -79.21951189395617 -3.422607705695945, -79.21951189395617 -3.4269410394638835 )))

Thus the error message that talks about latitude 90°00.0'S is not correct.

-Jukka Rahkonen-
________________________________________
Fernando Gonzalez wrote:

Hi, I just found a weird behavior in GeoServer.

Having a table with just this geometry[1] in EPSG:32717 makes this
exception[2] while rendering on EPSG:900913. The exception message in
English is something like "latitude 90°00.0'S is too near to the
Pole".

However, just removing the MULTIPOLYGON and having a simple POLYGON
with exactly the same coordinates makes the rendering work.

GeoServer version is 2.5.4. Is this a known issue? If it is useful I
could try to reproduce with geotools and report in its users list.

Best.

[1] MULTIPOLYGON(((697803.658648209 9621031.75598731,697322.091746693
9621032.64972812,697322.979469726 9621511.86060929,697804.548540555
9621510.96799324,697803.658648209 9621031.75598731)))

[2]
09 oct 14:43:34 ERROR [geotools.rendering] - La Latitud 90°00.0'S esta
muy próxima al Polo.
org.geotools.referencing.operation.projection.ProjectionException: La
Latitud 90°00.0'S esta muy próxima al Polo.
        at org.geotools.referencing.operation.projection.Mercator$Spherical.transformNormalized(Mercator.java:209)
        at org.geotools.referencing.operation.projection.MapProjection.transform(MapProjection.java:883)
        at org.geotools.referencing.operation.projection.MapProjection.transform(MapProjection.java:924)
        at org.geotools.referencing.operation.transform.ConcatenatedTransformDirect.transform(ConcatenatedTransformDirect.java:81)
        at org.geotools.referencing.operation.transform.ConcatenatedTransformDirect.transform(ConcatenatedTransformDirect.java:80)
        at org.geotools.renderer.ScreenMap.checkAndSet(ScreenMap.java:105)
        at org.geotools.renderer.lite.StreamingRenderer$RenderableFeature.getShape(StreamingRenderer.java:3244)

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

--
Fernando González
http://geomati.co/

So, the error only appears when the multipolygon is not drawn because
it is too small. In the layer preview, with this[1] bbox, quite big
but centered on the geometry, I get the exception. But when I click
the zoom-in button twice I get the drawing of the multipolygon and the
exception does not appear in the log.

When visualizing the whole extent of the layer there are a lot of
these polygons that are not drawn and exceptions get logged in a super
fat catalina.out. If there are more than 1000 of these errors, the
image will not draw at all.

I think I will put all this in a reproducible way and file a bug report.

Cheers.

[1] -8929252.1,-491855.7,-8708634.6,-271204.3

On 12 October 2015 at 13:47, Fernando Gonzalez
<fernando.gonzalez@anonymised.com> wrote:

Thanks for your answer. Indeed, the geometry is in Ecuador and I get
the same results using PostGIS ST_Transform, but I think the latitude
is the second component. Am I wrong? If I transform with postgis and
visualize qith QGIS, the -79 is the X and the -3 is the Y, which makes
sense.

It is driving me crazy. On a layer with such a geometry I get no
exception if I use a bbox around this square[1], but it fails if the
bounding box takes the whole original layer[2]. Always in 900913 to
force the transform.

If the layer is a polygon instead of a multipolygon it works in both
cases. The multipolygon is created so[3] and the polygon so[4].

[1] -8819252.1,-381855.7,-8818634.6,-381204.3
[2] -9314310.518718,-1101232.202228,-8061966.247294,391603.390185
[3] st_multi(st_buffer(geom, 0))::geometry(multipolygon,32717)
[4] st_buffer(geom, 0)::geometry(polygon,32717)

On 9 October 2015 at 19:02, Rahkonen Jukka (MML)
<jukka.rahkonen@anonymised.com> wrote:

Hi,

That multipolygon in EPSG:4326 is

MULTIPOLYGON ((( -79.21951189395617 -3.4269410394638835, -79.2238452277241 -3.426941039463947, -79.2238452277241 -3.422607705695983, -79.21951189395617 -3.422607705695945, -79.21951189395617 -3.4269410394638835 )))

Thus the error message that talks about latitude 90°00.0'S is not correct.

-Jukka Rahkonen-
________________________________________
Fernando Gonzalez wrote:

Hi, I just found a weird behavior in GeoServer.

Having a table with just this geometry[1] in EPSG:32717 makes this
exception[2] while rendering on EPSG:900913. The exception message in
English is something like "latitude 90°00.0'S is too near to the
Pole".

However, just removing the MULTIPOLYGON and having a simple POLYGON
with exactly the same coordinates makes the rendering work.

GeoServer version is 2.5.4. Is this a known issue? If it is useful I
could try to reproduce with geotools and report in its users list.

Best.

[1] MULTIPOLYGON(((697803.658648209 9621031.75598731,697322.091746693
9621032.64972812,697322.979469726 9621511.86060929,697804.548540555
9621510.96799324,697803.658648209 9621031.75598731)))

[2]
09 oct 14:43:34 ERROR [geotools.rendering] - La Latitud 90°00.0'S esta
muy próxima al Polo.
org.geotools.referencing.operation.projection.ProjectionException: La
Latitud 90°00.0'S esta muy próxima al Polo.
        at org.geotools.referencing.operation.projection.Mercator$Spherical.transformNormalized(Mercator.java:209)
        at org.geotools.referencing.operation.projection.MapProjection.transform(MapProjection.java:883)
        at org.geotools.referencing.operation.projection.MapProjection.transform(MapProjection.java:924)
        at org.geotools.referencing.operation.transform.ConcatenatedTransformDirect.transform(ConcatenatedTransformDirect.java:81)
        at org.geotools.referencing.operation.transform.ConcatenatedTransformDirect.transform(ConcatenatedTransformDirect.java:80)
        at org.geotools.renderer.ScreenMap.checkAndSet(ScreenMap.java:105)
        at org.geotools.renderer.lite.StreamingRenderer$RenderableFeature.getShape(StreamingRenderer.java:3244)

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

--
Fernando González
http://geomati.co/

--
Fernando González
http://geomati.co/