Skip to content

Instantly share code, notes, and snippets.

@ramiroaznar
Created April 6, 2017 16:25
Show Gist options
  • Save ramiroaznar/be16f5a6c18b07142f4b3cfd6b5c774b to your computer and use it in GitHub Desktop.
Save ramiroaznar/be16f5a6c18b07142f4b3cfd6b5c774b to your computer and use it in GitHub Desktop.
How to select points which do not intersect with buffers
with
buffers as (
select st_transform(
st_union(
st_buffer(
the_geom::geography, 1000)::geometry
),
3857
) as the_geom_webmercator
from table_points
)
select p.*
from points p, buffers b
where st_disjoint(p.the_geom_webmercator, b.the_geom_webmercator)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment