[postgis-users] Build topology for polygon layer using postgis2.0

Elton Chan elton.chan at yahoo.com
Thu Nov 3 07:09:59 PDT 2011


There are many messages generated after the ST_CreateTopoGeo. The following is part of the messages and in fact, the same message is repeating. 

*********Message starts**********
-- Executing query:
SELECT topology.ST_CreateTopoGeo('hki', ST_Collect(geom)) from hkisland;
NOTICE:  ST_AddEdgeModFace: edge 1 splitted face 0
CONTEXT:  SQL statement "SELECT topology.ST_AddEdgeModFace(atopology, snode_id, enode_id, rec.geom)"
PL/pgSQL function "st_createtopogeo" line 152 at PERFORM
NOTICE:  ST_AddEdgeModFace: edge 2 splitted face 0
CONTEXT:  SQL statement "SELECT topology.ST_AddEdgeModFace(atopology, snode_id, enode_id, rec.geom)"
PL/pgSQL function "st_createtopogeo" line 152 at PERFORM
WARNING:  Not updating next_{left,right}_face fields of face boundary edges
~~~~~~~~~~~~~CUT~~~~~~~~~
~~~~~~~~~~CUT~~~~~~~~~
PL/pgSQL function "st_addedgemodface" line 607 at EXECUTE statement
SQL statement "SELECT topology.ST_AddEdgeModFace(atopology, snode_id, enode_id, rec.geom)"
PL/pgSQL function "st_createtopogeo" line 152 at PERFORM
NOTICE:  ST_AddEdgeModFace: edge 329 splitted face 0
CONTEXT:  SQL statement "SELECT topology.ST_AddEdgeModFace(atopology, snode_id, enode_id, rec.geom)"
PL/pgSQL function "st_createtopogeo" line 152 at PERFORM
WARNING:  Not updating next_{left,right}_face fields of face boundary edges
CONTEXT:  SQL statement "SELECT topology.AddFace('hki', '010300002016090000010000000500000037894160785D294100000000DFE72841C976BE9F155D2941C976BE9FCCE72841378941A0D95C294100000080C1E72841378941A0155D2941378941A0CCE7284137894160785D294100000000DFE72841', true)"
PL/pgSQL function "st_addedgemodface" line 607 at EXECUTE statement
SQL statement "SELECT topology.ST_AddEdgeModFace(atopology, snode_id, enode_id, rec.geom)"
PL/pgSQL function "st_createtopogeo" line 152 at PERFORM


ERROR:  SQL/MM Spatial exception - non-existent node
CONTEXT:  SQL statement "SELECT topology.ST_AddEdgeModFace(atopology, snode_id, enode_id, rec.geom)"
PL/pgSQL function "st_createtopogeo" line 152 at PERFORM

********** Error **********

ERROR: SQL/MM Spatial exception - non-existent node
SQL state: P0001
Context: SQL statement "SELECT topology.ST_AddEdgeModFace(atopology, snode_id, enode_id, rec.geom)"
PL/pgSQL function "st_createtopogeo" line 152 at PERFORM

********End of Message***************
Any idea? What happens?


Besides, I support your idea about toTopoGeometry, it is a better way to maintain topology.

elton.

--- On Thu, 11/3/11, Sandro Santilli <strk at keybit.net> wrote:

> From: Sandro Santilli <strk at keybit.net>
> Subject: Re: [postgis-users] Build topology for polygon layer using postgis2.0
> To: "Elton Chan" <elton.chan at yahoo.com>
> Cc: "PostGIS Users Discussion" <postgis-users at postgis.refractions.net>
> Date: Thursday, November 3, 2011, 3:55 PM
> On Wed, Nov 02, 2011 at 10:26:08PM
> -0700, Elton Chan wrote:
> > Hi Sandro,
> > 
> > I tried to run the two commands that you suggested.
> However, it returns some empty layers only. (e.g. test.edge,
> test.face...). I check that there are some warning message
> in the output pane.
> 
> Report the WARNING lines ?
> 
> > I wonder if it is due to some geometry problem in the
> data set so that it cannot generate the topology. 
> 
> Any kind of input should generate something, except the
> empty input.
> The only other reason I could think of would be an
> exception during
> processing.
> 
> > Besides, I am thinking to use ST_SNAP to clear some
> gaps between polygons. I have done some small test, it
> works. However, to apply the same for a layer containing
> hundreds polygons, it requires to loop through all the
> possible adjacent polygons respecting to each polygon. It
> will take a very very long processing time. Any other idea?
> Any method to filtering those gaps first?
> 
> I suggest you filter the gaps _after_ you create the
> topology.
> 
> > Meanwhile, it seems ST_CreateTopoGeo is doing similar
> things as you describe in the proposed toTopoGeometry.
> Correct me if I am wrong. It seems the toTopoGeometry
> performance should be better than the ST command, right?
> 
> While ST_CreateTopoGeo wants the _full_ input in memory,
> and wants to start
> with an _empty_ topology, the toTopoGeometry function would
> accept chunked
> input and _incrementally_ populate a topology.
> 
> Moreover, the toTopoGeometry would _construct_ a
> TopoGeometry object
> representing the same space that was represented by the
> input geometry
> (only topologically). This would give you a value type
> which you can
> store in a table and thus associate with attributes. Such
> object would
> retain its shape while more components are added to the
> topology 
> trough more calls to toTopoGeometry.
> 
> --strk;
> 
>   ()   Free GIS & Flash
> consultant/developer
>   /\   http://strk.keybit.net/services.html
> 



More information about the postgis-users mailing list