Created
August 17, 2016 21:26
-
-
Save aaronpdennis/35d397c99f669669659acb332293333c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
SELECT avg(mindist) AS avgNND | |
FROM | |
( SELECT aname, min(dist) AS mindist | |
FROM | |
( SELECT a.geometry, ST_Distance(a.geometry, b.geometry)*0.00062 AS dist, | |
a.name AS aname, b.name AS bname | |
FROM parks AS a, parks AS b | |
WHERE a.name <> b.name | |
ORDER BY aname, dist ASC ) AS distances | |
GROUP BY aname ) AS mindistance; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment