[postgis-users] toTopoGeom performance tips

Luca Morandini lmorandini at ieee.org
Sun May 13 19:52:24 PDT 2012


On 05/14/2012 12:20 PM, Brent Wood wrote:
> Hi Luca,
>
> I have found it MUCH faster to throw a collection of linestrings at a topology
> (which has no snapping distance) than to add linestrings sequentially with a
> snapping distance applied to ensure polygon closure.
>
> If your data is originally polygons anyway, they are already properly closed. Have
> you tried doing the loading as a geometry collection instead of iteratively? Or is
> it loading the collection that is too slow?

I am not sure I understood you: I just threw the multipolygons at the topology in 
one go, without looping:

CREATE TABLE testpolytopo(gid serial primary key, ogc_fid INTEGER);
SELECT topology.AddTopoGeometryColumn('testpolytopo', 'public', 'testpolytopo', 
'topo', 'MULTIPOLYGON') As new_layer_id;
INSERT INTO testpolytopo(ogc_fid, topo)
     SELECT ogc_fid,  topology.toTopoGeom(wkb_geometry, 'testpolytopo', 1)
     FROM lga06aaust;

(wkb_geometry column of lga066aaust contains MultiPpygons).

Regards,

Luca Morandini
Data Architect - AURIN project
Department of Computing and Information Systems
University of Melbourne

-- 
Regards,

Luca Morandini
Data Architect - AURIN project
Department of Computing and Information Systems
University of Melbourne




More information about the postgis-users mailing list