Skip to content

Instantly share code, notes, and snippets.

@joshuapowell
Last active August 29, 2015 14:24
Show Gist options
  • Save joshuapowell/1f25ec149b0c5c295356 to your computer and use it in GitHub Desktop.
Save joshuapowell/1f25ec149b0c5c295356 to your computer and use it in GitHub Desktop.
Dissolve all HUC 12 Polygons into a single HUC 6 Polygon
SELECT
huc_6_name,
ST_AsGeoJson(ST_Multi(ST_Union(CAST(t.geometry AS Geometry)))) as huc_6_dissovled
FROM
territory AS t
WHERE
huc_6_name = 'Potomac'
GROUP BY
huc_6_name
Display the source blob
Display the rendered blob
Raw
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment