[postgis-users] topology example

Sandro Santilli strk at keybit.net
Fri Feb 24 03:35:15 PST 2012


On Fri, Feb 24, 2012 at 12:03:10PM +0100, Denis Rouzaud wrote:
> Okay,
> 
> So I am looping over my 25000 pipes and soon as there is a topology
> error, the
> UPDATE distribution.pipes SET topogeom = toTopoGeom(wkb_geometry,
> ''distrib_topo'', layer) WHERE id = pi.id;
> throws an error:
> ERROR:  SQL/MM Spatial exception - point not on edge

Excellent. So a _single_ geometry is enough to reproduce the error.
Save both the new geometry (WHERE id = pi.id) and the topology
status (dump the schema).

If you can, attach the dump and the new input into a ticket.

May be worth checking the topology built so far for correctness
with ValidateTopology. Any invalidity would be a bug in PostGIS.
But not all invalidities are cought by ValidateTopology so there
may be a need to do more eyebased checking (linking isn't checked).

Usually the invalidity, if any, is within the bounding box 
of the geometry that fails being installed.

> I would like to list all the errors by raising the ids, what is the
> exception to catch?

A loop _outside_ the database wouldn't need to catch.
If you're looping inside, with pl/pgsql, catch OTHERS.

--strk;

  ,------o-. 
  |   __/  |    Delivering high quality PostGIS 2.0 !
  |  / 2.0 |    http://strk.keybit.net - http://vizzuality.com
  `-o------'




More information about the postgis-users mailing list