Skip to content

Instantly share code, notes, and snippets.

@aaronpdennis
Created August 17, 2016 20:55
Show Gist options
  • Save aaronpdennis/738588d2e8a948fed047d8a25f1753d2 to your computer and use it in GitHub Desktop.
Save aaronpdennis/738588d2e8a948fed047d8a25f1753d2 to your computer and use it in GitHub Desktop.
SELECT name FROM upstate ORDER BY name;
SELECT * FROM
Crosstab('SELECT row.name::text, col.name::text, (ST_Distance(row.geometry, col.geometry, true)*0.00062)::text AS dist
FROM upstate AS row, upstate AS col
ORDER BY 1, 2;'
) AS
ct(row_name text, Auburn text, Binghamton text, Elmira text, Ithaca text, Rochester text, Syracuse text);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment