[postgis-tickets] [PostGIS] #4182: Unexpected TopologyException during ST_Union aggregate function with valid polygons
PostGIS
trac at osgeo.org
Fri Aug 23 06:33:27 PDT 2019
#4182: Unexpected TopologyException during ST_Union aggregate function with valid
polygons
-----------------------+--------------------------
Reporter: blaggner | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone: PostGIS GEOS
Component: postgis | Version: 2.3.x
Resolution: | Keywords:
-----------------------+--------------------------
Comment (by fengel):
I attached my safe_union. It's probably pretty far from optimal, because I
am more a user than a developer. I was glad that my first custom aggregate
function worked at all. Maybe you can give me some hints to make it
better.
I am not sure about the best methods to attemt to fix exceptions. In
LostGIS the main approaches seem to be translating, buffering by a small
value (but not buffering back with a negative value?) and force_rhr. In my
function I tried snapping to different precisions. I have the impression
that at least the snapping doesn't succeed to fix things very often.
The main benefit for me is that exceptions are skipped. I plan to write
the point coordinates and geometries of the unfixed exceptions to a
(temporary) table so that I can check visually in my GIS-software where
exeptions occured and if the output has significant gaps compared to the
original polygons. A result with minor gaps would be a "reasonable
result". But of course it is a subjective decision whether a result is
still acceptable or not. As you said, it also depends on the intended use.
So far using LostGIS and my functions the results are ok on that account.
I often check total area before and after and decide if I can live with
the result. I usually use the result for aggregating area sums by factors.
So if the result is slighly wrong because there is 1% of the original area
missing I can usually live with that.\\
Also I want to point out that I am probably not using the latest versions
of PostGIS and GEOS. I should probably upgrade but my operating sytem and
Postgres needs upgrade, too, and my time is limited at the moment.\\
{{{
#!sql
select postgis_full_version()
}}}
POSTGIS="2.4.2 !r16113" PGSQL="95" GEOS="3.5.1-CAPI-1.9.1 !r4246"
PROJ="Rel. 4.9.2, 08 September 2015" GDAL="GDAL 2.2.2, released
2017/09/15" LIBXML="2.9.3" LIBJSON="0.11.99" LIBPROTOBUF="1.2.1" RASTER
{{{
#!sql
select version()
}}}
PostgreSQL 9.5.19 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu
5.4.0-6ubuntu1~16.04.10) 5.4.0 !20160609, 64-bit
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4182#comment:13>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list