I have a table of two columns:

  1. Polylines (Linestrings) geometry coordinates.
  2. 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?

  • 1
    So long as the distance associated with the buffer is available, this is trivial in a simple join. Please Edit the Question to add your coding attempt, so we know the table names involved and the names of the distance columns, and describe the problem you've encountered.
    – Vince
    Jul 11 at 2:47
  • The buffer column is what? Polygon geometries?
    – BERA
    Jul 11 at 7:40


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.