[postgis-users] Error when adding a polygon to a topology

Sandro Santilli strk at keybit.net
Mon Jan 14 02:52:31 PST 2013


On Mon, Jan 14, 2013 at 11:03:53AM +0100, Paolo Crosato wrote:

> I partitioned my data country by country first, then I tried to load
> polygon by polygon. No matter the method, after around 25k polygons
> I get this error:
> DBD::Pg::db do failed: ERROR:  GEOSContains: TopologyException: side
> location conflict at 0.097239999999999993 48.088819999999998

[...]

> My postgis full version is: "POSTGIS="2.0.1 r9979"
> GEOS="3.3.6-CAPI-1.7.6" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL
> 1.9.2, released 2012/10/08" LIBXML="2.7.8" TOPOLOGY RASTER"
> 
> Would upgrade to postgis 2.0.2 help for this issue?

Yes, it might help you some, but can't guarantee you won't hit
the robustness issue again.

> I'm loading geometries with a "default" 1 tolerance, would play with
> this parameter help to solve the issue? Would it dissolve
> geometries?

I would recommend passing your geometries under ST_SnapToGrid with a
tolerance of 1 before sending them to toTopoGeometry.

Note that the idea of partitioning is that you can then only
work on the single partition that failed the import.
The rest of the topology is all there secured.

This means that you can further partition what you have left,
incrementally building what's left. Sometimes just inverting the
order by which you add geometries works around such bugs.

--strk;


More information about the postgis-users mailing list