Created
March 23, 2018 10:43
-
-
Save AlexArcPy/8e204a8faa8c401665470a2647dec99e to your computer and use it in GitHub Desktop.
Multiple Ring Buffer with PostGIS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--using set returning function generate_series | |
--https://www.postgresql.org/docs/9.1/static/functions-srf.html | |
WITH buffer_values as ( | |
SELECT * FROM generate_series(5, 20, 5) AS dist | |
) | |
SELECT | |
CAST(p.id AS INT), p.name, b.dist, ST_Buffer(p.geom, b.dist) AS Poly | |
FROM | |
nyc_subway_stations p | |
CROSS JOIN | |
buffer_values b | |
WHERE | |
p.id < 10 | |
ORDER BY | |
p.id, b.dist; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment