Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add region categories json + improvement hierarchy metadata json + correction id to int in json #27

Merged
merged 4 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ repos:
- id: rst-directive-colons
- id: rst-inline-touching-normal

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.2"
hooks:
- id: prettier
types_or: [json]
exclude: ".geojson$"
# types_or: [yaml, markdown, html, css, scss, javascript, json]
args: [--prose-wrap=always]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.291"
hooks:
Expand Down
2 changes: 1 addition & 1 deletion data/regions.json
Original file line number Diff line number Diff line change
Expand Up @@ -679,4 +679,4 @@
}
}
}
}
}
54 changes: 27 additions & 27 deletions data/variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,15 @@
"value_range": [0, 100],
"nodata_value": 255,
"colormap": [
[247,251,255],
[222,235,247],
[198,219,239],
[158,202,225],
[107,174,214],
[66,146,198],
[33,113,181],
[8,81,156],
[8,48,107]
[247, 251, 255],
[222, 235, 247],
[198, 219, 239],
[158, 202, 225],
[107, 174, 214],
[66, 146, 198],
[33, 113, 181],
[8, 81, 156],
[8, 48, 107]
],
"colormap_value_range": [0, 50],
"transparent_zero": false
Expand All @@ -269,15 +269,15 @@
"value_range": [-4, 4],
"nodata_value": 255,
"colormap": [
[178,24,43],
[214,96,77],
[244,165,130],
[253,219,199],
[247,247,247],
[209,229,240],
[146,197,222],
[67,147,195],
[33,102,172]
[178, 24, 43],
[214, 96, 77],
[244, 165, 130],
[253, 219, 199],
[247, 247, 247],
[209, 229, 240],
[146, 197, 222],
[67, 147, 195],
[33, 102, 172]
],
"colormap_value_range": [-2, 2],
"transparent_zero": false
Expand All @@ -295,15 +295,15 @@
"value_range": [0, 200],
"nodata_value": 255,
"colormap": [
[178,24,43],
[214,96,77],
[244,165,130],
[253,219,199],
[247,247,247],
[209,229,240],
[146,197,222],
[67,147,195],
[33,102,172]
[178, 24, 43],
[214, 96, 77],
[244, 165, 130],
[253, 219, 199],
[247, 247, 247],
[209, 229, 240],
[146, 197, 222],
[67, 147, 195],
[33, 102, 172]
],
"colormap_value_range": [45, 155],
"transparent_zero": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,20 @@ Sub regions fall in to a hierarchy, for example one HUC2 has many HUC4s.
```
</details>


### Hierarchy

The regions are structured in a hierarchy where, for instance with Hydrologic Unit
Codes, one subregion can have many levels subdivisions. `region_categories.json` defines
the grouping types, e.g. "HUC" or "US State", and `region_hierarchy_*.json` define the
structure of groups and their members.

<details>
<summary>`region_categories.json`</summary>
```{.json include="region_categories.json"}
```
</details>

<details>
<summary>`region_hierarchy_26000.json`</summary>
```{.json include="region_hierarchy_26000.json"}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
{
"11725": {
"name": "California",
"code": "US-CA",
"subdivisionType": "adm1",
"shapefileRelativePath": "regionshapefiles/11/region_shapefile_11725.geojson"
},
"11726": {
"name": "Colorado",
"code": "US-CO",
"subdivisionType": "adm1",
"shapefileRelativePath": "regionshapefiles/11/region_shapefile_11726.geojson"
},
"12516": {
"name": "Pacific Northwest",
"code": "HUC17",
"subdivisionType": "huc2",
"shapefileRelativePath": "regionshapefiles/12/region_shapefile_12516.geojson"
},
"12517": {
"name": "California",
"code": "HUC18",
"subdivisionType": "huc2",
"shapefileRelativePath": "regionshapefiles/12/region_shapefile_12517.geojson"
},
"12807": {
"name": "Lower Columbia",
"code": "HUC1708",
"subdivisionType": "huc4",
"shapefileRelativePath": "regionshapefiles/12/region_shapefile_12807.geojson"
},
"12809": {
"name": "Oregon-Washington Coastal",
"code": "HUC1710",
"subdivisionType": "huc4",
"shapefileRelativePath": "regionshapefiles/12/region_shapefile_12809.geojson"
},
"12815": {
"name": "San Joaquin",
"code": "HUC1804",
"subdivisionType": "huc4",
"shapefileRelativePath": "regionshapefiles/12/region_shapefile_12815.geojson"
}
}
"11725": {
"name": "California",
"code": "US-CA",
"subdivisionType": "adm1",
"shapefileRelativePath": "regionshapefiles/11/region_shapefile_11725.geojson"
},
"11726": {
"name": "Colorado",
"code": "US-CO",
"subdivisionType": "adm1",
"shapefileRelativePath": "regionshapefiles/11/region_shapefile_11726.geojson"
},
"12516": {
"name": "Pacific Northwest",
"code": "HUC17",
"subdivisionType": "huc2",
"shapefileRelativePath": "regionshapefiles/12/region_shapefile_12516.geojson"
},
"12517": {
"name": "California",
"code": "HUC18",
"subdivisionType": "huc2",
"shapefileRelativePath": "regionshapefiles/12/region_shapefile_12517.geojson"
},
"12807": {
"name": "Lower Columbia",
"code": "HUC1708",
"subdivisionType": "huc4",
"shapefileRelativePath": "regionshapefiles/12/region_shapefile_12807.geojson"
},
"12809": {
"name": "Oregon-Washington Coastal",
"code": "HUC1710",
"subdivisionType": "huc4",
"shapefileRelativePath": "regionshapefiles/12/region_shapefile_12809.geojson"
},
"12815": {
"name": "San Joaquin",
"code": "HUC1804",
"subdivisionType": "huc4",
"shapefileRelativePath": "regionshapefiles/12/region_shapefile_12815.geojson"
}
}
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
{
"3701": {
"name": "Alberta",
"code": "CA-AB",
"subdivisionType": "adm1",
"shapefileRelativePath": "regionshapefiles/37/region_shapefile_3701.geojson"
},
"24989": {
"name": "Catchment HYD78268",
"code": "HYD78268",
"subdivisionType": "hydro5",
"shapefileRelativePath": "regionshapefiles/24/region_shapefile_24989.geojson"
},
"17376": {
"name": "Catchment HYD7821",
"code": "HYD7821",
"subdivisionType": "hydro4",
"shapefileRelativePath": "regionshapefiles/17/region_shapefile_17376.geojson"
},
"17381": {
"name": "Catchment HYD7826",
"code": "HYD7826",
"subdivisionType": "hydro4",
"shapefileRelativePath": "regionshapefiles/17/region_shapefile_17381.geojson"
},
"15269": {
"name": "Catchment HYD782",
"code": "HYD782",
"subdivisionType": "hydro3",
"shapefileRelativePath": "regionshapefiles/15/region_shapefile_15269.geojson"
}
}
"3701": {
"name": "Alberta",
"code": "CA-AB",
"subdivisionType": "adm1",
"shapefileRelativePath": "regionshapefiles/37/region_shapefile_3701.geojson"
},
"24989": {
"name": "Catchment HYD78268",
"code": "HYD78268",
"subdivisionType": "hydro5",
"shapefileRelativePath": "regionshapefiles/24/region_shapefile_24989.geojson"
},
"17376": {
"name": "Catchment HYD7821",
"code": "HYD7821",
"subdivisionType": "hydro4",
"shapefileRelativePath": "regionshapefiles/17/region_shapefile_17376.geojson"
},
"17381": {
"name": "Catchment HYD7826",
"code": "HYD7826",
"subdivisionType": "hydro4",
"shapefileRelativePath": "regionshapefiles/17/region_shapefile_17381.geojson"
},
"15269": {
"name": "Catchment HYD782",
"code": "HYD782",
"subdivisionType": "hydro3",
"shapefileRelativePath": "regionshapefiles/15/region_shapefile_15269.geojson"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"adm0part": {
"name": "Country area"
},
"adm0": {
"name": "Country"
},
"adm1": {
"name": "State / Country subdivision level 1"
},
"adm1part": {
"name": "State area"
},
"huc2": {
"name": "U.S. Hydrologic Unit Code level 2"
},
"huc4": {
"name": "U.S. Hydrologic Unit Code level 4"
},
"huc6": {
"name": "U.S. Hydrologic Unit Code level 6"
},
"hydro3": {
"name": "Hydrosheds level 3"
},
"hydro4": {
"name": "Hydrosheds level 4"
},
"hydro5": {
"name": "Hydrosheds level 5"
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
{
"26000": {
"children": {
"11725": {},
"11726": {},
"12516": {
"children": {
"12807": {},
"12809": {}
}
},
"12517": {
"children": {
"12815": {}
}
}
"adm1": {
"items": {
"11725": {},
"11726": {}
}
},
"huc2": {
"items": {
"12516": {
"huc4": {
"items": {
"12807": {},
"12809": {}
}
}
},
"12517": {
"huc4": {
"items": {
"12815": {}
}
}
}
}
}
}
}
Loading