<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hi Sandro,</p>
<p>I let this function run during the night and after 7.5h I got an error message:</p>
<p>------------------------------------</p>
<p>ERROR: Corrupted topology: adjacent edges 159972 and -159958 bind different face (0 and 78697)<br />CONTEXT: SQL statement "SELECT topology.ST_AddEdgeModFace(atopology, snode_id, enode_id, rec.geom)"<br />PL/pgSQL function st_createtopogeo(character varying,geometry) line 153 at PERFORM<br />********** Error **********</p>
<p>ERROR: Corrupted topology: adjacent edges 159972 and -159958 bind different face (0 and 78697)<br />SQL state: XX000<br />Context: SQL statement "SELECT topology.ST_AddEdgeModFace(atopology, snode_id, enode_id, rec.geom)"<br />PL/pgSQL function st_createtopogeo(character varying,geometry) line 153 at PERFORM</p>
<p>-------------------------------------</p>
<p>I have to say that I did not tune Postgis memory-wise - maybe I should do that next. But the above error message probably doesn't indicate a memory problem, but a problem with the data.</p>
<p>My data: 2582 polygons with a total of 167176 vertices.</p>
<p>I am now also following alternative approaches. I found a software that provides me with the edges - and now I have to find out which landcover polygon is left and which is right of the edge. I got a working query, but still quite slow. I will write a separate mail about this query.</p>
<p>Andreas</p>
<p>On 2016-07-11 19:32, Sandro Santilli wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">On Mon, Jul 11, 2016 at 04:52:40PM +0200, Neumann, Andreas wrote:<br /><br />
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">The ST_CreateTopoGeo() function runs for a very long time. >45 minutes<br /> on this relatively small dataset. Did I use the wrong combination of<br /> functions at the top, or is it a problem that after ST_CurveToLine() my<br /> data contains a lot of vertices? <br /><br /> My total dataset has 75'000 polygons, so I fear that, unless I did a<br /> erroneous combination of the functions, that the ST_CreateTopoGeo() may<br /> be too slow for my purpose? How big where the datasets that you used so<br /> far with Postgis topology? I hope it is a mistake on my side.</blockquote>
<br /> Topology loading is known to be slow, and there's been work toward drafting<br /> ideas to speed it up. What could help is very data-specific, but some things<br /> are common to all datasets, like keeping the number of vertices below a given<br /> threshold (ST_Subdivide can help). None of those heuristics are currently<br /> implemented in ST_CreateTopoGeo, but you could find strategies yourself<br /> using the TopoGeo_addLinestring function, passing it each split portion of<br /> each polygon boundary in desceding geometry order (which helps with getting<br /> polygon holes be included before polgon shells).<br /><br /> There are some load times on the rttopo wiki (but it's in italian):<br /><a href="https://git.osgeo.org/gogs/rttopo/librttopo/wiki/ItProfilazioneUcsRt">https://git.osgeo.org/gogs/rttopo/librttopo/wiki/ItProfilazioneUcsRt</a><br /><br /> According to those numbers:<br /><br />   - a Xeon E31245 (3,30Ghz) with 24GB Ram<br />     could load 840'143 polygons with a total of 47'254'882 vertices<br />     in about 3 days (250'518 seconds) using PostGIS master.<br /><br />   - an i7-4750HQ (2.00Ghz) with 16GB Ram<br />     could load 16,757 polygons with a total of 794,020 vertices in<br />     about 1 hour and 13 minutes.<br /><br /> Depending on the distribution of your polygons (how many bounding box<br /> overlaps) your number may be better or worst.<br /><br /> I recommend doing the loading in separate transaction chunks, so that<br /> you can look at the topology as its being built and more importantly you don't<br /> end up loosing all the work shall an exception arise.<br /><br /> --strk;</div>
</blockquote>
<p> </p>
<div> </div>
</body></html>