--SELECT d.fid id, d.FILE_IMG AS FILE, d.geom
--FROM dalles_ortho_67 d, communes c
--WHERE ST_INTERSECTS(d.geom, ST_BUFFER(c.geom, 500)) AND c.insee_com == '67180'



--SELECT c.fid AS id, ST_BUFFER(c.geom, 500) AS geom

--FROM communes c

--WHERE c.insee_com == '67180'



SELECT d.fid id, d.FILE_IMG AS FILE, d.geom

FROM dalles_ortho_67 d

WHERE ST_INTERSECTS(d.geom, (

	SELECT ST_BUFFER(c.geom, 0) AS geom

	FROM communes c

	WHERE c.insee_com == '67180'))

