<html>
  <head>
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-15">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi,<br>
    <br>
    I'm building a topology from a big set of features, around 100k with
    37 million vertexes. Since loading the whole set at once with
    toTopoGeom wasn't feasible, <br>
    I partitioned my data country by country first, then I tried to load
    polygon by polygon. No matter the method, after around 25k polygons
    I get this error:<br>
    <br>
    DBD::Pg::db do failed: ERROR:  GEOSContains: TopologyException: side
    location conflict at 0.097239999999999993 48.088819999999998<br>
    CONTEXT:  SQL statement "UPDATE eu_geom_base_topo.edge_data SET
    left_face = CASE WHEN left_face = 25444 THEN 25612 ELSE left_face
    END, right_face = CASE WHEN right_face = 25444 THEN 25612 ELSE
    right_face END WHERE ( left_face = 25444 OR right_face = 25444) AND
    NOT edge_id = ANY
    ('{87330,87328,87153,87155,87036,87152,87327,87328,87174,87245,87246,87279,87283,87278,87282,87167,87168,87170,87018,87020,87052,87054,87055,87247,87248,87250,87301,87303,87293,87226,87292,87329}')

    AND NOT
    ST_Contains('0103000020E610000001000000C30B0000B858518369189E3F336DFFC.........'::geometry,

    geom)"<br>
    PL/pgSQL function "_st_addfacesplit" line 114 at instruction EXECUTE<br>
    SQL statement "SELECT topology._ST_AddFaceSplit(atopology,
    newedge.edge_id, newedge.left_face, false)"<br>
    PL/pgSQL function "st_addedgemodface" line 506 at instruction SQL<br>
    PL/pgSQL function "topogeo_addlinestring" line 124 at assignment<br>
    SQL statement "SELECT array_cat(edges, array_agg(x)) FROM ( select
    topology.TopoGeo_addLinestring(atopology, rec.geom, tol) as x ) as
    foo"<br>
    PL/pgSQL function "topogeo_addpolygon" line 24 at assignment<br>
    PL/pgSQL function "totopogeom" line 100 at loop FOR su righe di
    SELECT at ./processWorkDb.pl line 797.<br>
    <br>
    Had to truncate the geometry in ST_contains because of the message
    size limit, the hexdump of the geometry is around 200k.<br>
    <br>
    The instruction that fails is something like:<br>
    <br>
    UPDATE eu_geom_base <br>
    SET topogeom = toTopoGeom(geom, 'eu_geom_base_topo', 1) <br>
    WHERE eu_geom_base.named_place_id= 20077019<br>
    <br>
    It doesn't fail with just a specific geometry, this example is the
    last one I found.<br>
    <br>
    If I try to issue it in pgadmin it keeps failing, so it's not
    something related to the loader script. <br>
    I tried to look for the error, it seems it's failing at this line<br>
    <br>
    result = GEOSContains( g1, g2);<br>
    <br>
    of <a class="el"
href="http://postgis.net/docs/doxygen/2.1/d4/d06/postgis_2lwgeom__geos_8c_source.html">postgis/lwgeom_geos.c</a>.
    I'd guess it's geos throwing a topologyexception because of the
    geometry.<br>
    <br>
    My postgis full version is: "POSTGIS="2.0.1 r9979"
    GEOS="3.3.6-CAPI-1.7.6" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL
    1.9.2, released 2012/10/08" LIBXML="2.7.8" TOPOLOGY RASTER"<br>
    <br>
    Would upgrade to postgis 2.0.2 help for this issue?<br>
    <br>
    I'm loading geometries with a "default" 1 tolerance, would play with
    this parameter help to solve the issue? Would it dissolve
    geometries?<br>
    <br>
    Thanks for any feedback.<br>
    <br>
    Regards,<br>
    <br>
    Paolo<br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Paolo Crosato
</pre>
  </body>
</html>