I have written a query in PostGIS in which I use the ST_DWithin function to get the geometries which are located in a certain distance:
SELECT images.path, focnetworkpart.__gid
FROM images INNER JOIN focnetworkpart
ON ST_DWithin(images.geom, focnetworkpart.geom, 30000)
As shown in the query above I use two different tables (images: with point geometry and focneworkpart with line geometry).
There is one more table which has point geometry (nodes table) and I want to include it in the above query. To be more clear, lets say that I have one input in the image table (with point geometry). What I want is to find all the geometries of node table and focnetworkpart table which are in distance 30000 from the point of the image table.
My question is if I can do this using only one query? Or they have to be two different.
EDITED This is the table called images (with point geometry)
This is the table called nodes (also with point geometry)
And this is the table called network (with polyline geometries)
What I want is to find all the line and nodes geometries which are within a certain distance from a point in images table. The output result of the query would be a table with four columns (imageId, PathId, nodeGeometry, PolylineGeometry).