5

I am a new postgis user and I have a simple question. My intention is to know all point values that not have a line feature near (10 meters of tolerance) How can I do this?

I've tried to find by ST_Dwithin operator, but I need the opposite result. All line features are not within the point radius. Something similar to "not covered by..."

3
  • Can you please edit your question to include what you have tried?
    – MaryBeth
    Jan 2, 2018 at 19:51
  • Welcome to GIS SE. As a new user, please take the Tour. SQL questions here are expected to contain SQL code (at a minimum, including the table names and geometry column name(s)). We'll also need you to Edit the question to provide more information about the total number of features, and the number of expected features in your result set (this can impact which of the two principal approaches to take).
    – Vince
    Jan 3, 2018 at 0:46
  • 1
    related but ST_Intersects with LEFT Join gis.stackexchange.com/questions/4502/…
    – Mapperz
    Jan 3, 2018 at 1:13

1 Answer 1

7

Just use a NOT EXISTS ( SELECT FROM WHERE ST_DWithin() )

SELECT *
FROM t1
WHERE NOT EXISTS (
  SELECT 1
  FROM t2
  WHERE ST_DWithin( t1, t2, m )
);

This will return all t1 not within m of t2

1
  • 1
    Exactly what I looking for. Work correctly Thank you so much. Regards! Jan 4, 2018 at 11:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.