[postgis-users] toTopoGeom performance tips

pcreso at pcreso.com pcreso at pcreso.com
Sun May 13 21:28:58 PDT 2012


OK, 

In my case the linestrings I was constructing polygons from did not have aligned
start/end points (nodes), so I loaded them sequentially & snapped nodes to pre-existing ones, to generate faces in the topology.

I did not use a topogeometry column at all, but extracted the topology faces into a standard Postgis geometry (polygon) column.

So possibly of no use to you, I'm afraid

Cheers,

  Brent


--- On Mon, 5/14/12, Luca Morandini <lmorandini at ieee.org> wrote:

From: Luca Morandini <lmorandini at ieee.org>
Subject: Re: [postgis-users] toTopoGeom performance tips
To: postgis-users at postgis.refractions.net
Date: Monday, May 14, 2012, 2:52 PM

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

_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120513/1d4d1bef/attachment.html>


More information about the postgis-users mailing list