[postgis-users] Check geometry for true intersection using ST_Relate

Nicolas Ribot nicolas.ribot at gmail.com
Mon Jul 19 01:43:07 PDT 2010


> Hi,
>
> I need to retrieve from a table all the geometry that intersect a given
> polygon .
> But the standard ST_Intersection is no good for me because it return true
> even if
> two geometry are only touching on their boundary without having a partially
> overlap each other.
>
> I don't find other type of intersection that don't responde true on touch.
> So I try to use the ST_Relate(..)
> But I don't understand exactly how define the matrix to use.
>
> I don't sure if the correct matrix to declare is this
>
> String overlaps = "T********";
>
> or this
>
> String overlaps = "2********";
>
> my geometry are all polygon so perhaps declaring
> String overlaps = "T********";
> can be sufficient ?
>
> Many thx,
>
> Andrea Peri.
>

Hi,

...where st_intersects(geom, mypolygon) and not st_touches(geom, mypolygon)

In term of Relate matrix, it gives:

where st_relate(geom, pypolygon, '21210****');

Nicolas



More information about the postgis-users mailing list