I have a table of two columns:
- Polylines (Linestrings) geometry coordinates.
- Buffers: distance in kilometers.
The table contains about 1000 entries. Using PostGIS "ST_DWithin" or any relevant tool, I want to find the entries which are within a specific distance from the 10th entry (for example). The problem is that the distance is not a constant number, I want to sum the buffers of the 10th entry and that of each entry individually and check each one separately, e.g.:
ST_DWithin(10th.geom, 1st.geom, (10th.Buffer + 1st.Buffer)) # ... # or ST_DWithin(10th.geom, 2nd.geom, (10th.Buffer + 2nd.Buffer)) # ...and so on.
How to do this?