[postgis-devel] topology : cosmetic changes to troubleshoot geometry failing to convert to topogeometry

Sandro Santilli strk at keybit.net
Sun Aug 11 04:55:00 PDT 2013


Hey Remi, I do feel your pain. This very problem is common with GEOS
exceptions too. Sometime one would want a NULL rather than an exception.

This is so common that I was thinking we could use a session variable
to determine the behavior. See http://trac.osgeo.org/postgis/ticket/1393 
and feel free to add suggestions to http://trac.osgeo.org/postgis/wiki/DevGUC

Adding extra args to functions is always something I try to think a lot
about. Few args are easier to remember. There's already another request
for extra toTopoGeom arg here: http://trac.osgeo.org/postgis/ticket/2144
I wonder if we should start using flags, like the ST_AsGML family of funtions.

--strk;

On Thu, Aug 01, 2013 at 02:43:51PM +0200, Rémi Cura wrote:
> Hello Dear list,
> 
> I'm currently having trouble importing polygon data from geom to topogeom.
> 
> As I understand it, it is currently difficult to find which geometry is
> going to fail the conversion.
> Maybe there is a better way, but for me I have to try to import the whole
> table, then it fails, then I cut the table in 2, then it fails, then ...
> I can't try individually to convert geom as failing will depend on what
> other geom were converted before.
> 
> 
> Hence I'm suggesting a very cosmetic change to the
> topology.totopogeom(geometry, character varying, integer, double precision)
> function.
> 
> I tried a topology.totopogeom(ageom geometry, atopology character varying,
> alayer integer, atolerance double precision DEFAULT 0, witherror boolean
> DEFAULT true) function,
> which is just the original totopogeom, but add a catch for exception when
> creating topogeom, and return null if exception is catched.
> 
> This way the workflow is easier :
> I import my whole table, then look for NULL topogeom, and I can deal with
> the problematic geometries, maybe by changing precision and so.
> 
> Please let me know if you think this is worth it or if this is too minor
> tweak.
> 
> Cheers,
> 
> Rémi-C



More information about the postgis-devel mailing list