I have some tables in Postgis of differents geometries (Points, Lines, Polygons).
I create a buffer of 1 kilometer of one point with this:
ST_Buffer(ST_GeomFromText('POINT(3056563.45195278 804692.195990143)',48402), 1000) AS buffer
What i want to do is populate a new table with the results of my layers(tables in postgis) that are inside of the buffer.
I test with this query and it works, but only if found matches in all the tables.
SELECT * FROM
table1,
table2,
ST_Buffer(ST_GeomFromText('POINT(3056563.45195278804692.195990143)',48402),1000) AS buffer
WHERE
ST_Within (buffer, table1.geom) AND
ST_Within (buffer, table2.geom)
The idea is give some point or polygon with a buffer in the map. And return a table with all the matches from table1, table2, table3, table4 that are inside that buffer.
How can i solve that problem?