Look this simple example
the difference between the line and the same line intersected with the
polygon is equal to the line :)
select 1, ST_Difference(ST_GeomFromText('LINESTRING(10.9 2, 11
8)'),ST_Intersection(ST_GeomFromText('LINESTRING(10.9 2, 11 8)'),
ST_GeomFromText('POLYGON((12 2, 10 10, 20 21, 21 5, 12 2))')))
the trick is that in the intersection point between polygon and line, the
vertex added move the line so the difference fail to
remove the internal portion.
2011/2/16 strk <[email protected]>
> On Tue, Feb 15, 2011 at 11:16:44PM +0100, aperi2007 wrote:
> > Hi,
> >
> > I need to retrieve the portion of a line external to a polygon,
> > I try with the ST_Difference and the ST_Intersections but both seem to
> > work only with geometries of same type.
>
> ST_Difference should work.
> Do you have a _small_ example showing it doesn't ?
>
> --strk;
>
> () Free GIS & Flash consultant/developer
> /\ http://strk.keybit.net/services.html
>
--
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users