Thank you all!<br><span id="result_box" class="short_text" lang="en"><span class="hps">I followed</span> <span class="hps">your instructions</span> <span class="hps">and fixed the problem</span></span>.<br><br>Marta<br><br>

<div class="gmail_quote">On Tue, Jan 15, 2013 at 8:16 AM, Francois Hugues <span dir="ltr"><<a href="mailto:hugues.francois@irstea.fr" target="_blank">hugues.francois@irstea.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hello,<br>
<br>
To complete these answers about the usage st_intersection in combination with st_intersects, if  you want to avoid to clip features "which simply intersect the border" you should try to add st_touches(a.geom, b.geom) = 'f' in the where clause.<br>


<br>
Hugues<br>
<br>
<br>
<br>
--<br>
<br>
<br>
<br>
Hugues FRANÇOIS<br>
<br>
IR - UR DTM<br>
<br>
<br>
<br>
Cemagref - IRSTEA Grenoble<br>
<br>
2, rue de la papeterie<br>
<br>
Domaine universitaire<br>
<br>
38402 Saint-Martin-d'Hères CEDEX<br>
<br>
<br>
<br>
04.76.76.27.44<br>
<br>
06.77.66.21.31<br>
<br>
<br>
<br>
<a href="mailto:hugues.francois@irstea.fr">hugues.francois@irstea.fr</a><br>
<br>
<br>
<br>
________________________________<br>
<br>
From: <a href="mailto:postgis-users-bounces@lists.osgeo.org">postgis-users-bounces@lists.osgeo.org</a> [mailto:<a href="mailto:postgis-users-bounces@lists.osgeo.org">postgis-users-bounces@lists.osgeo.org</a>] On Behalf Of Martin Davis<br>


Sent: Tuesday, January 15, 2013 5:42 AM<br>
To: <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
Subject: Re: [postgis-users] clip polygons<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
Correct.  See <a href="http://postgis.net/docs/manual-2.0/ST_Intersection.html" target="_blank">http://postgis.net/docs/manual-2.0/ST_Intersection.html</a><br>
<br>
<br>
On 1/14/2013 5:14 PM, Tim-Hinnerk Heuer wrote:<br>
<br>
<br>
        I think Nicolas is more correct. St_Intersection sounds like a function that gets a geometry while St_Intersects returns a Boolean.<br>
<br>
        On Jan 15, 2013 6:24 AM, "Francisco Salas" <<a href="mailto:fsalas@pinar.geocuba.cu">fsalas@pinar.geocuba.cu</a>> wrote:<br>
<br>
<br>
                Martha ,<br>
<br>
                I think that you must use in the select sentence st_intersects(a.the_geom, b.the_geom) as the_geom , instead of a.the_geom<br>
<br>
<br>
<br>
                Francisco Salas<br>
<br>
<br>
<br>
<br>
<br>
                De: <a href="mailto:postgis-users-bounces@lists.osgeo.org">postgis-users-bounces@lists.osgeo.org</a> [mailto:<a href="mailto:postgis-users-bounces@lists.osgeo.org">postgis-users-bounces@lists.osgeo.org</a>] En nombre de Marta Debolini<br>


                Enviado el: lunes, 14 de enero de 2013 12:01 p.m.<br>
                Para: <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
                Asunto: [postgis-users] clip polygons<br>
<br>
<br>
<br>
                Hi,<br>
                I am a new postgis user, so sorry if my request seems trivial for someone.<br>
<br>
                I have to clip a polygon with another polygon file. I was used to do this operation with the simple comand "clip" in GRASS or QGIS.<br>
                How can I do the same operation in postgis? I tried with sy_intersect, but it takes also the polygons outside my area, which simply intersect the border.<br>
                The request I wrote is:<br>
<br>
<br>
                CREATE TABLE w_md.x<br>
                AS (SELECT area, a.the_geom<br>
                    FROM oc a, co b<br>
                    WHERE st_intersects(a.the_geom, b.the_geom));<br>
<br>
                    ALTER TABLE w_md.x_1999 ADD column ggid1 serial;<br>
                     ALTER TABLE w_mdi.x_1999 ADD PRIMARY KEY (ggID1);<br>
<br>
                Thank you for your help,<br>
<br>
                Marta<br>
<br>
<br>
                _______________________________________________<br>
                postgis-users mailing list<br>
                <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
                <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
<br>
<br>
<br>
<br>
<br>
<br>
        _______________________________________________<br>
        postgis-users mailing list<br>
        <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
        <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
<br>
<br>
<br>
<br>
<br>
        No virus found in this message.<br>
        Checked by AVG - <a href="http://www.avg.com" target="_blank">www.avg.com</a><br>
        Version: 2013.0.2805 / Virus Database: 2637/6000 - Release Date: 12/31/12<br>
        Internal Virus Database is out of date.<br>
<br>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br>