<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Nicolas,<br>
    <br>
    I edit my multi polygons in QGIS, and you're right the geometry
    becomes invalid if some parts have adjacent segments.<br>
    <br>
    In a simple case, I would have a multi polygons with 3 parts with 2
    parts adjacent.<br>
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
    <a href="http://imgur.com/zvxPFeR">http://imgur.com/zvxPFeR</a><br>
    <br>
    Although the geometry is invalid, my intention is to make it valid,
    and therefore merge the two parts, which is impossible in QGIS -
    AFAIK.<br>
    <br>
    So my intention was to save the geometry as this, and make it valid
    by a command.<br>
    <br>
    I could achieve this with a function:<br>
    CREATE OR REPLACE FUNCTION distribution.simplemultipoly(geom
    geometry) RETURNS geometry AS<br>
    $BODY$<br>
        DECLARE<br>
            num_geom integer;<br>
        BEGIN<br>
            SELECT ST_NumGeometries(geom) into num_geom;<br>
            SELECT
    ST_Multi(ST_CollectionHomogenize(ST_Union(ST_GeometryN(geom,n)))) <br>
                FROM generate_series(1,num_geom) n<br>
                INTO geom;<br>
            RETURN geom;<br>
        END;<br>
    $BODY$<br>
    LANGUAGE plpgsql;<br>
    <br>
    But I wondered if there was a more direct way.<br>
    <br>
    Cheers,<br>
    <br>
    Denis<br>
    <br>
    <div class="moz-cite-prefix">On 21. 11. 13 12:42, Nicolas Ribot
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAGAwT=2ULr-CgCiGV-7zgirtiLXjHdT8PYffq0JX27UYzrbAtw@mail.gmail.com"
      type="cite">
      <pre wrap="">Hi Denis,

In your example, I don't understand how the parts of your
multipolygons can be adjacent. Are they valid ?
Do you have a visual example ?

Thank you

Nicolas


On 21 November 2013 07:32, Denis Rouzaud <a class="moz-txt-link-rfc2396E" href="mailto:denis.rouzaud@gmail.com"><denis.rouzaud@gmail.com></a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Hello Rémi,

I was hoping a simplest request without enabling topology but thanks anyway!

Cheers,

Denis


On 20. 11. 13 18:26, Rémi Cura wrote:


>From what I understand of your needs, Postigs topology was designed for
this.
Cheers,

Rémi-C


2013/11/20 Denis Rouzaud <a class="moz-txt-link-rfc2396E" href="mailto:denis.rouzaud@gmail.com"><denis.rouzaud@gmail.com></a>
</pre>
        <blockquote type="cite">
          <pre wrap="">
Hi all,

I am drawing some multipolygons in QGIS and sometimes, I have parts of
them which are adjacent and I'd like to homogenize them to have less parts
and no adjacent parts.

I could do this with a quite complex method:

1. get the number of parts Z:
SELECT ST_NumGeometries(geometry) FROMmytable WHERE id=123;

2. do the simplification using ST_CollectionHomogenize:
SELECT
ST_Multi(ST_CollectionHomogenize(ST_Union(ST_GeometryN(geometry,n)))) FROM
mytable CROSS JOIN generate_series(1,Z) n WHERE id = 123;

3. update manually the result in the table (copy paste).


Does someone has something more straightforward???

Thanks a lot!

Best regards,

Denis
_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a>
</pre>
        </blockquote>
        <pre wrap="">



_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a>



_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a>
</pre>
      </blockquote>
      <pre wrap="">_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>