[postgis-users] ST_Intersection

Nicolas Ribot nicolas.ribot at gmail.com
Fri May 21 05:34:48 PDT 2010

> Hi,
> I have a polygon table (alk_flurstuecke) and create a view with a 40-meter
> buffer on an object:
> CREATE VIEW buffer_flur_40 AS
> SELECT gid, ST_SetSRID(st_buffer(the_geom,40), 31466 )
> AS the_geom FROM alk_flurstuecke WHERE fkz = '0726900330002300000';
> No problem, Ican see it in QGIS.
> Now I try to make an intersection on this buffer-view with my table:
> CREATE VIEW intersect_flur_40 (gid, flur, zaehler, nenner, the_geom) AS
> SELECT p.gid, p.flur, p.zaehler, p.nenner,
> ST_SetSRID(ST_Intersection(p.the_geom, b.the_geom) ,31466)
> AS the_geom FROM alk_flurstuecke AS p, buffer_flur_40 AS b
> WHERE p.fkz <> '0726900330002300000' AND IsEmpty
> (ST_Intersection(p.the_geom, b.the_geom) ) = FALSE;
> This view is created without errors too but there is no result. If I try to
> load the view in QGIS it diapears.
> Any idea?

Is the select used to create the view returning rows ?
Is this IsEmpty test necessary to validate there is an intersection ?


More information about the postgis-users mailing list