From 1875d680348c5d903480f743e5bc232957ea2dcc Mon Sep 17 00:00:00 2001
From: RY4GIT <400mhs2@gmail.com>
Date: Sat, 16 Mar 2024 19:18:32 -0700
Subject: [PATCH] git init
---
.gitignore | 82 +
LICENSE | 21 +
README.md | 37 +
dashboard_backup/dashboard_20220905.json | 1587 +++++++++++
dashboard_backup/dbdiagram - backup.txt | 172 ++
dashboard_backup/featurelayer_definition.json | 197 ++
dashboard_backup/popupElements0818.json | 355 +++
dashboard_backup/symbolinfo.json | 11 +
src/0-debug_excelsheets.ipynb | 559 ++++
src/1-build_database.ipynb | 1320 +++++++++
src/2-update_webmap.ipynb | 235 ++
src/calc_stats.sql | 348 +++
src/debug/debug_build_database_plain.sql | 111 +
src/debug/debug_built_database.sql | 648 +++++
src/environment.yml | 237 ++
src/environment_minimal.yml | 13 +
src/example_config.ini | 6 +
src/init_create_webmap_private.ipynb | 1889 +++++++++++++
src/init_create_webmap_public.ipynb | 2349 +++++++++++++++++
.../building_database_onlyFigModels.py | 548 ++++
...database_onlyFigModels_wo_hucwatersheds.py | 534 ++++
src/old_codes/building_database_read_huc8.sql | 114 +
.../create_webmap_onlyFigModels.ipynb | 1466 ++++++++++
src/utils/parse_location.py | 66 +
24 files changed, 12905 insertions(+)
create mode 100644 .gitignore
create mode 100644 LICENSE
create mode 100644 README.md
create mode 100644 dashboard_backup/dashboard_20220905.json
create mode 100644 dashboard_backup/dbdiagram - backup.txt
create mode 100644 dashboard_backup/featurelayer_definition.json
create mode 100644 dashboard_backup/popupElements0818.json
create mode 100644 dashboard_backup/symbolinfo.json
create mode 100644 src/0-debug_excelsheets.ipynb
create mode 100644 src/1-build_database.ipynb
create mode 100644 src/2-update_webmap.ipynb
create mode 100644 src/calc_stats.sql
create mode 100644 src/debug/debug_build_database_plain.sql
create mode 100644 src/debug/debug_built_database.sql
create mode 100644 src/environment.yml
create mode 100644 src/environment_minimal.yml
create mode 100644 src/example_config.ini
create mode 100644 src/init_create_webmap_private.ipynb
create mode 100644 src/init_create_webmap_public.ipynb
create mode 100644 src/old_codes/building_database_onlyFigModels.py
create mode 100644 src/old_codes/building_database_onlyFigModels_wo_hucwatersheds.py
create mode 100644 src/old_codes/building_database_read_huc8.sql
create mode 100644 src/old_codes/create_webmap_onlyFigModels.ipynb
create mode 100644 src/utils/parse_location.py
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..88120d4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,82 @@
+*.pdf
+*.pptx
+*.bk
+*.URL
+*.xlsx
+*.jpeg
+*.jpg
+*.png
+*.docx
+*.xlsx
+*.nc
+*.pyc
+
+src/config.ini
+src/cmd.txt
+src/auth.json
+
+## VS CODE
+.vscode
+.vscode/*
+# !.vscode/settings.json
+# !.vscode/tasks.json
+# !.vscode/launch.json
+# !.vscode/extensions.json
+# *.code-workspace
+# */.vscode/*
+
+### Python ###
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*/__pycache__/
+*.py[cod]
+*$py.class
+# **/__pycache__/* # old version
+
+# Jupyter notebook
+*-checkpoint.ipynb
+.ipynb_checkpoints
+*/.ipynb_checkpoints/*
+
+# IPython
+profile_default/
+ipython_config.py
+
+
+### macOS ###
+# General
+.DS_Store/
+.AppleDouble
+.LSOverride
+
+# Icon must end with two \r
+Icon
+
+
+# Thumbnails
+._*
+
+# Files that might appear in the root of a volume
+.DocumentRevisions-V100
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+.VolumeIcon.icns
+.com.apple.timemachine.donotpresent
+
+# Directories potentially created on remote AFP share
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk
+
+# operating system-related files
+# file properties cache/storage on macOS
+*.DS_Store
+# thumbnail cache on Windows
+Thumbs.db
+
+#
+notebooks/Interactive-1.ipynb
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..5c631f7
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2022 Ryoko Araki
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..dd090b5
--- /dev/null
+++ b/README.md
@@ -0,0 +1,37 @@
+# Interactive map: Perceptual Models Around the World by McMillan lab
+Repository for **[the perceptual model interactive map](http://www.mcmillanhydrology.org/PerceptualModelDashboard.html)** :world_map:
+
+Read our paper:
+ McMillan, H., Araki, R., Gnann, S., Woods, R., & Wagener, T. (n.d.). How do hydrologists perceive watersheds? A survey and analysis of perceptual model figures for experimental watersheds. Hydrological Processes. https://doi.org/10.1002/hyp.14845
+
+![alt text](perceptual_model.PNG?raw=true)
+
+# Links
+- [The database design (ER diagram)](https://dbdiagram.io/d/63f6895b296d97641d830705)
+- [The hydrologic process taxonomy used in the analysis](http://mcmillanhydrology.org/ProcessTaxonomy/ProcessTaxonomyDiagram.html)
+- [Technical instruction on how this map is created](https://www.notion.so/raraki/Database-instruction-521fa8f832794cf0aade20bec576a725) (PostgreSQL + Python + Arc-GIS dashboard)
+
+# Code
+## To update database & webmap
+- `0-debug_excelsheets.ipynb`
+- `1-build_database.ipynb`
+- `2-update_webmap.ipynb`
+## To initiate the webmap
+- Run `0-debug_excelsheets.ipynb` and `1-build_database.ipynb` and then run the followings:
+ - `init_create_webmap_private.ipynb`
+ - `init_create_webmap_public.ipynb`
+## Other utilities
+- `calc_stats.sql` holds query script to calculate statistics used in [the paper](https://doi.org/10.1002/hyp.14845)
+- `utils` directory holds some codes for standalone utilities
+- `debug` holds some codes for debugging database. Use when `1-build_database.ipynb` SQL codes are not working as expected
+
+# Contact
+We are looking to add more perceptual models to the interactive map and intersted in developing better design codes for drawing perceptual models in the hydrologic community!
+- If you find perceptual models to be included in the map (both texts and illustrations are welcome!) or want to discuss the model
+ - **Hilary McMillan** (hmcmillan (at) sdsu (dot) edu)
+- If you have questions about the technical details of the map
+ - **Ryoko Araki** (raraki8159 (at) sdsu (dot) edu)
+
+# Acknowledgement
+I appreciate [Jessica](https://github.com/jlembury), Atsushi, and Kyle for helping me with the coding!
+
diff --git a/dashboard_backup/dashboard_20220905.json b/dashboard_backup/dashboard_20220905.json
new file mode 100644
index 0000000..736cf16
--- /dev/null
+++ b/dashboard_backup/dashboard_20220905.json
@@ -0,0 +1,1587 @@
+{
+ "version": 51,
+ "authoringApp": "ArcGIS Dashboards",
+ "authoringAppVersion": "4.24.0+20bf311005",
+ "header": {
+ "backgroundColor": "#d8e7f0",
+ "selectors": [],
+ "type": "header",
+ "title": "Perceptual Models Around the World",
+ "subtitle": "McMillan Hydrology Lab",
+ "subtitlePlacement": "sameLine",
+ "logoImageURL": null,
+ "logoURL": null,
+ "logoSize": "small",
+ "showMargin": true,
+ "backgroundImageSizing": "fit-height",
+ "normalBackgroundImagePlacement": "left",
+ "horizontalBackgroundImagePlacement": "top",
+ "showSignOutMenu": true,
+ "menuLinks": [
+ {
+ "key": "Check Process Taxonomy Diagram",
+ "link": "https://mcmillanhydrology.org/ProcessTaxonomy/ProcessTaxonomyDiagram.html"
+ },
+ {
+ "key": "Visit Hilary McMillan's website (Lab PI)",
+ "link": "http://www.mcmillanhydrology.org/"
+ },
+ {
+ "key": "Visit Ryoko Araki's website (Developer/Ph.D. student)",
+ "link": "http://labusers.net/~raraki/"
+ }
+ ]
+ },
+ "sidebar": {
+ "selectors": [
+ {
+ "id": "ba3722ef-d8cb-46a6-a841-02d8e73d5cf2",
+ "name": "Selector (process hashtags)",
+ "caption": "Filter by processes",
+ "showLastUpdate": false,
+ "noDataState": {
+ "text": "",
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "noFilterState": {
+ "text": "",
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "events": [
+ {
+ "type": "selectionChanged",
+ "actions": [
+ {
+ "targets": [
+ {
+ "targetId": "abb9e1bc-261c-4a01-aae3-4b992169552b#main",
+ "by": "whereClause",
+ "requiresSelection": false
+ },
+ {
+ "targetId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0#91312012882",
+ "by": "whereClause",
+ "requiresSelection": false
+ },
+ {
+ "targetId": "5c7d375d-5c59-473f-aa94-ffe60077891e#main",
+ "by": "whereClause",
+ "requiresSelection": false
+ }
+ ],
+ "type": "filter"
+ }
+ ]
+ }
+ ],
+ "presentationMode": "dropdown",
+ "placeholderText": "Using hashtags/identifiers",
+ "showActionButtons": true,
+ "datasets": [
+ {
+ "type": "serviceDataset",
+ "name": "main",
+ "dataSource": {
+ "type": "layerDataSource",
+ "layerId": "91312012882",
+ "ownerId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0"
+ },
+ "groupByFields": [],
+ "orderByFields": [],
+ "statisticDefinitions": [],
+ "maxFeatures": 9999,
+ "clientSideStatistics": false,
+ "outFields": [
+ "*"
+ ],
+ "returnDistinctValues": false,
+ "allowSourceDownload": false,
+ "allowSummaryDownload": false
+ }
+ ],
+ "type": "categorySelectorWidget",
+ "category": {
+ "type": "features",
+ "itemText": "[Store] {store_id_list}; [Flux] {flux_id_list}"
+ },
+ "selection": {
+ "operator": "is_in",
+ "allowNone": false,
+ "noneLabelPlacement": "first",
+ "type": "multiple"
+ },
+ "displayType": "list",
+ "showFilter": true,
+ "maxSize": "compact"
+ },
+ {
+ "id": "2f882534-88a5-468b-8ae8-293497062618",
+ "name": "Selector (process names)",
+ "caption": " ",
+ "showLastUpdate": false,
+ "noDataState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "noFilterState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "events": [
+ {
+ "type": "selectionChanged",
+ "actions": [
+ {
+ "targets": [
+ {
+ "targetId": "abb9e1bc-261c-4a01-aae3-4b992169552b#main",
+ "by": "whereClause",
+ "requiresSelection": false
+ },
+ {
+ "targetId": "5c7d375d-5c59-473f-aa94-ffe60077891e#main",
+ "by": "whereClause",
+ "requiresSelection": false
+ },
+ {
+ "targetId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0#91312012882",
+ "by": "whereClause",
+ "requiresSelection": false
+ }
+ ],
+ "type": "filter"
+ }
+ ]
+ }
+ ],
+ "presentationMode": "dropdown",
+ "placeholderText": "Using descriptive names",
+ "showActionButtons": true,
+ "datasets": [
+ {
+ "type": "serviceDataset",
+ "name": "main",
+ "dataSource": {
+ "type": "layerDataSource",
+ "layerId": "91312012882",
+ "ownerId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0"
+ },
+ "groupByFields": [],
+ "orderByFields": [],
+ "statisticDefinitions": [],
+ "maxFeatures": 9999,
+ "clientSideStatistics": false,
+ "outFields": [
+ "*"
+ ],
+ "returnDistinctValues": false,
+ "allowSourceDownload": false,
+ "allowSummaryDownload": false
+ }
+ ],
+ "type": "categorySelectorWidget",
+ "category": {
+ "type": "features",
+ "itemText": "[Store] {store_list}; [Flux] {flux_list}"
+ },
+ "selection": {
+ "operator": "is_in",
+ "allowNone": true,
+ "noneLabelPlacement": "first",
+ "type": "multiple"
+ },
+ "displayType": "list",
+ "showFilter": true,
+ "maxSize": "extended"
+ },
+ {
+ "id": "051afbcd-7f5b-42b9-810c-25de7c0da06e",
+ "name": "Selector (spatial properties)",
+ "caption": "Filter by spatio-temporal properties",
+ "showLastUpdate": false,
+ "noDataState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "noFilterState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "events": [
+ {
+ "type": "selectionChanged",
+ "actions": [
+ {
+ "targets": [
+ {
+ "targetId": "abb9e1bc-261c-4a01-aae3-4b992169552b#main",
+ "by": "whereClause",
+ "requiresSelection": false
+ },
+ {
+ "targetId": "5c7d375d-5c59-473f-aa94-ffe60077891e#main",
+ "by": "whereClause",
+ "requiresSelection": false
+ },
+ {
+ "targetId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0#91312012882",
+ "by": "whereClause",
+ "requiresSelection": false
+ }
+ ],
+ "type": "filter"
+ }
+ ]
+ }
+ ],
+ "presentationMode": "dropdown",
+ "placeholderText": "Spatial",
+ "showActionButtons": true,
+ "datasets": [
+ {
+ "type": "serviceDataset",
+ "name": "main",
+ "dataSource": {
+ "type": "layerDataSource",
+ "layerId": "91312012882",
+ "ownerId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0"
+ },
+ "filter": {
+ "type": "filterGroup",
+ "condition": "OR",
+ "rules": [
+ {
+ "type": "filterGroup",
+ "condition": "AND",
+ "rules": [
+ {
+ "type": "filterRule",
+ "field": {
+ "name": "spatial_property",
+ "type": "string"
+ },
+ "operator": "not_equal",
+ "constraint": {
+ "type": "value",
+ "value": "N"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "groupByFields": [
+ "spatial_property"
+ ],
+ "orderByFields": [
+ "spatial_property ASC"
+ ],
+ "statisticDefinitions": [
+ {
+ "onStatisticField": "spatial_property",
+ "outStatisticFieldName": "count_result",
+ "statisticType": "count"
+ }
+ ],
+ "maxFeatures": 9999,
+ "clientSideStatistics": false,
+ "outFields": [
+ "*"
+ ],
+ "returnDistinctValues": false,
+ "allowSourceDownload": false,
+ "allowSummaryDownload": false
+ }
+ ],
+ "type": "categorySelectorWidget",
+ "category": {
+ "type": "groupByValues",
+ "labelOverrides": []
+ },
+ "selection": {
+ "operator": "is_in",
+ "allowNone": true,
+ "noneLabelPlacement": "first",
+ "type": "multiple"
+ },
+ "displayType": "list",
+ "showFilter": false,
+ "maxSize": "compact"
+ },
+ {
+ "id": "239a822a-2f4c-4e6f-a3b6-e275e306b019",
+ "name": "Selector (temporal properties)",
+ "caption": " ",
+ "showLastUpdate": false,
+ "noDataState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "noFilterState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "events": [
+ {
+ "type": "selectionChanged",
+ "actions": [
+ {
+ "targets": [
+ {
+ "targetId": "abb9e1bc-261c-4a01-aae3-4b992169552b#main",
+ "by": "whereClause",
+ "requiresSelection": false
+ },
+ {
+ "targetId": "5c7d375d-5c59-473f-aa94-ffe60077891e#main",
+ "by": "whereClause",
+ "requiresSelection": false
+ },
+ {
+ "targetId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0#91312012882",
+ "by": "whereClause",
+ "requiresSelection": false
+ }
+ ],
+ "type": "filter"
+ }
+ ]
+ }
+ ],
+ "presentationMode": "dropdown",
+ "placeholderText": "Temporal",
+ "showActionButtons": true,
+ "datasets": [
+ {
+ "type": "serviceDataset",
+ "name": "main",
+ "dataSource": {
+ "type": "layerDataSource",
+ "layerId": "91312012882",
+ "ownerId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0"
+ },
+ "filter": {
+ "type": "filterGroup",
+ "condition": "OR",
+ "rules": [
+ {
+ "type": "filterGroup",
+ "condition": "AND",
+ "rules": [
+ {
+ "type": "filterRule",
+ "field": {
+ "name": "temporal_property",
+ "type": "string"
+ },
+ "operator": "not_equal",
+ "constraint": {
+ "type": "value",
+ "value": "N"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "groupByFields": [
+ "temporal_property"
+ ],
+ "orderByFields": [
+ "temporal_property ASC"
+ ],
+ "statisticDefinitions": [
+ {
+ "onStatisticField": "temporal_property",
+ "outStatisticFieldName": "count_result",
+ "statisticType": "count"
+ }
+ ],
+ "maxFeatures": 9999,
+ "clientSideStatistics": false,
+ "outFields": [
+ "*"
+ ],
+ "returnDistinctValues": false,
+ "allowSourceDownload": false,
+ "allowSummaryDownload": false
+ }
+ ],
+ "type": "categorySelectorWidget",
+ "category": {
+ "type": "groupByValues",
+ "labelOverrides": []
+ },
+ "selection": {
+ "operator": "is_in",
+ "allowNone": true,
+ "noneLabelPlacement": "first",
+ "type": "multiple"
+ },
+ "displayType": "list",
+ "showFilter": false,
+ "maxSize": "compact"
+ },
+ {
+ "id": "7c1c0b56-a894-4487-841a-de2927fe6ead",
+ "name": "Selector (Vegetation)",
+ "caption": "Filter by watershed features",
+ "showLastUpdate": false,
+ "noDataState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "noFilterState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "events": [
+ {
+ "type": "selectionChanged",
+ "actions": [
+ {
+ "targets": [
+ {
+ "targetId": "abb9e1bc-261c-4a01-aae3-4b992169552b#main",
+ "by": "whereClause",
+ "requiresSelection": false
+ },
+ {
+ "targetId": "5c7d375d-5c59-473f-aa94-ffe60077891e#main",
+ "by": "whereClause",
+ "requiresSelection": false
+ },
+ {
+ "targetId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0#91312012882",
+ "by": "whereClause",
+ "requiresSelection": false
+ }
+ ],
+ "type": "filter"
+ }
+ ]
+ }
+ ],
+ "presentationMode": "dropdown",
+ "placeholderText": "Vegetation",
+ "showActionButtons": true,
+ "datasets": [
+ {
+ "type": "serviceDataset",
+ "name": "main",
+ "dataSource": {
+ "type": "layerDataSource",
+ "layerId": "91312012882",
+ "ownerId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0"
+ },
+ "filter": {
+ "type": "filterGroup",
+ "condition": "OR",
+ "rules": [
+ {
+ "type": "filterGroup",
+ "condition": "AND",
+ "rules": [
+ {
+ "type": "filterRule",
+ "field": {
+ "name": "vegetation_info",
+ "type": "string"
+ },
+ "operator": "not_equal",
+ "constraint": {
+ "type": "value",
+ "value": "N"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "groupByFields": [
+ "vegetation_info"
+ ],
+ "orderByFields": [
+ "vegetation_info ASC"
+ ],
+ "statisticDefinitions": [
+ {
+ "onStatisticField": "vegetation_info",
+ "outStatisticFieldName": "count_result",
+ "statisticType": "count"
+ }
+ ],
+ "maxFeatures": 9999,
+ "clientSideStatistics": false,
+ "outFields": [
+ "*"
+ ],
+ "returnDistinctValues": false,
+ "allowSourceDownload": false,
+ "allowSummaryDownload": false
+ }
+ ],
+ "type": "categorySelectorWidget",
+ "category": {
+ "type": "groupByValues",
+ "labelOverrides": []
+ },
+ "selection": {
+ "operator": "is_in",
+ "allowNone": true,
+ "noneLabelPlacement": "first",
+ "type": "multiple"
+ },
+ "displayType": "list",
+ "showFilter": false,
+ "maxSize": "compact"
+ },
+ {
+ "id": "8c2a0334-1f40-468f-aeef-b3c7b1688d39",
+ "name": "Selector (soil_info)",
+ "caption": " ",
+ "showLastUpdate": false,
+ "noDataState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "noFilterState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "events": [
+ {
+ "type": "selectionChanged",
+ "actions": [
+ {
+ "targets": [
+ {
+ "targetId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0#91312012882",
+ "by": "whereClause",
+ "requiresSelection": false
+ },
+ {
+ "targetId": "5c7d375d-5c59-473f-aa94-ffe60077891e#main",
+ "by": "whereClause",
+ "requiresSelection": false
+ },
+ {
+ "targetId": "abb9e1bc-261c-4a01-aae3-4b992169552b#main",
+ "by": "whereClause",
+ "requiresSelection": false
+ }
+ ],
+ "type": "filter"
+ }
+ ]
+ }
+ ],
+ "presentationMode": "dropdown",
+ "placeholderText": "Soil",
+ "showActionButtons": true,
+ "datasets": [
+ {
+ "type": "serviceDataset",
+ "name": "main",
+ "dataSource": {
+ "type": "layerDataSource",
+ "layerId": "91312012882",
+ "ownerId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0"
+ },
+ "filter": {
+ "type": "filterGroup",
+ "condition": "OR",
+ "rules": [
+ {
+ "type": "filterGroup",
+ "condition": "AND",
+ "rules": [
+ {
+ "type": "filterRule",
+ "field": {
+ "name": "soil_info",
+ "type": "string"
+ },
+ "operator": "not_equal",
+ "constraint": {
+ "type": "value",
+ "value": "N"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "groupByFields": [
+ "soil_info"
+ ],
+ "orderByFields": [
+ "soil_info ASC"
+ ],
+ "statisticDefinitions": [
+ {
+ "onStatisticField": "soil_info",
+ "outStatisticFieldName": "count_result",
+ "statisticType": "count"
+ }
+ ],
+ "maxFeatures": 50,
+ "clientSideStatistics": false,
+ "outFields": [
+ "*"
+ ],
+ "returnDistinctValues": false,
+ "allowSourceDownload": false,
+ "allowSummaryDownload": false
+ }
+ ],
+ "type": "categorySelectorWidget",
+ "category": {
+ "type": "groupByValues",
+ "labelOverrides": []
+ },
+ "selection": {
+ "operator": "is_in",
+ "allowNone": true,
+ "noneLabelPlacement": "first",
+ "type": "multiple"
+ },
+ "displayType": "list",
+ "showFilter": false,
+ "maxSize": "compact"
+ },
+ {
+ "id": "429a3e2b-1bd0-41e4-bfec-05f8530cdf2c",
+ "name": "Selector (Geology)",
+ "caption": " ",
+ "showLastUpdate": false,
+ "noDataState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "noFilterState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "events": [
+ {
+ "type": "selectionChanged",
+ "actions": [
+ {
+ "targets": [
+ {
+ "targetId": "abb9e1bc-261c-4a01-aae3-4b992169552b#main",
+ "by": "whereClause",
+ "requiresSelection": false
+ },
+ {
+ "targetId": "5c7d375d-5c59-473f-aa94-ffe60077891e#main",
+ "by": "whereClause",
+ "requiresSelection": false
+ },
+ {
+ "targetId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0#91312012882",
+ "by": "whereClause",
+ "requiresSelection": false
+ }
+ ],
+ "type": "filter"
+ }
+ ]
+ }
+ ],
+ "presentationMode": "dropdown",
+ "placeholderText": "Geology",
+ "showActionButtons": true,
+ "datasets": [
+ {
+ "type": "serviceDataset",
+ "name": "main",
+ "dataSource": {
+ "type": "layerDataSource",
+ "layerId": "91312012882",
+ "ownerId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0"
+ },
+ "filter": {
+ "type": "filterGroup",
+ "condition": "OR",
+ "rules": [
+ {
+ "type": "filterGroup",
+ "condition": "AND",
+ "rules": [
+ {
+ "type": "filterRule",
+ "field": {
+ "name": "geol_info",
+ "type": "string"
+ },
+ "operator": "not_equal",
+ "constraint": {
+ "type": "value",
+ "value": "N"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "groupByFields": [
+ "geol_info"
+ ],
+ "orderByFields": [
+ "geol_info ASC"
+ ],
+ "statisticDefinitions": [
+ {
+ "onStatisticField": "geol_info",
+ "outStatisticFieldName": "count_result",
+ "statisticType": "count"
+ }
+ ],
+ "maxFeatures": 9999,
+ "clientSideStatistics": false,
+ "outFields": [
+ "*"
+ ],
+ "returnDistinctValues": false,
+ "allowSourceDownload": false,
+ "allowSummaryDownload": false
+ }
+ ],
+ "type": "categorySelectorWidget",
+ "category": {
+ "type": "groupByValues",
+ "labelOverrides": []
+ },
+ "selection": {
+ "operator": "is_in",
+ "allowNone": true,
+ "noneLabelPlacement": "first",
+ "type": "multiple"
+ },
+ "displayType": "list",
+ "showFilter": false,
+ "maxSize": "compact"
+ },
+ {
+ "id": "194f11ac-5b1d-4b17-ab3a-99fff50f996e",
+ "name": "Selector (Topography)",
+ "caption": " ",
+ "showLastUpdate": false,
+ "noDataState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "noFilterState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "events": [
+ {
+ "type": "selectionChanged",
+ "actions": [
+ {
+ "targets": [
+ {
+ "targetId": "abb9e1bc-261c-4a01-aae3-4b992169552b#main",
+ "by": "whereClause",
+ "requiresSelection": false
+ },
+ {
+ "targetId": "5c7d375d-5c59-473f-aa94-ffe60077891e#main",
+ "by": "whereClause",
+ "requiresSelection": false
+ },
+ {
+ "targetId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0#91312012882",
+ "by": "whereClause",
+ "requiresSelection": false
+ }
+ ],
+ "type": "filter"
+ }
+ ]
+ }
+ ],
+ "presentationMode": "dropdown",
+ "placeholderText": "Topography",
+ "showActionButtons": true,
+ "datasets": [
+ {
+ "type": "serviceDataset",
+ "name": "main",
+ "dataSource": {
+ "type": "layerDataSource",
+ "layerId": "91312012882",
+ "ownerId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0"
+ },
+ "filter": {
+ "type": "filterGroup",
+ "condition": "OR",
+ "rules": [
+ {
+ "type": "filterGroup",
+ "condition": "AND",
+ "rules": [
+ {
+ "type": "filterRule",
+ "field": {
+ "name": "topo_info",
+ "type": "string"
+ },
+ "operator": "not_equal",
+ "constraint": {
+ "type": "value",
+ "value": "N"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "groupByFields": [
+ "topo_info"
+ ],
+ "orderByFields": [
+ "topo_info ASC"
+ ],
+ "statisticDefinitions": [
+ {
+ "onStatisticField": "topo_info",
+ "outStatisticFieldName": "count_result",
+ "statisticType": "count"
+ }
+ ],
+ "maxFeatures": 9999,
+ "clientSideStatistics": false,
+ "outFields": [
+ "*"
+ ],
+ "returnDistinctValues": false,
+ "allowSourceDownload": false,
+ "allowSummaryDownload": false
+ }
+ ],
+ "type": "categorySelectorWidget",
+ "category": {
+ "type": "groupByValues",
+ "labelOverrides": []
+ },
+ "selection": {
+ "operator": "is_in",
+ "allowNone": true,
+ "noneLabelPlacement": "first",
+ "type": "multiple"
+ },
+ "displayType": "list",
+ "showFilter": false,
+ "maxSize": "compact"
+ },
+ {
+ "id": "ecb76975-08ce-4d28-8d7e-6ed158a67cbf",
+ "name": "Selector (3D description)",
+ "caption": " ",
+ "showLastUpdate": false,
+ "noDataState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "noFilterState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "events": [
+ {
+ "type": "selectionChanged",
+ "actions": [
+ {
+ "targets": [
+ {
+ "targetId": "abb9e1bc-261c-4a01-aae3-4b992169552b#main",
+ "by": "whereClause",
+ "requiresSelection": false
+ },
+ {
+ "targetId": "5c7d375d-5c59-473f-aa94-ffe60077891e#main",
+ "by": "whereClause",
+ "requiresSelection": false
+ },
+ {
+ "targetId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0#91312012882",
+ "by": "whereClause",
+ "requiresSelection": false
+ }
+ ],
+ "type": "filter"
+ }
+ ]
+ }
+ ],
+ "presentationMode": "dropdown",
+ "placeholderText": "3D descriptions",
+ "showActionButtons": true,
+ "datasets": [
+ {
+ "type": "serviceDataset",
+ "name": "main",
+ "dataSource": {
+ "type": "layerDataSource",
+ "layerId": "91312012882",
+ "ownerId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0"
+ },
+ "filter": {
+ "type": "filterGroup",
+ "condition": "OR",
+ "rules": [
+ {
+ "type": "filterGroup",
+ "condition": "AND",
+ "rules": [
+ {
+ "type": "filterRule",
+ "field": {
+ "name": "three_d_info",
+ "type": "string"
+ },
+ "operator": "not_equal",
+ "constraint": {
+ "type": "value",
+ "value": "N"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "groupByFields": [
+ "three_d_info"
+ ],
+ "orderByFields": [
+ "three_d_info ASC"
+ ],
+ "statisticDefinitions": [
+ {
+ "onStatisticField": "three_d_info",
+ "outStatisticFieldName": "count_result",
+ "statisticType": "count"
+ }
+ ],
+ "maxFeatures": 9999,
+ "clientSideStatistics": false,
+ "outFields": [
+ "*"
+ ],
+ "returnDistinctValues": false,
+ "allowSourceDownload": false,
+ "allowSummaryDownload": false
+ }
+ ],
+ "type": "categorySelectorWidget",
+ "category": {
+ "type": "groupByValues",
+ "labelOverrides": []
+ },
+ "selection": {
+ "operator": "is_in",
+ "allowNone": true,
+ "noneLabelPlacement": "first",
+ "type": "multiple"
+ },
+ "displayType": "list",
+ "showFilter": false,
+ "maxSize": "compact"
+ },
+ {
+ "id": "44befccd-29aa-4cc3-9c06-7084cbd39370",
+ "name": "Selector (Uncertainty expression)",
+ "caption": " ",
+ "showLastUpdate": false,
+ "noDataState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "noFilterState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "events": [
+ {
+ "type": "selectionChanged",
+ "actions": [
+ {
+ "targets": [
+ {
+ "targetId": "abb9e1bc-261c-4a01-aae3-4b992169552b#main",
+ "by": "whereClause",
+ "requiresSelection": false
+ },
+ {
+ "targetId": "5c7d375d-5c59-473f-aa94-ffe60077891e#main",
+ "by": "whereClause",
+ "requiresSelection": false
+ },
+ {
+ "targetId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0#91312012882",
+ "by": "whereClause",
+ "requiresSelection": false
+ }
+ ],
+ "type": "filter"
+ }
+ ]
+ }
+ ],
+ "presentationMode": "dropdown",
+ "placeholderText": "Uncertainty expressions",
+ "showActionButtons": true,
+ "datasets": [
+ {
+ "type": "serviceDataset",
+ "name": "main",
+ "dataSource": {
+ "type": "layerDataSource",
+ "layerId": "91312012882",
+ "ownerId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0"
+ },
+ "filter": {
+ "type": "filterGroup",
+ "condition": "OR",
+ "rules": [
+ {
+ "type": "filterGroup",
+ "condition": "AND",
+ "rules": [
+ {
+ "type": "filterRule",
+ "field": {
+ "name": "uncertainty_info",
+ "type": "string"
+ },
+ "operator": "not_equal",
+ "constraint": {
+ "type": "value",
+ "value": "N"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "groupByFields": [
+ "uncertainty_info"
+ ],
+ "orderByFields": [
+ "uncertainty_info ASC"
+ ],
+ "statisticDefinitions": [
+ {
+ "onStatisticField": "uncertainty_info",
+ "outStatisticFieldName": "count_result",
+ "statisticType": "count"
+ }
+ ],
+ "maxFeatures": 9999,
+ "clientSideStatistics": false,
+ "outFields": [
+ "*"
+ ],
+ "returnDistinctValues": false,
+ "allowSourceDownload": false,
+ "allowSummaryDownload": false
+ }
+ ],
+ "type": "categorySelectorWidget",
+ "category": {
+ "type": "groupByValues",
+ "labelOverrides": []
+ },
+ "selection": {
+ "operator": "is_in",
+ "allowNone": true,
+ "noneLabelPlacement": "first",
+ "type": "multiple"
+ },
+ "displayType": "list",
+ "showFilter": false,
+ "maxSize": "compact"
+ },
+ {
+ "id": "991ddea4-e406-4735-a037-0e900b71e528",
+ "name": "Number selector (1)",
+ "caption": "Filter by watershed area (km)",
+ "showLastUpdate": false,
+ "noDataState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "noFilterState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "events": [
+ {
+ "type": "selectionChanged",
+ "actions": [
+ {
+ "targets": [
+ {
+ "targetId": "abb9e1bc-261c-4a01-aae3-4b992169552b#main",
+ "by": "whereClause",
+ "requiresSelection": false,
+ "fieldMap": [
+ {
+ "sourceName": "filterField",
+ "targetName": "area_km2"
+ }
+ ]
+ },
+ {
+ "targetId": "5c7d375d-5c59-473f-aa94-ffe60077891e#main",
+ "by": "whereClause",
+ "requiresSelection": false,
+ "fieldMap": [
+ {
+ "sourceName": "filterField",
+ "targetName": "area_km2"
+ }
+ ]
+ },
+ {
+ "targetId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0#91312012882",
+ "by": "whereClause",
+ "requiresSelection": false,
+ "fieldMap": [
+ {
+ "sourceName": "filterField",
+ "targetName": "area_km2"
+ }
+ ]
+ }
+ ],
+ "type": "filter"
+ }
+ ]
+ }
+ ],
+ "presentationMode": "inline",
+ "showActionButtons": true,
+ "datasets": [],
+ "type": "numericSelectorWidget",
+ "displayType": "spinner",
+ "selectionType": "range",
+ "operator": "equal",
+ "allowNone": false,
+ "firstDefault": 0,
+ "secondDefault": 200000,
+ "increment": 1,
+ "precision": 0,
+ "valueFormat": {
+ "name": "value",
+ "prefix": false,
+ "style": "decimal",
+ "useGrouping": true
+ },
+ "constraint": {
+ "type": "fixed",
+ "lowerLimit": 0,
+ "upperLimit": 200000
+ }
+ }
+ ],
+ "type": "sidebar",
+ "title": "
\n
\n
\n
\n
Guide
\n\n
Click a point on the map or a listed item to see a perceptual model.
\n\n
\n
\n
\n
\n
\n\nModel Filters
\n\nChoose one or more options in each filter dropdown menu to limit the map and list views.
\n\n
\n\nLookup keys for "Filter by processes (using hashtags/identifiers)" are the "identifiers" in the process taxonomy tree.
\n"
+ },
+ "widgets": [
+ {
+ "id": "bab5d1b0-8991-4389-9dda-4fe39647ddf0",
+ "name": "Perceptual Models Around the World",
+ "showLastUpdate": false,
+ "noDataState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "noFilterState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "type": "mapWidget",
+ "flashRepeats": 3,
+ "itemId": "4b453ba7e4cf498bb7d58970204a39c8",
+ "mapTools": [
+ {
+ "type": "basemapGalleryTool"
+ },
+ {
+ "type": "bookmarksTool"
+ }
+ ],
+ "showNavigation": true,
+ "showPopup": true,
+ "scalebarStyle": "line",
+ "layers": [
+ {
+ "events": [
+ {
+ "type": "selectionChanged",
+ "actions": [
+ {
+ "targets": [
+ {
+ "targetId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0",
+ "by": "geometry",
+ "requiresSelection": false
+ }
+ ],
+ "type": "flashGeometry"
+ }
+ ]
+ }
+ ],
+ "type": "layer",
+ "dataSource": {
+ "type": "layerDataSource",
+ "layerId": "111269282058",
+ "ownerId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0"
+ }
+ },
+ {
+ "events": [
+ {
+ "type": "selectionChanged",
+ "actions": [
+ {
+ "targets": [
+ {
+ "targetId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0",
+ "by": "geometry",
+ "requiresSelection": false
+ }
+ ],
+ "type": "flashGeometry"
+ }
+ ]
+ }
+ ],
+ "type": "layer",
+ "dataSource": {
+ "type": "layerDataSource",
+ "layerId": "111276130223",
+ "ownerId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0"
+ }
+ },
+ {
+ "type": "layer",
+ "dataSource": {
+ "type": "layerDataSource",
+ "layerId": "154972172183",
+ "ownerId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0"
+ }
+ }
+ ]
+ },
+ {
+ "id": "5c7d375d-5c59-473f-aa94-ffe60077891e",
+ "name": "List of selected models",
+ "caption": "Selected models
\n",
+ "showLastUpdate": false,
+ "noDataState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "noFilterState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "datasets": [
+ {
+ "type": "serviceDataset",
+ "name": "main",
+ "dataSource": {
+ "type": "layerDataSource",
+ "layerId": "91312012882",
+ "ownerId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0"
+ },
+ "groupByFields": [],
+ "orderByFields": [],
+ "statisticDefinitions": [],
+ "maxFeatures": 9999,
+ "clientSideStatistics": false,
+ "outFields": [
+ "*"
+ ],
+ "returnDistinctValues": false,
+ "allowSourceDownload": false,
+ "allowSummaryDownload": false
+ }
+ ],
+ "events": [
+ {
+ "type": "selectionChanged",
+ "actions": [
+ {
+ "targets": [
+ {
+ "targetId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0#91312012882",
+ "by": "whereClause",
+ "requiresSelection": false
+ }
+ ],
+ "type": "filter"
+ },
+ {
+ "targets": [
+ {
+ "targetId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0",
+ "by": "geometry",
+ "requiresSelection": false
+ }
+ ],
+ "type": "identify"
+ }
+ ]
+ }
+ ],
+ "type": "listWidget",
+ "selectionMode": "multi",
+ "iconType": "symbol",
+ "text": "{watershed_name}
\n"
+ },
+ {
+ "id": "abb9e1bc-261c-4a01-aae3-4b992169552b",
+ "name": "Indicator of number of selected models",
+ "showLastUpdate": false,
+ "noDataState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "noFilterState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ },
+ "datasets": [
+ {
+ "type": "serviceDataset",
+ "name": "main",
+ "dataSource": {
+ "type": "layerDataSource",
+ "layerId": "91312012882",
+ "ownerId": "bab5d1b0-8991-4389-9dda-4fe39647ddf0"
+ },
+ "groupByFields": [],
+ "orderByFields": [],
+ "statisticDefinitions": [
+ {
+ "onStatisticField": "ObjectId",
+ "outStatisticFieldName": "value",
+ "statisticType": "count"
+ }
+ ],
+ "clientSideStatistics": false,
+ "outFields": [
+ "*"
+ ],
+ "returnDistinctValues": false,
+ "allowSourceDownload": false,
+ "allowSummaryDownload": false
+ }
+ ],
+ "type": "indicatorWidget",
+ "defaultSettings": {
+ "topSection": {
+ "fontSize": 80,
+ "textInfo": {
+ "text": "Number of perceptual models"
+ }
+ },
+ "middleSection": {
+ "fontSize": 160,
+ "textInfo": {
+ "text": "{value}"
+ }
+ },
+ "bottomSection": {
+ "fontSize": 80,
+ "textInfo": {}
+ }
+ },
+ "comparison": "none",
+ "valueFormat": {
+ "name": "value",
+ "prefix": true,
+ "style": "decimal",
+ "useGrouping": true,
+ "maximumFractionDigits": 1
+ },
+ "percentageFormat": {
+ "name": "percentage",
+ "prefix": false,
+ "style": "percent",
+ "useGrouping": true
+ },
+ "ratioFormat": {
+ "name": "ratio",
+ "prefix": false,
+ "style": "decimal",
+ "useGrouping": true,
+ "maximumFractionDigits": 2
+ },
+ "valueType": "statistic",
+ "noValueState": {
+ "verticalAlignment": "middle",
+ "showCaption": true,
+ "showDescription": true
+ }
+ }
+ ],
+ "settings": {
+ "maxPaginationRecords": 50000,
+ "allowElementResizing": true,
+ "allowElementExpansion": true
+ },
+ "mapOverrides": {
+ "selectionColor": "#ff00f6",
+ "highlightColor": "#ff00ff",
+ "trackedFeatureRadius": 60
+ },
+ "theme": "light",
+ "themeOverrides": {},
+ "numberPrefixOverrides": [
+ {
+ "key": "yotta",
+ "symbol": "Y",
+ "enabled": true
+ },
+ {
+ "key": "zeta",
+ "symbol": "Z",
+ "enabled": true
+ },
+ {
+ "key": "exa",
+ "symbol": "E",
+ "enabled": true
+ },
+ {
+ "key": "peta",
+ "symbol": "P",
+ "enabled": true
+ },
+ {
+ "key": "tera",
+ "symbol": "T",
+ "enabled": true
+ },
+ {
+ "key": "giga",
+ "symbol": "G",
+ "enabled": true
+ },
+ {
+ "key": "mega",
+ "symbol": "M",
+ "enabled": true
+ },
+ {
+ "key": "kilo",
+ "symbol": "k",
+ "enabled": true
+ },
+ {
+ "key": "base",
+ "symbol": "",
+ "enabled": true
+ },
+ {
+ "key": "deci",
+ "symbol": "d",
+ "enabled": false
+ },
+ {
+ "key": "centi",
+ "symbol": "c",
+ "enabled": false
+ },
+ {
+ "key": "milli",
+ "symbol": "m",
+ "enabled": false
+ },
+ {
+ "key": "micro",
+ "symbol": "µ",
+ "enabled": false
+ },
+ {
+ "key": "nano",
+ "symbol": "n",
+ "enabled": false
+ }
+ ],
+ "layout": {
+ "rootElement": {
+ "width": 1,
+ "height": 1,
+ "elements": [
+ {
+ "width": 0.8106960950764007,
+ "height": 1,
+ "type": "itemLayoutElement",
+ "id": "bab5d1b0-8991-4389-9dda-4fe39647ddf0"
+ },
+ {
+ "width": 0.1893039049235994,
+ "height": 1,
+ "elements": [
+ {
+ "width": 1,
+ "height": 0.8173421262736565,
+ "type": "itemLayoutElement",
+ "id": "5c7d375d-5c59-473f-aa94-ffe60077891e"
+ },
+ {
+ "width": 1,
+ "height": 0.1826578737263433,
+ "type": "itemLayoutElement",
+ "id": "abb9e1bc-261c-4a01-aae3-4b992169552b"
+ }
+ ],
+ "type": "stackLayoutElement",
+ "orientation": "row"
+ }
+ ],
+ "type": "stackLayoutElement",
+ "orientation": "col"
+ }
+ }
+}
\ No newline at end of file
diff --git a/dashboard_backup/dbdiagram - backup.txt b/dashboard_backup/dbdiagram - backup.txt
new file mode 100644
index 0000000..3cfa3b3
--- /dev/null
+++ b/dashboard_backup/dbdiagram - backup.txt
@@ -0,0 +1,172 @@
+//// -- LEVEL 1
+//// -- The main table
+
+TABLE PerceptualModel {
+ Entry_ID int [pk, increment]
+ ModelType_ID int [NOT NULL] // Figure or text
+ Citation_ID int [NOT NULL]
+ ModelRef text // Referncing Figure # or Section #
+ ModelDetails text // Referencing Figure URL or text snipped
+ Location_ID int [NOT NULL]
+ Edit_ID int [NOT NULL]
+ Status boolean // Public or private
+ }
+
+TABLE ModelType {
+ ModelType_ID int [pk, increment]
+ Name varchar // Figure or text
+}
+
+//// Flux and stores infomation
+TABLE LinkProcessPercept {
+ Process_ID int
+ Entry_ID int
+ OriginalText text
+ Indexes {
+ (Process_ID, Entry_ID) [pk]
+ }
+}
+
+TABLE Process {
+ Process_ID int [pk, increment]
+ Name text
+ Definition text
+ Hashtag varchar [NOT NULL, UNIQUE] // ?? identifier??
+ ProcessLevel int
+ FunctionType_ID int
+}
+
+TABLE ProcessAltNames{
+ AltName varchar [pk]
+ Process_ID int
+}
+
+// Is this for distinguishing fluxes vs. storage? Or more descritized function as in taxonomy?
+TABLE FunctionType {
+ FuncTypeID int [pk, increment]
+ FunctionName varchar [NOT NULL, UNIQUE]
+ }
+
+
+// Dominant Process
+TABLE DominantProcess{
+ ID int [pk, increment]
+ Entry_ID int [NOT NULL] // Make this pk later
+ Process_ID int [NOT NULL]
+ Description text
+}
+
+
+//// Spatial and temporal Information
+TABLE LinkPerceptHeterog{
+ Entry_ID int
+ Heterog_ID int
+ OriginalText text
+ Indexes {
+ (Entry_ID, Heterog_ID) [pk]
+ }
+}
+
+TABLE Heterogeneity{
+ Heterog_ID int [pk, increment]
+ Name text // entry for each heterogeneity
+ TypeID int
+}
+
+TABLE HeterogeneityType{
+ TypeID int [pk, increment]
+ Name text // Spatial or tempral
+}
+
+//// Location
+TABLE Location {
+ Location_ID int [pk, increment]
+ pt geom // Lat,lon information
+ // HUC int // Might not need this using PostGIS
+ Name varchar [NOT NULL, UNIQUE]
+ Text varchar
+ }
+
+TABLE HUCWatersheds {
+ Watershed_ID int [pk, increment]
+ Boundary geom // shapefile
+ Name text
+ HUC int
+}
+
+//// Citations
+TABLE Citations {
+ Citation_ID int [pk, increment]
+ DOI varchar [UNIQUE]
+ OpenAccess boolean
+}
+
+
+// AncillaryInfo
+// Vegatation, Soil type, Geol type, Topographic info,
+// 3D info, and uncertainties
+
+TABLE AncillaryInfo {
+ InfoType_ID int
+ Entry_ID int
+ ContainsInfo boolean
+ Note text
+ Indexes {
+ (InfoType_ID, Entry_ID) [pk]
+ }
+}
+
+TABLE InfoType {
+ InfoType_ID int [pk, increment]
+ InfoName varchar [NOT NULL, UNIQUE]
+}
+
+// UpdateUser_ID
+TABLE EditRecord{
+ Edit_ID int [pk, increment]
+ Type text // Create, Approval, or Edit
+ Date datetime
+ User_ID int [NOT NULL]
+}
+
+TABLE User{
+ User_ID int [pk, increment]
+}
+
+
+//// Relate tables
+
+// Model type
+Ref: PerceptualModel.ModelType_ID > ModelType.ModelType_ID
+
+// Process (flux and storage)
+Ref: Process.FunctionType_ID > FunctionType.FuncTypeID
+Ref: LinkProcessPercept.Process_ID < Process.Process_ID
+Ref: PerceptualModel.Entry_ID > LinkProcessPercept.Entry_ID
+Ref: ProcessAltNames.Process_ID > Process.Process_ID
+
+// Dominant Process
+Ref: DominantProcess.Entry_ID > PerceptualModel.Entry_ID
+Ref: DominantProcess.Process_ID > Process.Process_ID
+
+// Heterogeneity (spatio-temporal)
+Ref: LinkPerceptHeterog.Entry_ID > PerceptualModel.Entry_ID
+Ref: LinkPerceptHeterog.Heterog_ID > Heterogeneity.Heterog_ID
+Ref: HeterogeneityType.TypeID > Heterogeneity.TypeID
+
+// AncillaryInfo
+Ref: AncillaryInfo.InfoType_ID < InfoType.InfoType_ID
+Ref: PerceptualModel.Entry_ID < AncillaryInfo.Entry_ID
+
+// Location
+Ref: PerceptualModel.Location_ID > Location.Location_ID
+
+// Citation
+Ref: PerceptualModel.Citation_ID > Citations.Citation_ID
+
+// Edits and uers
+Ref: PerceptualModel.Edit_ID > EditRecord.Edit_ID
+Ref: EditRecord.User_ID > User.User_ID
+
+
+
diff --git a/dashboard_backup/featurelayer_definition.json b/dashboard_backup/featurelayer_definition.json
new file mode 100644
index 0000000..dde146f
--- /dev/null
+++ b/dashboard_backup/featurelayer_definition.json
@@ -0,0 +1,197 @@
+{'layers': [{'layerDefinition': {'drawingInfo': {'transparency': 0,
+ 'renderer': {'type': 'uniqueValue',
+ 'visualVariables': [{'type': 'sizeInfo',
+ 'valueExpression': '$view.scale',
+ 'stops': [{'size': 46.875, 'value': 1155581.108577},
+ {'size': 37.5, 'value': 9244648.868618},
+ {'size': 18.75, 'value': 73957190.948944},
+ {'size': 9.375, 'value': 591657527.591555}]}],
+ 'field1': 'model_type',
+ 'uniqueValueGroups': [{'classes': [{'label': 'Text model',
+ 'symbol': {'type': 'esriPMS',
+ 'angle': 0,
+ 'xoffset': 0,
+ 'yoffset': 0,
+ 'contentType': 'image/png',
+ 'imageData': 'iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAmoSURBVHhe7Z1Lbt82EMZzhBwhixyhB8g+geG8H02RtEGbNk3TB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chta9NW9CVK/8Dprxw+rO3yFQAAAAASUVORK5CYII=',
+ 'url': 'https://static.arcgis.com/images/Symbols/Government/Warrant.png',
+ 'height': 15,
+ 'width': 15},
+ 'values': [['Text model']]},
+ {'label': 'Figure model',
+ 'symbol': {'type': 'esriPMS',
+ 'angle': 0,
+ 'xoffset': 0,
+ 'yoffset': 0,
+ 'contentType': 'image/png',
+ 'imageData': 'iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAANaElEQVR4Xu2dz+ocSxXH5xHyCFncB3DhA+QRcsGFMYhXXIgIchERcZUr4kZuQlAQFMniigsRIiiCoAQMuhAuP0TuwoWKIOJCjKBwFy7G+aSmfulfzzmnqk6d6p6ZzBe+/Eimu7qqTp+/Vd29ueCC08D9x7d3vLPjgx2f7Phsz20D8zmPdqSdOzve3l/hgsXxSqAI5cWOktCiSPtcJwn+gkG4//jWjm/t+HTziUf/2f2VhLEM0/Wf7kh/bu17eIEbWbDSZB8Pk8AvaEDyr/jF0WY4mvSXfl/8uAr83b1339tPmI+f+s5285nvbzef++F28/kfbTdf+Ml288Wfl/n2T9PxnMf5tCO1X8s0jov/vsbHvvHR3YS0RsKJCAThIKivPNtuvvrrONIe7dI+15GuX+azl+N7bZHMMumONDky0TC0jcmXBDOaXJfrt2s643zNzHhKR+p87ie/vd189r3t5ku/kCd+LdIf+kX/pH4fkvE+2M/AGQPTde/hH2aDl/np7yafGm2Go0n/6GetdjP+szXhH3/36+Kg58T/rWWOe0m/a/0383E2ePOdN3aDujoY5JynLNw564V99XJ+Thr3H9/d0fa9+DTMnTRZp07GVfbZzM/d/YydGFJwJQ3qFYlUj93n9pLxMU5p/Dd5YkFZKTUiSDkX01xLxlsOzp7sZ/CIQcH+3sPns47fJGnHuWuvRsbN+KV5yUzzd6QLH2mlSA+wztn3trLs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Go4GYzm4oULMsEbbB5MPP9/P9IpIOzzliBsOFvSUOQXCRxLV1mp7jrAJsnpSsGaWBJzmtbDzcimUBB2UR58VrTw48YgEnFEj6IDK2FmQeTg5AWfQMctHQwKMhcz30ZFx2wFW8sFHK+AprKgbsqrSuUx5cmS8+mpS5spRdCusPDqThfBz12rGpy/4T7lSHtyLVBmTS6CZ5+yry74XMj8LV7KikWrdekCWyS7EczHhjMNOjTKvlqtFLwFtmXLOUxY2/da3zN7k8OXCtcBCt7bDZE6CFMzdsfts+kc/y0FVIuMftuB/TEhBme2rM/FppB3HVkyhP/Sr7HMzGe+JBldepF2gdqo1J9pCpLqWOee6XL9Wa1+RcQbtqjxFpL1j8pMaJeL/eFEZkx9t1mmPdmm/1s8e8tnrYZprwbM82kN2tUTDEAjahnDwlQiqRI7jeM7j/HZNvck0DuezSa8Dkhnn+eg6n308pL/0+zU2yx6kV1scvsPkuEj/Kl/hcIGOtMKVBC69UG5JpusnwZ7EQsKpIj07TRpGwDbarNM+1+F6Fz+7GpIfv7MXBH4RobRG7Pkczk8CvfjXC04Dm83/AZ9peMb+hNWWAAAAAElFTkSuQmCC',
+ 'url': 'https://static.arcgis.com/images/Symbols/Government/Water-Teatment-Plant-Permit.png',
+ 'height': 18.75,
+ 'width': 18.75},
+ 'values': [['Figure model']]}]}],
+ 'uniqueValueInfos': [{'label': 'Text model',
+ 'symbol': {'type': 'esriPMS',
+ 'angle': 0,
+ 'xoffset': 0,
+ 'yoffset': 0,
+ 'contentType': 'image/png',
+ 'imageData': 'iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAmoSURBVHhe7Z1Lbt82EMZzhBwhixyhB8g+geG8H02RtEGbNk3TBEX3WXSfI2TRA+QIXmTVduFFD+JFD/DvfAIV29I3FClxKIriB/xg2BalGQ4kDh+irjQ1bUL37j+6JtwQ3gs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 'height': 15,
+ 'width': 15},
+ 'value': 'Text model'},
+ {'label': 'Figure model',
+ 'symbol': {'type': 'esriPMS',
+ 'angle': 0,
+ 'xoffset': 0,
+ 'yoffset': 0,
+ 'contentType': 'image/png',
+ 'imageData': 'iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAANaElEQVR4Xu2dz+ocSxXH5xHyCFncB3DhA+QRcsGFMYhXXIgIchERcZUr4kZuQlAQFMniigsRIiiCoAQMuhAuP0TuwoWKIOJCjKBwFy7G+aSmfulfzzmnqk6d6p6ZzBe+/Eimu7qqTp+/Vd29ueCC08D9x7d3vLPjgx2f7Phsz20D8zmPdqSdOzve3l/hgsXxSqAI5cWOktCiSPtcJwn+gkG4//jWjm/t+HTziUf/2f2VhLEM0/Wf7kh/bu17eIEbWbDSZB8Pk8AvaEDyr/jF0WY4mvSXfl/8uAr83b1339tPmI+f+s5285nvbzef++F28/kfbTdf+Ml288Wfl/n2T9PxnMf5tCO1X8s0jov/vsbHvvHR3YS0RsKJCAThIKivPNtuvvrrONIe7dI+15GuX+azl+N7bZHMMumONDky0TC0jcmXBDOaXJfrt2s643zNzHhKR+p87ie/vd189r3t5ku/kCd+LdIf+kX/pH4fkvE+2M/AGQPTde/hH2aDl/np7yafGm2Go0n/6GetdjP+szXhH3/36+Kg58T/rWWOe0m/a/0383E2ePOdN3aDujoY5JynLNw564V99XJ+Thr3H9/d0fa9+DTMnTRZp07GVfbZzM/d/YydGFJwJQ3qFYlUj93n9pLxMU5p/Dd5YkFZKTUiSDkX01xLxlsOzp7sZ/CIQcH+3sPns47fJGnHuWuvRsbN+KV5yUzzd6QLH2mlSA+wztn3trLsq5nHIxN0jYBXLGZ85Fvvb+987/cHvP3N34nHL0Lm42QEXRIwRY0FzPOtr/32peAe/Oqv26cf/HN79ff/blvw7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VrTw48YgEnFEj6IDK2FmQeTg5AWfQMctHQwKMhcz30ZFx2wFW8sFHK+AprKgbsqrSuUx5cmS8+mpS5spRdCusPDqThfBz12rGpy/4T7lSHtyLVBmTS6CZ5+yry74XMj8LV7KikWrdekCWyS7EczHhjMNOjTKvlqtFLwFtmXLOUxY2/da3zN7k8OXCtcBCt7bDZE6CFMzdsfts+kc/y0FVIuMftuB/TEhBme2rM/FppB3HVkyhP/Sr7HMzGe+JBldepF2gdqo1J9pCpLqWOee6XL9Wa1+RcQbtqjxFpL1j8pMaJeL/eFEZkx9t1mmPdmm/1s8e8tnrYZprwbM82kN2tUTDEAjahnDwlQiqRI7jeM7j/HZNvck0DuezSa8Dkhnn+eg6n308pL/0+zU2yx6kV1scvsPkuEj/Kl/hcIGOtMKVBC69UG5JpusnwZ7EQsKpIj07TRpGwDbarNM+1+F6Fz+7GpIfv7MXBH4RobRG7Pkczk8CvfjXC04Dm83/AZ9peMb+hNWWAAAAAElFTkSuQmCC',
+ 'url': 'https://static.arcgis.com/images/Symbols/Government/Water-Teatment-Plant-Permit.png',
+ 'height': 18.75,
+ 'width': 18.75},
+ 'value': 'Figure model'}]}},
+ 'defaultVisibility': True,
+ 'definitionExpression': None},
+ 'id': 0,
+ 'popupInfo': {'popupElements': [{'type': 'fields'},
+ {'type': 'attachments', 'displayType': 'auto'}],
+ 'showAttachments': True,
+ 'fieldInfos': [{'fieldName': 'id',
+ 'isEditable': True,
+ 'label': 'id',
+ 'visible': True},
+ {'fieldName': 'model_type',
+ 'isEditable': True,
+ 'label': 'model_type',
+ 'visible': True},
+ {'fieldName': 'citation',
+ 'isEditable': True,
+ 'label': 'citation',
+ 'visible': True},
+ {'fieldName': 'url', 'isEditable': True, 'label': 'url', 'visible': True},
+ {'fieldName': 'attribution',
+ 'isEditable': True,
+ 'label': 'attribution',
+ 'visible': True},
+ {'fieldName': 'attribution_url',
+ 'isEditable': True,
+ 'label': 'attribution_url',
+ 'visible': True},
+ {'fieldName': 'figure_num',
+ 'isEditable': True,
+ 'label': 'figure_num',
+ 'visible': True},
+ {'fieldName': 'figure_caption',
+ 'isEditable': True,
+ 'label': 'figure_caption',
+ 'visible': True},
+ {'fieldName': 'figure_url',
+ 'isEditable': True,
+ 'label': 'figure_url',
+ 'visible': True},
+ {'fieldName': 'textmodel_snipped',
+ 'isEditable': True,
+ 'label': 'textmodel_snipped',
+ 'visible': True},
+ {'fieldName': 'textmodel_section_number',
+ 'isEditable': True,
+ 'label': 'textmodel_section_number',
+ 'visible': True},
+ {'fieldName': 'textmodel_section_name',
+ 'isEditable': True,
+ 'label': 'textmodel_section_name',
+ 'visible': True},
+ {'fieldName': 'textmodel_page_number',
+ 'isEditable': True,
+ 'label': 'textmodel_page_number',
+ 'visible': True},
+ {'fieldName': 'watershed_name',
+ 'isEditable': True,
+ 'label': 'watershed_name',
+ 'visible': True},
+ {'fieldName': 'lat', 'isEditable': True, 'label': 'lat', 'visible': True},
+ {'fieldName': 'lon', 'isEditable': True, 'label': 'lon', 'visible': True},
+ {'fieldName': 'area_km2',
+ 'isEditable': True,
+ 'label': 'area_km2',
+ 'visible': True},
+ {'fieldName': 'num_spatial_zones',
+ 'isEditable': True,
+ 'label': 'num_spatial_zones',
+ 'visible': True},
+ {'fieldName': 'spatial_property',
+ 'isEditable': True,
+ 'label': 'spatial_property',
+ 'visible': True},
+ {'fieldName': 'num_temporal_zones',
+ 'isEditable': True,
+ 'label': 'num_temporal_zones',
+ 'visible': True},
+ {'fieldName': 'temporal_property',
+ 'isEditable': True,
+ 'label': 'temporal_property',
+ 'visible': True},
+ {'fieldName': 'vegetation_info',
+ 'isEditable': True,
+ 'label': 'vegetation_info',
+ 'visible': True},
+ {'fieldName': 'soil_info',
+ 'isEditable': True,
+ 'label': 'soil_info',
+ 'visible': True},
+ {'fieldName': 'geol_info',
+ 'isEditable': True,
+ 'label': 'geol_info',
+ 'visible': True},
+ {'fieldName': 'topo_info',
+ 'isEditable': True,
+ 'label': 'topo_info',
+ 'visible': True},
+ {'fieldName': 'three_d_info',
+ 'isEditable': True,
+ 'label': 'three_d_info',
+ 'visible': True},
+ {'fieldName': 'uncertainty_info',
+ 'isEditable': True,
+ 'label': 'uncertainty_info',
+ 'visible': True},
+ {'fieldName': 'other_info',
+ 'isEditable': True,
+ 'label': 'other_info',
+ 'visible': True},
+ {'fieldName': 'num_store',
+ 'isEditable': True,
+ 'label': 'num_store',
+ 'visible': True},
+ {'fieldName': 'store_list',
+ 'isEditable': True,
+ 'label': 'store_list',
+ 'visible': True},
+ {'fieldName': 'store_id_list',
+ 'isEditable': True,
+ 'label': 'store_id_list',
+ 'visible': True},
+ {'fieldName': 'num_flux',
+ 'isEditable': True,
+ 'label': 'num_flux',
+ 'visible': True},
+ {'fieldName': 'flux_list',
+ 'isEditable': True,
+ 'label': 'flux_list',
+ 'visible': True},
+ {'fieldName': 'flux_id_list',
+ 'isEditable': True,
+ 'label': 'flux_id_list',
+ 'visible': True},
+ {'fieldName': 'dummy_column',
+ 'isEditable': True,
+ 'label': 'dummy_column',
+ 'visible': True},
+ {'fieldName': 'huc_watershed_id',
+ 'isEditable': True,
+ 'label': 'huc_watershed_id',
+ 'visible': True},
+ {'fieldName': 'ObjectId', 'label': 'ObjectId', 'visible': True}],
+ 'title': 'alltype_models_v1'}}],
+ 'tables': []}
\ No newline at end of file
diff --git a/dashboard_backup/popupElements0818.json b/dashboard_backup/popupElements0818.json
new file mode 100644
index 0000000..4dc308b
--- /dev/null
+++ b/dashboard_backup/popupElements0818.json
@@ -0,0 +1,355 @@
+{
+ "authoringApp": "ArcGISMapViewer",
+ "authoringAppVersion": "10.2",
+ "baseMap": {
+ "baseMapLayers": [
+ {
+ "id": "182b08934d6-layer-1",
+ "layerType": "ArcGISTiledMapServiceLayer",
+ "title": "World Topo Map",
+ "url": "https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"
+ }
+ ],
+ "title": "Topographic"
+ },
+ "initialState": {
+ "viewpoint": {
+ "scale": 147914381.897889,
+ "targetGeometry": {
+ "spatialReference": {
+ "latestWkid": 3857,
+ "wkid": 102100
+ },
+ "xmax": 27173695.829877917,
+ "xmin": -30042783.070806216,
+ "ymax": 18196306.66930943,
+ "ymin": -16125753.51940465
+ }
+ }
+ },
+ "operationalLayers": [
+ {
+ "id": "154972172183",
+ "itemId": "b5ea6023470c488bbe6b3255183a3a22",
+ "layerDefinition": {
+ "definitionExpression": null,
+ "drawingInfo": {
+ "renderer": {
+ "symbol": {
+ "angle": 0,
+ "contentType": "image/png",
+ "height": 15,
+ "imageData": "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQBQYWludC5ORVQgdjMuNS4xTuc4+QAAB3VJREFUeF7tmPlTlEcexnve94U5mANQbgQSbgiHXHINlxpRIBpRI6wHorLERUmIisKCQWM8cqigESVQS1Kx1piNi4mW2YpbcZONrilE140RCTcy3DDAcL/zbJP8CYPDL+9Ufau7uqb7eZ7P+/a8PS8hwkcgIBAQCAgEBAICAYGAQEAgIBAQCAgEBAICAYGAQEAgIBAQCDx/AoowKXFMUhD3lQrioZaQRVRS+fxl51eBTZUTdZ41U1Rox13/0JF9csGJ05Qv4jSz/YPWohtvLmSKN5iTGGqTm1+rc6weICOBRbZs1UVnrv87T1PUeovxyNsUP9P6n5cpHtCxu24cbrmwKLdj+osWiqrVKhI0xzbmZ7m1SpJ+1pFpvE2DPvGTomOxAoNLLKGLscZYvB10cbYYjrJCb7A5mrxleOBqim+cWJRakZY0JfnD/LieI9V1MrKtwokbrAtU4Vm0A3TJnphJD4B+RxD0u0LA7w7FTE4oprOCMbklEGNrfdGf4IqnQTb4wc0MFTYibZqM7JgjO8ZdJkpMln/sKu16pHZGb7IfptIWg389DPp9kcChWODoMuDdBOhL1Jgpisb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OBH2b3ekVjYT2WCRG3o+mIGKgO0OrlIaebU/HYOQDNbQnojB4NJyGD0NPfjA0bwTRE6Q7hsUcWhkWN8yZqSQlWWGECAZLmJfJmbrvVSI8taK37xpbdB/wQW8xPee/8xIGjvlj8IQ/hk4G0JbWcX8MHPVDX4kveoq8ocn3xLM33NCZRcPHOGJYZIKfpQyq7JjHS6yJjcHujLHADgkpuC7h8F8zEVqXSNC2awE69lqhs8AamkO26HrbDt2H7dBVQov2NcW26CiwQtu+BWjdY4n2nZboTbfCmKcCnRyDO/YmyLPnDlHvjDH8G6zhS9/wlEnYR7X00fWrFYuWdVI0ZpuhcbcczW/R2qdAcz6t/bRov4mONeaaoYl+p22rHF0bVNAmKtBvweIXGxNcfFH8eNlC4m6wMWMusEnKpn5hyo48pj9gLe4SNG9QoGGLAk8z5XiaJUd99u8122/IpBA2K9BGg2vWWKAvRYVeLzEa7E1R422m2+MsSTem97nSYnfKyN6/mzATv7AUgqcMrUnmaFlLX3ysM0fj+t/b5lQLtK22QEfyAmiSLKFZpUJ7kBRPXKW4HqCYynWVHKSG2LkyZex1uO1mZM9lKem9Tx9jjY5iNEYo0bKMhn7ZAu0r6H5PpLXCAq0rKJClSjSGynE/QIkrQYqBPe6S2X+AJsY2Ped6iWZk6RlL0c2r5szofRsO9R5S1IfQLRCpQL1aifoYFerpsbkuTImaUJXuXIDiH6/Ys8vm3Mg8L2i20YqsO7fItKLcSXyn0kXccclVqv3MS6at9JU/Ox+ouns+SF6Z4cSupz7l8+z1ucs7LF1AQjOdxfGZzmx8Iu1TRcfnrioICAQEAgIBgYBAQCAgEBAICAQEAgIBgYBAQCAgEBAICAQEAv8H44b/6ZiGvGAAAAAASUVORK5CYII=",
+ "type": "esriPMS",
+ "url": "https://www.arcgis.com/apps/mapviewer/RedSphere.png",
+ "width": 15,
+ "xoffset": 0,
+ "yoffset": 0
+ },
+ "type": "simple"
+ }
+ }
+ },
+ "layerType": "ArcGISFeatureLayer",
+ "opacity": 1,
+ "popupInfo": {
+ "description": "A perceptual model of {watershed_name}
",
+ "fieldInfos": [
+ {
+ "fieldName": "id",
+ "isEditable": true,
+ "label": "Model ID",
+ "visible": false
+ },
+ {
+ "fieldName": "citation",
+ "isEditable": true,
+ "label": "Citation",
+ "visible": false
+ },
+ {
+ "fieldName": "url",
+ "isEditable": true,
+ "label": "URL",
+ "visible": false
+ },
+ {
+ "fieldName": "figure_num",
+ "isEditable": true,
+ "label": "Figure# in the citation",
+ "visible": false
+ },
+ {
+ "fieldName": "watershed_name",
+ "isEditable": true,
+ "label": "Watershed name",
+ "visible": false
+ },
+ {
+ "fieldName": "lat",
+ "isEditable": true,
+ "label": "latitude",
+ "visible": false
+ },
+ {
+ "fieldName": "lon",
+ "isEditable": true,
+ "label": "longitude",
+ "visible": false
+ },
+ {
+ "fieldName": "num_spatial_zones",
+ "isEditable": true,
+ "label": "Number of spatial zones",
+ "visible": true
+ },
+ {
+ "fieldName": "spatial_property",
+ "isEditable": true,
+ "label": "Spatial property",
+ "visible": true
+ },
+ {
+ "fieldName": "num_temporal_zones",
+ "isEditable": true,
+ "label": "Number of temporal zones",
+ "visible": true
+ },
+ {
+ "fieldName": "temporal_property",
+ "isEditable": true,
+ "label": "Temporal property",
+ "visible": true
+ },
+ {
+ "fieldName": "vegetation_info",
+ "isEditable": true,
+ "label": "Vegetation",
+ "visible": true
+ },
+ {
+ "fieldName": "soil_info",
+ "isEditable": true,
+ "label": "Soil",
+ "visible": true
+ },
+ {
+ "fieldName": "geol_info",
+ "isEditable": true,
+ "label": "Geology",
+ "visible": true
+ },
+ {
+ "fieldName": "topo_info",
+ "isEditable": true,
+ "label": "Topography",
+ "visible": true
+ },
+ {
+ "fieldName": "three_d_info",
+ "isEditable": true,
+ "label": "3-dimensional description",
+ "visible": true
+ },
+ {
+ "fieldName": "uncertainty_info",
+ "isEditable": true,
+ "label": "Uncertainty range",
+ "visible": true
+ },
+ {
+ "fieldName": "other_info",
+ "isEditable": true,
+ "label": "Information: other",
+ "visible": false
+ },
+ {
+ "fieldName": "num_flux",
+ "isEditable": true,
+ "label": "Number of fluxes",
+ "visible": true
+ },
+ {
+ "fieldName": "flux_list",
+ "isEditable": true,
+ "label": "List of fluxes",
+ "visible": true
+ },
+ {
+ "fieldName": "flux_id_list",
+ "isEditable": true,
+ "label": "Hashtags of fluxes",
+ "visible": true
+ },
+ {
+ "fieldName": "num_store",
+ "isEditable": true,
+ "label": "Number of stores",
+ "visible": true
+ },
+ {
+ "fieldName": "store_list",
+ "isEditable": true,
+ "label": "List of stores",
+ "visible": true
+ },
+ {
+ "fieldName": "store_id_list",
+ "isEditable": true,
+ "label": "Hashtags of stores",
+ "visible": true
+ },
+ {
+ "fieldName": "ObjectId",
+ "label": "ObjectID",
+ "visible": false
+ }
+ ],
+ "popupElements": [
+ {
+ "text": "A perceptual model of {watershed_name}
",
+ "type": "text"
+ },
+ {
+ "text": "Process information in the model
",
+ "type": "text"
+ },
+ {
+ "description": "",
+ "fieldInfos": [
+ {
+ "fieldName": "num_store",
+ "isEditable": true,
+ "label": "Number of stores",
+ "visible": true
+ },
+ {
+ "fieldName": "store_list",
+ "isEditable": true,
+ "label": "List of stores",
+ "visible": true
+ },
+ {
+ "fieldName": "store_id_list",
+ "isEditable": true,
+ "label": "Hashtags of stores",
+ "visible": true
+ },
+ {
+ "fieldName": "num_flux",
+ "isEditable": true,
+ "label": "Number of fluxes",
+ "visible": true
+ },
+ {
+ "fieldName": "flux_list",
+ "isEditable": true,
+ "label": "List of fluxes",
+ "visible": true
+ },
+ {
+ "fieldName": "flux_id_list",
+ "isEditable": true,
+ "label": "Hashtags of fluxes",
+ "visible": true
+ }
+ ],
+ "title": "",
+ "type": "fields"
+ },
+ {
+ "text": "Spatio-temporal heterogeneity in the model
",
+ "type": "text"
+ },
+ {
+ "description": "",
+ "fieldInfos": [
+ {
+ "fieldName": "num_spatial_zones",
+ "isEditable": true,
+ "label": "Number of spatial zones",
+ "visible": true
+ },
+ {
+ "fieldName": "spatial_property",
+ "isEditable": true,
+ "label": "Spatial property",
+ "visible": true
+ },
+ {
+ "fieldName": "num_temporal_zones",
+ "isEditable": true,
+ "label": "Number of temporal zones",
+ "visible": true
+ },
+ {
+ "fieldName": "temporal_property",
+ "isEditable": true,
+ "label": "Temporal property",
+ "visible": true
+ }
+ ],
+ "title": "",
+ "type": "fields"
+ },
+ {
+ "text": "Ancillary information in the model
",
+ "type": "text"
+ },
+ {
+ "description": "",
+ "fieldInfos": [
+ {
+ "fieldName": "vegetation_info",
+ "isEditable": true,
+ "label": "Vegetation",
+ "visible": true
+ },
+ {
+ "fieldName": "soil_info",
+ "isEditable": true,
+ "label": "Soil",
+ "visible": true
+ },
+ {
+ "fieldName": "geol_info",
+ "isEditable": true,
+ "label": "Geology",
+ "visible": true
+ },
+ {
+ "fieldName": "topo_info",
+ "isEditable": true,
+ "label": "Topography",
+ "visible": true
+ },
+ {
+ "fieldName": "uncertainty_info",
+ "isEditable": true,
+ "label": "Uncertainty range",
+ "visible": true
+ },
+ {
+ "fieldName": "three_d_info",
+ "isEditable": true,
+ "label": "3-dimensional description",
+ "visible": true
+ }
+ ],
+ "title": "",
+ "type": "fields"
+ }
+ ],
+ "title": "figure_models"
+ },
+ "title": "figure_models",
+ "url": "https://services1.arcgis.com/SIYkiqjmENweC50g/arcgis/rest/services/figure_models/FeatureServer/0",
+ "visibility": true
+ }
+ ],
+ "spatialReference": {
+ "latestWkid": 3857,
+ "wkid": 102100
+ },
+ "version": "2.25"
+}
\ No newline at end of file
diff --git a/dashboard_backup/symbolinfo.json b/dashboard_backup/symbolinfo.json
new file mode 100644
index 0000000..8a2bd17
--- /dev/null
+++ b/dashboard_backup/symbolinfo.json
@@ -0,0 +1,11 @@
+{
+ "angle": 0,
+ "contentType": "image/png",
+ "height": 15,
+ "imageData": "iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFk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MzGe+JBldepF2gdqo1J9pCpLqWOee6XL9Wa1+RcQbtqjxFpL1j8pMaJeL/eFEZkx9t1mmPdmm/1s8e8tnrYZprwbM82kN2tUTDEAjahnDwlQiqRI7jeM7j/HZNvck0DuezSa8Dkhnn+eg6n308pL/0+zU2yx6kV1scvsPkuEj/Kl/hcIGOtMKVBC69UG5JpusnwZ7EQsKpIj07TRpGwDbarNM+1+F6Fz+7GpIfv7MXBH4RobRG7Pkczk8CvfjXC04Dm83/AZ9peMb+hNWWAAAAAElFTkSuQmCC",
+ "type": "esriPMS",
+ "url": "https://static.arcgis.com/images/Symbols/Government/Water-Teatment-Plant-Permit.png",
+ "width": 15,
+ "xoffset": 0,
+ "yoffset": 0
+ },
\ No newline at end of file
diff --git a/src/0-debug_excelsheets.ipynb b/src/0-debug_excelsheets.ipynb
new file mode 100644
index 0000000..7e0f5e3
--- /dev/null
+++ b/src/0-debug_excelsheets.ipynb
@@ -0,0 +1,559 @@
+{
+ "cells": [
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Scripts to check the datasheet mis-entries"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import os\n",
+ "import pandas as pd\n",
+ "import numpy as np"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Configuration"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "data_dir = f\"G:\\Shared drives\\Perceptual model review\\ForRyoko\\data\"\n",
+ "model_type = \"Figure\" # Model type to check: Text or Figure"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "df_loc = pd.read_excel(os.path.join(data_dir, 'Location_formatted.xlsx')) # The lat/lon should be pre-formatted in decimal units\n",
+ "df_model = pd.read_excel(os.path.join(data_dir, f'ModelAnalysis_{model_type}.xlsx'))\n",
+ "df_taxonomy = pd.read_excel(os.path.join(data_dir, 'ProcessHierarchyNetwork.xlsx'))\n",
+ "df_FunctionType = pd.read_excel(os.path.join(data_dir, 'FunctionType.xlsx'))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Read Data"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "## Parse dataframe into table\n",
+ "\n",
+ "# Location table\n",
+ "# Sanity check if data can be joined\n",
+ "# df.set_index('key').join(other.set_index('key'))\n",
+ "df_loc[\"id\"] = df_loc.index + 1\n",
+ "df_loc = df_loc.drop(columns='Unnamed: 0')\n",
+ "df_loc[\"huc_watershed_id\"] = np.nan\n",
+ "\n",
+ "# FunctionType table\n",
+ "df_FunctionType[\"id\"] = df_FunctionType.index + 1\n",
+ "\n",
+ "# Citation table\n",
+ "df_model[\"attribution_url\"].fillna(df_model[\"url\"], inplace=True)\n",
+ "df_citation = df_model[[\"citation\", \"url\"]].copy()\n",
+ "df_citation[\"attribution\"] = df_model[\"attribution\"].copy()\n",
+ "df_citation[\"attribution_url\"] = df_model[\"attribution_url\"].copy()\n",
+ "df_citation[\"id\"] = df_citation.index + 1\n",
+ "\n",
+ "# Spatial and temporal zone tables\n",
+ "df_spatialZoneType = df_model[\"spatial_property\"].copy().drop_duplicates()\n",
+ "df_spatialZoneType = df_spatialZoneType.to_frame()\n",
+ "df_spatialZoneType.reset_index(inplace=True)\n",
+ "df_spatialZoneType = df_spatialZoneType.drop(columns='index')\n",
+ "df_spatialZoneType['id'] = df_spatialZoneType.index + 1\n",
+ "df_temporalZoneType = df_model[\"temporal_property\"].copy().drop_duplicates()\n",
+ "df_temporalZoneType = df_temporalZoneType.to_frame()\n",
+ "df_temporalZoneType.reset_index(inplace=True)\n",
+ "df_temporalZoneType = df_temporalZoneType.drop(columns='index')\n",
+ "df_temporalZoneType['id'] = df_temporalZoneType.index + 1\n",
+ "\n",
+ "# Alternative name table\n",
+ "df_altNames0 = df_taxonomy.set_index(['process', 'function', 'identifier', 'process_level']).apply(\n",
+ " lambda x: x.str.split(',').explode()).reset_index()\n",
+ "df_altNames = df_altNames0[['alternative_names', 'process']].copy()\n",
+ "df_altNames['alternative_names'] = df_altNames['alternative_names'].str.strip()\n",
+ "df_altNames['alternative_names'] = df_altNames['alternative_names'].str.capitalize()\n",
+ "df_altNames.dropna(axis=0, inplace=True)\n",
+ "df_altNames[\"id\"] = df_altNames.index + 1\n",
+ "\n",
+ "# Model table\n",
+ "df_model[\"id\"] = df_model.index + 1\n",
+ "df_modelmain = df_model[['id', 'citation', 'watershed_name',\n",
+ " 'spatial_property', 'num_spatial_zones', 'temporal_property',\n",
+ " 'num_temporal_zones', 'vegetation_info', 'soil_info', 'geol_info',\n",
+ " 'topo_info', 'three_d_info', 'uncertainty_info', 'other_info'\n",
+ " ]].copy()\n",
+ "\n",
+ "# LinkProcessPerceptual table\n",
+ "# Get all the process original text and taxonomy name from model\n",
+ "frames = [df_model[['id', 'flux1', 'flux1_taxonomy']].copy().rename(\n",
+ " columns={\"id\": \"entry_id\", \"flux1\": \"original_text\", \"flux1_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux2', 'flux2_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux2\": \"original_text\", \"flux2_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux3', 'flux3_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux3\": \"original_text\", \"flux3_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux4', 'flux4_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux4\": \"original_text\", \"flux4_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux5', 'flux5_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux5\": \"original_text\", \"flux5_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux6', 'flux6_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux6\": \"original_text\", \"flux6_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux7', 'flux7_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux7\": \"original_text\", \"flux7_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux8', 'flux8_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux8\": \"original_text\", \"flux8_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux9', 'flux9_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux9\": \"original_text\", \"flux9_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux10', 'flux10_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux10\": \"original_text\", \"flux10_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux11', 'flux11_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux11\": \"original_text\", \"flux11_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux12', 'flux12_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux12\": \"original_text\", \"flux12_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux13', 'flux13_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux13\": \"original_text\", \"flux13_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux14', 'flux14_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux14\": \"original_text\", \"flux14_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'store1', 'store1_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"store1\": \"original_text\", \"store1_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'store2', 'store2_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"store2\": \"original_text\", \"store2_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'store3', 'store3_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"store3\": \"original_text\", \"store3_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'store4', 'store4_taxonomy']].copy().rename( columns={\"id\": \"entry_id\", \"store4\": \"original_text\", \"store4_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'store5', 'store5_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"store5\": \"original_text\", \"store5_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'store6', 'store6_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"store6\": \"original_text\", \"store6_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'store7', 'store7_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"store7\": \"original_text\", \"store7_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'store8', 'store8_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"store8\": \"original_text\", \"store8_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'store9', 'store9_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"store9\": \"original_text\", \"store9_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'store10', 'store10_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"store10\": \"original_text\", \"store10_taxonomy\": \"process\"})\n",
+ " ]\n",
+ "\n",
+ "df_linkProcessPerceptual0 = pd.concat(frames, axis=0, ignore_index=True)\n",
+ "df_linkProcessPerceptual0[\"id\"] = df_linkProcessPerceptual0.index + 1\n",
+ "\n",
+ "# Create taxonomy table\n",
+ "df_process0 = df_taxonomy.drop(columns='alternative_names')"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Check process taxonomy - flux and store names"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " entry_id | \n",
+ " original_text | \n",
+ " process_x | \n",
+ " id | \n",
+ " process_lower | \n",
+ " process_y | \n",
+ " function | \n",
+ " identifier | \n",
+ " process_level | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ "Empty DataFrame\n",
+ "Columns: [entry_id, original_text, process_x, id, process_lower, process_y, function, identifier, process_level]\n",
+ "Index: []"
+ ]
+ },
+ "execution_count": 23,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "\n",
+ "# join process taxonomy and model table\n",
+ "df_linkProcessPerceptual0[\"process_lower\"] = df_linkProcessPerceptual0['process'].str.lower()\n",
+ "df_linkProcessPerceptual0[\"process_lower\"] = df_linkProcessPerceptual0['process_lower'].str.strip()\n",
+ "df_process0[\"process_lower\"] = df_process0['process'].str.lower()\n",
+ "df_process0[\"process_lower\"] = df_process0['process_lower'].str.strip()\n",
+ "\n",
+ "# find and add some new process from model table to taxonomy table (# Check here if you want to check process miscategorization)\n",
+ "df_linkProcessPerceptual1 = df_linkProcessPerceptual0.merge(df_process0, on='process_lower', how='left')\n",
+ "new_process = df_linkProcessPerceptual1.loc[(df_linkProcessPerceptual1['process_x'].isnull() == False) & (\n",
+ " df_linkProcessPerceptual1['process_y'].isnull() == True)]\n",
+ "new_process.drop_duplicates(subset='process_lower', inplace=True)\n",
+ "# new_process.to_excel(r'..\\data\\text_models_workspace\\newprocess_v2.xlsx')\n",
+ "\n",
+ "new_process\n",
+ "\n",
+ "# Returns empty dataframe if everything matches \n",
+ "# If not, check back the datasheet"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Check match with location database"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " id_x | \n",
+ " citation | \n",
+ " watershed_name | \n",
+ " name | \n",
+ " lat | \n",
+ " lon | \n",
+ " area_km2 | \n",
+ " id_y | \n",
+ " huc_watershed_id | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ "Empty DataFrame\n",
+ "Columns: [id_x, citation, watershed_name, name, lat, lon, area_km2, id_y, huc_watershed_id]\n",
+ "Index: []"
+ ]
+ },
+ "execution_count": 24,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# join location and model table\n",
+ "df_linkLocation = pd.merge(df_model[['id', 'citation', 'watershed_name']], df_loc, left_on='watershed_name', right_on='name', how='left')\n",
+ "df_linkLocation.loc[(df_linkLocation['watershed_name'].isnull()) | (df_linkLocation['name'].isnull())]\n",
+ "\n",
+ "# Returns empty dataframe if everything matches \n",
+ "# If not, check back the datasheet"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Properties"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array(['N', 'Cropland described', 'Vegetation described',\n",
+ " 'Forest described', 'Seasonal change discussed',\n",
+ " 'Vegetation icons', 'Vegetation types described'], dtype=object)"
+ ]
+ },
+ "execution_count": 25,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df_model['vegetation_info'].unique()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array(['N', 'Horizons described', 'Soil types described'], dtype=object)"
+ ]
+ },
+ "execution_count": 26,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df_model['soil_info'].unique()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array(['N', 'Geology described', 'Glacier described', 'Bedrock described'],\n",
+ " dtype=object)"
+ ]
+ },
+ "execution_count": 27,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df_model['geol_info'].unique()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array(['Slopes described', 'N', 'Topography described', 'Scale bar shown'],\n",
+ " dtype=object)"
+ ]
+ },
+ "execution_count": 28,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df_model['topo_info'].unique()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array(['N', 'Unknown items identified', 'Uncertainty described'],\n",
+ " dtype=object)"
+ ]
+ },
+ "execution_count": 29,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df_model['uncertainty_info'].unique()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array(['Soil properties (surface sealing, cracking)',\n",
+ " 'This is a longitudinal profile, average transit time given, scale given',\n",
+ " 'Riparian area only',\n",
+ " 'Show cross-section of water table slopes/depths for wet and dry seasons',\n",
+ " 'Reaction fronts shown', nan,\n",
+ " 'Joints/faults show, approximate scale given in caption',\n",
+ " 'Soil clay content in caption, % streamflow contribution in legend, open boundary noted, extra notes shown on figures',\n",
+ " 'The sources (=stores) and flow paths are shown as separate pictures. The diffuse groundwater flows are shown as being from shallow and deep aquifers, but are described as being \"flows through the soil matrix and macropores\"',\n",
+ " 'Inconsistencies betweeen picture and legend, wiggly arrows meaning unknown, many unlabelled arrows',\n",
+ " 'Arrows show water table rise/fall; indicates which storages have variable storage',\n",
+ " 'Describes water sources as event water, shallow gw, deep gw',\n",
+ " 'Focused on karst systems',\n",
+ " 'Complex flow paths and changes in saturated zone shape/layers shown in diagrams, ',\n",
+ " 'Just shown as soil sections',\n",
+ " 'Focused on isotope enrichment processes',\n",
+ " 'Arrows show direction of groundwater e.g. towards zones of higher conductivity',\n",
+ " 'Pictures of suface rocks shown, unsure of significance',\n",
+ " 'Also shows translation into model structure',\n",
+ " 'Shows vertical scale, shows isolines of chloride for salinity',\n",
+ " 'Bedrock bedding planes shown',\n",
+ " 'Shows locations of new and old water',\n",
+ " 'Soil property (organic/mineral)',\n",
+ " '?Should precipitation, evaporation count as fluxes?',\n",
+ " 'Lots of information in text but very hard to match to unlabelled arrows in diagram',\n",
+ " 'Shading used to show saturation level of soil, location of infiltration/recharge under depression shown by location of arrows',\n",
+ " 'Shows different rainfall rates over time',\n",
+ " 'Water ages were shown from 3 weeks - 6 months',\n",
+ " 'Mostly focused on nitrates',\n",
+ " 'Depth of surface layer marked on hillslope and close to channel',\n",
+ " 'Also shows fluxes of DOC, TDS, and inorganic nitrogen',\n",
+ " 'Soil property (free-draining)',\n",
+ " 'Shows lateral and vertical scale, shows zones of different N-4 in soil',\n",
+ " 'Shows scale in vertical and horizontal, figure shows longitudinal profile',\n",
+ " 'Runoff components grouped as near surface runoff, shallow groundwater, deep groundwater',\n",
+ " 'Unusual - plan view where location of different dominant processes is mapped, scale shown',\n",
+ " 'Areas of slopes/wetlands given',\n",
+ " 'All stores are shown separately where they are dry or filled with water',\n",
+ " 'Caption describes the measurement types used to infer each process',\n",
+ " 'Shows speed of process by arrow length, shows which process knowledge gained by which catchment investigation/data type',\n",
+ " 'Also groups water bodies by their stable isotope composition',\n",
+ " 'Flux property: temporary/permanent; cross-sectional slope of water table shown; vegetation leaf on/off shown; flows shown as mediated by storage or soil structure',\n",
+ " 'Shows event/pre-event water fractions',\n",
+ " 'Shows bedrock fractures, shows thickness of sediment',\n",
+ " 'Bedding planes and fractures shown', 'N',\n",
+ " 'Size of arrows determines the importance of flowpaths',\n",
+ " 'Saturated hydraulic conductivity estimates shown',\n",
+ " 'Arrow width represents flow path importance', 'Sediment transfer',\n",
+ " 'Scale bar', 'Scale bar ', 'Salinity study'], dtype=object)"
+ ]
+ },
+ "execution_count": 30,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df_model['other_info'].unique()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array(['N', 'Hillslope position', 'Catchment spatial scale', 'Topography',\n",
+ " 'Aspects', 'Soil or Geology', 'Process', 'Land use / Land cover'],\n",
+ " dtype=object)"
+ ]
+ },
+ "execution_count": 31,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df_model['spatial_property'].unique()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array(['Season', 'N', 'Rainfall intensity', 'Season with snow', 'Wetness',\n",
+ " 'Event', 'Season and wetness', 'Interannual'], dtype=object)"
+ ]
+ },
+ "execution_count": 32,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df_model['temporal_property'].unique()"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "(TODO) Write code to check if Taxonomy is not empty"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "arcgis",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.9.0"
+ },
+ "orig_nbformat": 4,
+ "vscode": {
+ "interpreter": {
+ "hash": "3140ae756112501f18b23ec79a6bbbb54e715b030c96600dfefb60d12a8f240f"
+ }
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/src/1-build_database.ipynb b/src/1-build_database.ipynb
new file mode 100644
index 0000000..7338ee6
--- /dev/null
+++ b/src/1-build_database.ipynb
@@ -0,0 +1,1320 @@
+{
+ "cells": [
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Config variables"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 39,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Start creating public data. \n",
+ "The output file name will be 'giantTable_public.csv'\n"
+ ]
+ }
+ ],
+ "source": [
+ "############# CHANGE HERE FOR YOUR PURPOSE ####################\n",
+ "# mode = \"private data\"\n",
+ "mode = \"public data\" # Select from \"private data\" or \"public data\"\n",
+ "data_dir = f\"G:\\Shared drives\\Perceptual model review\\ForRyoko\\data\"\n",
+ "####################################################################\n",
+ "\n",
+ "if mode ==\"private data\":\n",
+ " out_file_name = \"giantTable_private\"\n",
+ "elif mode ==\"public data\":\n",
+ " out_file_name = \"giantTable_public\"\n",
+ "print(f\"Start creating {mode}. \\nThe output file name will be '{out_file_name}.csv'\")"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Build database (Include all models: Figure, Text, and Hand-drawn)\n",
+ "This scripts can be \"Run All\" if you don't need to see step-by-step results"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 40,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import os\n",
+ "import numpy as np\n",
+ "import pandas as pd\n",
+ "import configparser\n",
+ "from sqlalchemy import create_engine\n",
+ "from sqlalchemy import text"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Read datasheets"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 41,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Total models: 396\n",
+ "Text models: 266\n",
+ "Figure models: 130\n"
+ ]
+ }
+ ],
+ "source": [
+ "df_loc = pd.read_excel(os.path.join(data_dir, 'Location_formatted.xlsx')) # The lat/lon should be pre-formatted in decimal units\n",
+ "# df_model = pd.read_csv('../data/ModelAnalysis.csv', encoding='utf-8')\n",
+ "df_model_fig = pd.read_excel(os.path.join(data_dir, 'ModelAnalysis_Figure.xlsx'))\n",
+ "df_model_text = pd.read_excel(os.path.join(data_dir, 'ModelAnalysis_Text.xlsx'))\n",
+ "df_taxonomy = pd.read_excel(os.path.join(data_dir, 'ProcessHierarchyNetwork.xlsx'))\n",
+ "df_FunctionType = pd.read_excel(os.path.join(data_dir, 'FunctionType.xlsx'))\n",
+ "df_model_type = pd.read_excel(os.path.join(data_dir, 'ModelType.xlsx'))\n",
+ "print(f\"Total models: {len(df_model_text)+len(df_model_fig)}\")\n",
+ "print(f\"Text models: {len(df_model_text)}\")\n",
+ "print(f\"Figure models: {len(df_model_fig)}\")\n"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Organize data sheets"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Format misc tables into dataframe"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 42,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Location table\n",
+ "# Sanity check if data can be joined\n",
+ "# df.set_index('key').join(other.set_index('key'))\n",
+ "df_loc[\"id\"] = df_loc.index + 1\n",
+ "df_loc = df_loc.drop(columns='Unnamed: 0')\n",
+ "df_loc[\"huc_watershed_id\"] = np.nan\n",
+ "\n",
+ "# FunctionType table\n",
+ "df_FunctionType[\"id\"] = df_FunctionType.index + 1\n",
+ "\n",
+ "# Model type tale\n",
+ "df_model_type[\"id\"] = df_model_type.index + 1\n",
+ "\n",
+ "# Alternative name table\n",
+ "df_altNames0 = df_taxonomy.set_index(['process', 'function', 'identifier', 'process_level']).apply(\n",
+ " lambda x: x.str.split(',').explode()).reset_index()\n",
+ "df_altNames = df_altNames0[['alternative_names', 'process']].copy()\n",
+ "df_altNames['alternative_names'] = df_altNames['alternative_names'].str.strip()\n",
+ "df_altNames['alternative_names'] = df_altNames['alternative_names'].str.capitalize()\n",
+ "df_altNames.dropna(axis=0, inplace=True)\n",
+ "df_altNames[\"id\"] = df_altNames.index + 1"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Fill nan data in \"figure_url\" with corgi picture"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 43,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# corgi_fig = \"https://i.ibb.co/stdkk6P/corgi-with-notes.png\"\n",
+ "corgi_fig = \"https://sdsugeo.maps.arcgis.com/sharing/rest/content/items/df499e37a2ef40d7885966952c627e01/data\"\n",
+ "df_model_fig['figure_url'] = df_model_fig['figure_url'].fillna(corgi_fig) # No attribution URL "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Public vs. private version"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 44,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "C:\\Users\\flipl\\AppData\\Local\\Temp\\ipykernel_11560\\4084942147.py:2: SettingWithCopyWarning: \n",
+ "A value is trying to be set on a copy of a slice from a DataFrame\n",
+ "\n",
+ "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
+ " df_model_fig['figure_url'][df_model_fig['attribution']==\"Not open-access\"] = corgi_fig # There is attribution but Not-open access\n",
+ "C:\\Users\\flipl\\AppData\\Local\\Temp\\ipykernel_11560\\4084942147.py:3: SettingWithCopyWarning: \n",
+ "A value is trying to be set on a copy of a slice from a DataFrame\n",
+ "\n",
+ "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
+ " df_model_text['textmodel_snipped'][df_model_text['attribution']==\"Not open-access\"] = \"Not open-access. See article for the Text Model.\"\n"
+ ]
+ }
+ ],
+ "source": [
+ "if mode == \"public data\":\n",
+ " df_model_fig['figure_url'][df_model_fig['attribution']==\"Not open-access\"] = corgi_fig # There is attribution but Not-open access\n",
+ " df_model_text['textmodel_snipped'][df_model_text['attribution']==\"Not open-access\"] = \"Not open-access. See article for the Text Model.\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Combine all dataframes"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 45,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "395\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Combine all model dataframes into one \"df_model\"\n",
+ "df_model_fig['model_type'] = 'Figure model'\n",
+ "df_model_text['model_type'] = 'Text model'\n",
+ "df_model = pd.concat([df_model_fig, df_model_text], join='outer', ignore_index=True)\n",
+ "df_model[\"id\"] = df_model.index + 1\n",
+ "\n",
+ "# Select columns that will be the main table in the database\n",
+ "df_modelmain = df_model[['id', 'citation', 'model_type', 'watershed_name',\n",
+ " 'figure_num', 'figure_url', 'figure_caption',\n",
+ " 'textmodel_snipped', 'textmodel_section_number', 'textmodel_page_number', 'textmodel_section_name', \n",
+ " 'spatial_property', 'num_spatial_zones', 'temporal_property', \n",
+ " 'num_temporal_zones', 'vegetation_info', 'soil_info', 'geol_info',\n",
+ " 'topo_info', 'three_d_info', 'uncertainty_info', 'other_info'\n",
+ " ]].copy()\n",
+ "\n",
+ "print(f'{len(df_modelmain)-1}')"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 46,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "df_modelmain['spatial_property'].fillna('N', inplace=True)\n",
+ "df_modelmain['temporal_property'].fillna('N', inplace=True)\n",
+ "df_modelmain['figure_url'].fillna('N/A', inplace=True)\n",
+ "df_modelmain['figure_caption'].fillna('N/A', inplace=True)\n",
+ "df_modelmain['textmodel_section_number'].fillna('N/A', inplace=True)\n",
+ "df_modelmain['textmodel_page_number'].fillna('N/A', inplace=True)\n",
+ "df_modelmain['textmodel_section_name'].fillna('N/A', inplace=True)\n",
+ "df_modelmain['vegetation_info'].fillna('N', inplace=True)\n",
+ "df_modelmain['soil_info'].fillna('N', inplace=True)\n",
+ "df_modelmain['geol_info'].fillna('N', inplace=True)\n",
+ "df_modelmain['topo_info'].fillna('N', inplace=True)\n",
+ "df_modelmain['three_d_info'].fillna('N', inplace=True)\n",
+ "df_modelmain['uncertainty_info'].fillna('N', inplace=True)\n",
+ "df_modelmain['other_info'].fillna('N', inplace=True)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Clean attribution"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 47,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Mapping between 'attribution' values and URLs\n",
+ "attributions_map = {\n",
+ " \"CC-BY-4.0\": \"https://creativecommons.org/licenses/by/4.0/\",\n",
+ " \"CC-BY 4.0\": \"https://creativecommons.org/licenses/by/4.0/\",\n",
+ " \"CC BY 4.0\": \"https://creativecommons.org/licenses/by/4.0/\",\n",
+ " \"CC-BY\": \"https://creativecommons.org/licenses/by/4.0/\",\n",
+ " \"CC-BY-3.0\": \"https://creativecommons.org/licenses/by/3.0/\",\n",
+ " \"CC-BY 3.0\": \"https://creativecommons.org/licenses/by/3.0/\",\n",
+ " \"CC BY 3.0\": \"https://creativecommons.org/licenses/by/3.0/\",\n",
+ " \"CC-BY-NC\": \"https://creativecommons.org/licenses/by-nc/4.0/\",\n",
+ " \"CC BY-NC\": \"https://creativecommons.org/licenses/by-nc/4.0/\",\n",
+ " \"CC BY NC\": \"https://creativecommons.org/licenses/by-nc/4.0/\",\n",
+ " \"CC-BY-NC-4.0\": \"https://creativecommons.org/licenses/by-nc/4.0/\",\n",
+ " \"CC BY-NC-4.0\": \"https://creativecommons.org/licenses/by-nc/4.0/\",\n",
+ " \"CC BY-NC 4.0\": \"https://creativecommons.org/licenses/by-nc/4.0/\",\n",
+ " \"CC-BY-NC 4.0\": \"https://creativecommons.org/licenses/by-nc/4.0/\",\n",
+ " \"CC BY NC 4.0\": \"https://creativecommons.org/licenses/by-nc/4.0/\",\n",
+ " \"CC-BY-NC-SA\": \"https://creativecommons.org/licenses/by-nc-sa/2.5/\",\n",
+ " \"CC BY-NC-SA\": \"https://creativecommons.org/licenses/by-nc-sa/2.5/\",\n",
+ " \"CC BY-NC-SA 2.5\": \"https://creativecommons.org/licenses/by-nc-sa/2.5/\",\n",
+ " \"CC-BY-NC-ND\": \"https://creativecommons.org/licenses/by-nc-nd/4.0/\",\n",
+ " \"CC BY-NC-ND\": \"https://creativecommons.org/licenses/by-nc-nd/4.0/\",\n",
+ " \"CC BY NC ND\": \"https://creativecommons.org/licenses/by-nc-nd/4.0/\"\n",
+ "}\n",
+ "\n",
+ "# Apply the mapping to update 'attribution_url' column\n",
+ "for attribution, url in attributions_map.items():\n",
+ " df_model.loc[df_model['attribution'] == attribution, \"attribution_url\"] = url"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Citation table"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 48,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "\n",
+ "df_model[\"attribution_url\"].fillna(df_model[\"url\"], inplace=True) # Fill the NaN in the attribution URL with paper URL (i.e., \"See paper for Not-open access ones\")\n",
+ "df_citation = df_model[[\"citation\", \"url\"]].copy()\n",
+ "df_citation[\"attribution\"] = df_model[\"attribution\"].copy()\n",
+ "df_citation[\"attribution_url\"] = df_model[\"attribution_url\"].copy()\n",
+ "df_citation[\"id\"] = df_citation.index + 1"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Spatial and temporal zone tables"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 49,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "df_spatialZoneType = df_model[\"spatial_property\"].copy().drop_duplicates()\n",
+ "df_spatialZoneType = df_spatialZoneType.to_frame()\n",
+ "df_spatialZoneType.reset_index(inplace=True)\n",
+ "df_spatialZoneType = df_spatialZoneType.drop(columns='index')\n",
+ "df_spatialZoneType['id'] = df_spatialZoneType.index + 1\n",
+ "\n",
+ "df_temporalZoneType = df_model[\"temporal_property\"].copy().drop_duplicates()\n",
+ "df_temporalZoneType = df_temporalZoneType.to_frame()\n",
+ "df_temporalZoneType.reset_index(inplace=True)\n",
+ "df_temporalZoneType = df_temporalZoneType.drop(columns='index')\n",
+ "df_temporalZoneType['id'] = df_temporalZoneType.index + 1"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## LinkProcessPerceptual table"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 50,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "\n",
+ "# Get all the process original text and taxonomy name from model\n",
+ "frames = [df_model[['id', 'flux1', 'flux1_taxonomy']].copy().rename(\n",
+ " columns={\"id\": \"entry_id\", \"flux1\": \"original_text\", \"flux1_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux2', 'flux2_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux2\": \"original_text\", \"flux2_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux3', 'flux3_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux3\": \"original_text\", \"flux3_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux4', 'flux4_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux4\": \"original_text\", \"flux4_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux5', 'flux5_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux5\": \"original_text\", \"flux5_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux6', 'flux6_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux6\": \"original_text\", \"flux6_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux7', 'flux7_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux7\": \"original_text\", \"flux7_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux8', 'flux8_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux8\": \"original_text\", \"flux8_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux9', 'flux9_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux9\": \"original_text\", \"flux9_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux10', 'flux10_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux10\": \"original_text\", \"flux10_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux11', 'flux11_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux11\": \"original_text\", \"flux11_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux12', 'flux12_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux12\": \"original_text\", \"flux12_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux13', 'flux13_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux13\": \"original_text\", \"flux13_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'flux14', 'flux14_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"flux14\": \"original_text\", \"flux14_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'store1', 'store1_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"store1\": \"original_text\", \"store1_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'store2', 'store2_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"store2\": \"original_text\", \"store2_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'store3', 'store3_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"store3\": \"original_text\", \"store3_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'store4', 'store4_taxonomy']].copy().rename( columns={\"id\": \"entry_id\", \"store4\": \"original_text\", \"store4_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'store5', 'store5_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"store5\": \"original_text\", \"store5_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'store6', 'store6_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"store6\": \"original_text\", \"store6_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'store7', 'store7_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"store7\": \"original_text\", \"store7_taxonomy\": \"process\"}),\n",
+ " df_model[['id', 'store8', 'store8_taxonomy']].copy().rename(columns={\"id\": \"entry_id\", \"store8\": \"original_text\", \"store8_taxonomy\": \"process\"}),\n",
+ " ]\n",
+ "\n",
+ "df_linkProcessPerceptual0 = pd.concat(frames, axis=0, ignore_index=True)\n",
+ "df_linkProcessPerceptual0[\"id\"] = df_linkProcessPerceptual0.index + 1\n",
+ "\n",
+ "# Create taxonomy table\n",
+ "df_process0 = df_taxonomy.drop(columns='alternative_names')\n",
+ "\n",
+ "# join process taxonomy and model table\n",
+ "df_linkProcessPerceptual0[\"process_lower\"] = df_linkProcessPerceptual0['process'].str.lower()\n",
+ "df_linkProcessPerceptual0[\"process_lower\"] = df_linkProcessPerceptual0['process_lower'].str.strip()\n",
+ "df_process0[\"process_lower\"] = df_process0['process'].str.lower()\n",
+ "df_process0[\"process_lower\"] = df_process0['process_lower'].str.strip()\n",
+ "\n",
+ "# find and add some new process from model table to taxonomy table (# Check here if you want to check process miscategorization)\n",
+ "df_linkProcessPerceptual1 = df_linkProcessPerceptual0.merge(df_process0, on='process_lower', how='left')\n",
+ "new_process = df_linkProcessPerceptual1.loc[(df_linkProcessPerceptual1['process_x'].isnull() == False) & (\n",
+ " df_linkProcessPerceptual1['process_y'].isnull() == True)]\n",
+ "new_process.drop_duplicates(subset='process_lower', inplace=True)\n",
+ "\n",
+ "add_new_process = pd.DataFrame(\n",
+ " {'process': new_process['process_x'], 'process_lower': new_process['process_x'].str.lower(),\n",
+ " 'identifier': ['NewProcess'] * len(new_process['process_x'])})\n",
+ "df_process1 = pd.concat([df_process0, add_new_process])\n",
+ "df_process1[\"id\"] = df_process1.reset_index().index + 1\n",
+ "\n",
+ "# re-join process taxonomy and model table with new process\n",
+ "df_linkProcessPerceptual2 = df_linkProcessPerceptual0.merge(df_process1, on='process_lower', how='left')\n",
+ "df_linkProcessPerceptual2.rename(columns={\"id_y\": \"process_id\"}, inplace=True)\n",
+ "df_linkProcessPerceptual = df_linkProcessPerceptual2.drop(\n",
+ " columns={'process_x', 'id_x', 'process_lower', 'process_y', 'function', 'identifier', 'process_level'})\n",
+ "df_linkProcessPerceptual.dropna(subset=['original_text'], axis=0, inplace=True)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 51,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "df_linkProcessPerceptual[\"id\"] = df_linkProcessPerceptual.reset_index().index + 1\n",
+ "df_linkProcessPerceptual[\"process_id\"] = df_linkProcessPerceptual[\"process_id\"].astype('int') \n",
+ "# If the above line returned an error, it's likely some entry is not finding matching taxonomy. Check the entry by running below\n",
+ "# df_linkProcessPerceptual[df_linkProcessPerceptual['process_id'].isnull()]\n",
+ "df_process = df_process1.drop(columns='process_lower')"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 52,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "395\n"
+ ]
+ }
+ ],
+ "source": [
+ "print(f'{len(df_modelmain)-1}')"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Connect to SQL database"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 53,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "connection to 'postgres'@'localhost' success!\n"
+ ]
+ },
+ {
+ "data": {
+ "text/plain": [
+ ""
+ ]
+ },
+ "execution_count": 53,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Read config\n",
+ "config = configparser.ConfigParser()\n",
+ "config.read('config.ini')\n",
+ "\n",
+ "DB_NAME = config['postgresql']['DB_NAME']\n",
+ "HOST = config['postgresql']['HOST']\n",
+ "PORT = config['postgresql']['PORT']\n",
+ "USER_NAME = config['postgresql']['USER_NAME']\n",
+ "PASSWD = config['postgresql']['PASSWD']\n",
+ "schema = 'perceptual_model'\n",
+ "\n",
+ "# Connect to database\n",
+ "conn_string = f'postgresql+psycopg2://{USER_NAME}:{PASSWD}@{HOST}:{PORT}/{DB_NAME}'\n",
+ "db = create_engine(conn_string, client_encoding='utf8')\n",
+ "try:\n",
+ " db_auto = db.execution_options(isolation_level=\"AUTOCOMMIT\")\n",
+ " # This is added from SQL alchemy v2.0\n",
+ " # You have to COMMIT to put the results into database, and this options allows it\n",
+ " # See https://docs.sqlalchemy.org/en/20/core/connections.html\n",
+ " conn = db_auto.connect()\n",
+ " print(\"connection to '%s'@'%s' success!\" % (DB_NAME, HOST))\n",
+ "except Exception as e:\n",
+ " print(\"connection to '%s'@'%s' failed.\" % (DB_NAME, HOST))\n",
+ " print(e)\n",
+ "\n",
+ "# Initial commands \n",
+ "conn.execute(text(\"set search_path to public, perceptual_model\"))\n",
+ "conn.execute(text(\"SET CLIENT_ENCODING TO 'UTF8';\"))\n",
+ "\n",
+ "# # View the records\n",
+ "# results = conn.execute(text(f\"SELECT * from {schema}.locations\"))\n",
+ "# for record in results:\n",
+ "# print(\"\\n\", record)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Create database"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 54,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Dropped old tables (perceptual_model.locations)\n",
+ "Dropped old tables (perceptual_model.citations)\n",
+ "Dropped old tables (perceptual_model.spatial_zone_type)\n",
+ "Dropped old tables (perceptual_model.temporal_zone_type)\n",
+ "Dropped old tables (perceptual_model.process_alt_names)\n",
+ "Dropped old tables (perceptual_model.function_type)\n",
+ "Dropped old tables (perceptual_model.perceptual_model)\n",
+ "Dropped old tables (perceptual_model.link_process_perceptual)\n",
+ "Dropped old tables (perceptual_model.process_taxonomy)\n",
+ "Dropped old tables (perceptual_model.model_type)\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Drop old tables\n",
+ "tables = ['locations', 'citations', 'spatial_zone_type', 'temporal_zone_type', 'process_alt_names',\n",
+ " 'function_type', 'perceptual_model', 'link_process_perceptual', 'process_taxonomy', 'model_type']\n",
+ "for table in tables:\n",
+ " try:\n",
+ " conn.execute(text(f\"DROP TABLE {schema}.{table} CASCADE;\"))\n",
+ " print(f'Dropped old tables ({schema}.{table})')\n",
+ " except Exception as e:\n",
+ " conn.rollback()\n",
+ " print(e)\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 55,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "3"
+ ]
+ },
+ "execution_count": 55,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "connarg = {'con': conn, 'schema': 'perceptual_model', 'if_exists': 'replace', 'index': False}\n",
+ "\n",
+ "# set table names in lower case https://github.com/pandas-dev/pandas/issues/13206\n",
+ "df_loc.to_sql('locations', **connarg)\n",
+ "df_citation.to_sql('citations', **connarg)\n",
+ "df_spatialZoneType.to_sql('spatial_zone_type', **connarg)\n",
+ "df_temporalZoneType.to_sql('temporal_zone_type', **connarg)\n",
+ "df_altNames.to_sql('process_alt_names', **connarg)\n",
+ "df_FunctionType.to_sql('function_type', **connarg)\n",
+ "df_modelmain.to_sql('perceptual_model', **connarg)\n",
+ "df_linkProcessPerceptual.to_sql('link_process_perceptual', **connarg)\n",
+ "df_process.to_sql('process_taxonomy', **connarg)\n",
+ "df_model_type.to_sql('model_type', **connarg)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 56,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "success\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Location lat lon --> geometry with PostGIS\n",
+ "query = \"ALTER TABLE perceptual_model.locations \\\n",
+ "ADD COLUMN pt geometry(point, 4326); \\\n",
+ "WITH pt_geom AS ( \\\n",
+ "\tSELECT id, ST_SetSRID(ST_MakePoint(lon, lat), 4326) AS pt \\\n",
+ "\tfrom perceptual_model.locations \\\n",
+ "\t) \\\n",
+ "UPDATE perceptual_model.locations \\\n",
+ "SET pt = pt_geom.pt \\\n",
+ "FROM pt_geom \\\n",
+ "WHERE pt_geom.id = locations.id; \\\n",
+ " \"\n",
+ "\n",
+ "try:\n",
+ " conn.execute(text(query))\n",
+ " print(\"success\")\n",
+ "except Exception as e:\n",
+ " print(e)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 57,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "successfully added primary keys to table locations\n",
+ "successfully added primary keys to table citations\n",
+ "successfully added primary keys to table spatial_zone_type\n",
+ "successfully added primary keys to table temporal_zone_type\n",
+ "successfully added primary keys to table process_alt_names\n",
+ "successfully added primary keys to table function_type\n",
+ "successfully added primary keys to table perceptual_model\n",
+ "successfully added primary keys to table link_process_perceptual\n",
+ "successfully added primary keys to table process_taxonomy\n",
+ "successfully added primary keys to table model_type\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Add primary keys\n",
+ "for table in tables:\n",
+ " try:\n",
+ " conn.execute(text(f\"ALTER TABLE {schema}.{table} ADD PRIMARY KEY (id);\"))\n",
+ " print(f\"successfully added primary keys to table {table}\")\n",
+ " except Exception as e:\n",
+ " print(e)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 58,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "success\n",
+ "success\n",
+ "success\n",
+ "success\n",
+ "success\n",
+ "success\n",
+ "success\n"
+ ]
+ }
+ ],
+ "source": [
+ "# add foreign keys\n",
+ "\n",
+ "# model & location\n",
+ "query = \"ALTER TABLE perceptual_model ADD COLUMN location_id int; \\\n",
+ "UPDATE perceptual_model \\\n",
+ "SET location_id = locations.id \\\n",
+ "FROM locations \\\n",
+ "WHERE perceptual_model.watershed_name = locations.name; \\\n",
+ "ALTER TABLE perceptual_model \\\n",
+ "ADD FOREIGN KEY (location_id) REFERENCES locations(id); \\\n",
+ "ALTER TABLE perceptual_model DROP COLUMN watershed_name;\"\n",
+ "\n",
+ "try:\n",
+ " conn.execute(text(query))\n",
+ " print(\"success\")\n",
+ "except Exception as e:\n",
+ " print(e)\n",
+ " \n",
+ "# model & citation\n",
+ "query = \"ALTER TABLE perceptual_model ADD COLUMN citation_id int; \\\n",
+ "UPDATE perceptual_model \\\n",
+ "SET citation_id = citations.id \\\n",
+ "FROM citations \\\n",
+ "WHERE perceptual_model.citation = citations.citation; \\\n",
+ "ALTER TABLE perceptual_model \\\n",
+ "ADD FOREIGN KEY (citation_id) REFERENCES citations(id); \\\n",
+ "ALTER TABLE perceptual_model DROP COLUMN citation;\"\n",
+ "\n",
+ "try:\n",
+ " conn.execute(text(query))\n",
+ " print(\"success\")\n",
+ "except Exception as e:\n",
+ " print(e)\n",
+ " \n",
+ "# model & spatial zone\n",
+ "query = \"ALTER TABLE perceptual_model ADD COLUMN spatialzone_id int; \\\n",
+ "UPDATE perceptual_model \\\n",
+ "SET spatialzone_id = spatial_zone_type.id \\\n",
+ "FROM spatial_zone_type \\\n",
+ "WHERE perceptual_model.spatial_property = spatial_zone_type.spatial_property; \\\n",
+ "ALTER TABLE perceptual_model \\\n",
+ "ADD FOREIGN KEY (spatialzone_id) REFERENCES spatial_zone_type(id); \\\n",
+ "ALTER TABLE perceptual_model DROP COLUMN spatial_property;\"\n",
+ "\n",
+ "try:\n",
+ " conn.execute(text(query))\n",
+ " print(\"success\")\n",
+ "except Exception as e:\n",
+ " print(e)\n",
+ " \n",
+ "\n",
+ "# model & temporal zone\n",
+ "query = \"ALTER TABLE perceptual_model ADD COLUMN temporalzone_id int; \\\n",
+ "UPDATE perceptual_model \\\n",
+ "SET temporalzone_id = temporal_zone_type.id \\\n",
+ "FROM temporal_zone_type \\\n",
+ "WHERE perceptual_model.temporal_property = temporal_zone_type.temporal_property; \\\n",
+ "ALTER TABLE perceptual_model \\\n",
+ "ADD FOREIGN KEY (temporalzone_id) REFERENCES temporal_zone_type(id); \\\n",
+ "ALTER TABLE perceptual_model DROP COLUMN temporal_property;\"\n",
+ "\n",
+ "try:\n",
+ " conn.execute(text(query))\n",
+ " print(\"success\")\n",
+ "except Exception as e:\n",
+ " print(e)\n",
+ "\n",
+ "\n",
+ "# model & linktable\n",
+ "query = \"ALTER TABLE link_process_perceptual \\\n",
+ "ADD FOREIGN KEY (entry_id) REFERENCES perceptual_model(id);\"\n",
+ "\n",
+ "try:\n",
+ " conn.execute(text(query))\n",
+ " print(\"success\")\n",
+ "except Exception as e:\n",
+ " print(e)\n",
+ "\n",
+ "\n",
+ "# process taxonomy & alternative names\n",
+ "query = \"ALTER TABLE process_alt_names ADD COLUMN process_id int; \\\n",
+ "UPDATE process_alt_names \\\n",
+ "SET process_id = process_taxonomy.id \\\n",
+ "FROM process_taxonomy \\\n",
+ "WHERE process_alt_names.process = process_taxonomy.process; \\\n",
+ "ALTER TABLE process_alt_names \\\n",
+ "ADD FOREIGN KEY (process_id) REFERENCES process_taxonomy(id); \\\n",
+ "ALTER TABLE process_alt_names DROP COLUMN process;\"\n",
+ "\n",
+ "try:\n",
+ " conn.execute(text(query))\n",
+ " print(\"success\")\n",
+ "except Exception as e:\n",
+ " print(e)\n",
+ " \n",
+ "\n",
+ "# process taxonomy & function type\n",
+ "query = \"ALTER TABLE process_taxonomy ADD COLUMN function_id int; \\\n",
+ "UPDATE process_taxonomy \\\n",
+ "SET function_id = function_type.id \\\n",
+ "FROM function_type \\\n",
+ "WHERE process_taxonomy.function = function_type.name; \\\n",
+ "ALTER TABLE process_taxonomy \\\n",
+ "ADD FOREIGN KEY (function_id) REFERENCES function_type(id); \\\n",
+ "ALTER TABLE process_taxonomy DROP COLUMN function;\"\n",
+ "\n",
+ "try:\n",
+ " conn.execute(text(query))\n",
+ " print(\"success\")\n",
+ "except Exception as e:\n",
+ " print(e)\n",
+ " \n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 59,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Link model type & perceptual model -- success\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# model & model type\n",
+ "query = \"ALTER TABLE perceptual_model ADD COLUMN model_type_id int; \\\n",
+ "UPDATE perceptual_model \\\n",
+ "SET model_type_id = model_type.id \\\n",
+ "FROM model_type \\\n",
+ "WHERE perceptual_model.model_type = model_type.name; \\\n",
+ "ALTER TABLE perceptual_model \\\n",
+ "ADD FOREIGN KEY (model_type_id) REFERENCES model_type(id); \\\n",
+ "ALTER TABLE perceptual_model DROP COLUMN model_type;\"\n",
+ "\n",
+ "try:\n",
+ " conn.execute(text(query))\n",
+ " print(\"Link model type & perceptual model -- success\")\n",
+ "except Exception as e:\n",
+ " print(e)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 60,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Link taxonomy & perceptual model -- success\n"
+ ]
+ }
+ ],
+ "source": [
+ "# try joining on pandas ...\n",
+ "query = \"ALTER TABLE link_process_perceptual \\\n",
+ "ADD FOREIGN KEY (process_id) REFERENCES process_taxonomy(id);\"\n",
+ "# \\\n",
+ "# ALTER TABLE link_process_perceptual DROP COLUMN process_name;\"\n",
+ "\n",
+ "try:\n",
+ " conn.execute(text(query))\n",
+ " print(\"Link taxonomy & perceptual model -- success\")\n",
+ "except Exception as e:\n",
+ " print(e)\n",
+ "\n"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Join tables and dump everything into csv file"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 61,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(psycopg2.errors.UndefinedTable) table \"giant_table\" does not exist\n",
+ "\n",
+ "[SQL: DROP TABLE giant_table;]\n",
+ "(Background on this error at: https://sqlalche.me/e/20/f405)\n"
+ ]
+ }
+ ],
+ "source": [
+ "try:\n",
+ " conn.execute(text('DROP TABLE giant_table;'))\n",
+ " print(\"success\")\n",
+ "except Exception as e:\n",
+ " print(e)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 62,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "396\n"
+ ]
+ }
+ ],
+ "source": [
+ "try:\n",
+ " result = conn.execute(text('SELECT COUNT(*) FROM perceptual_model;'))\n",
+ " print(result.fetchone()[0])\n",
+ "except Exception as e:\n",
+ " print(e)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 63,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Create base giant table -- success\n"
+ ]
+ }
+ ],
+ "source": [
+ "join_desired_tables = \"\\\n",
+ "CREATE TEMP TABLE giant_table AS (\\\n",
+ "SELECT perceptual_model.id, \\\n",
+ "\t\tmodel_type.name AS model_type, \\\n",
+ "\t\tcitations.citation, \\\n",
+ "\t\tcitations.url, \\\n",
+ " citations.attribution, \\\n",
+ " citations.attribution_url, \\\n",
+ "\t\tperceptual_model.figure_num, \\\n",
+ " perceptual_model.figure_caption, \\\n",
+ " perceptual_model.figure_url, \\\n",
+ "\t\tperceptual_model.textmodel_snipped, \\\n",
+ " perceptual_model.textmodel_section_number, \\\n",
+ " perceptual_model.textmodel_section_name, \\\n",
+ "\t\tperceptual_model.textmodel_page_number, \\\n",
+ " locations.name AS watershed_name, \\\n",
+ "\t\tlocations.lat, \\\n",
+ "\t\tlocations.lon, \\\n",
+ " locations.area_km2, \\\n",
+ "\t\tprocess_taxonomy.process, \\\n",
+ "\t\tprocess_taxonomy.identifier,\\\n",
+ "\t\tfunction_type.name AS function_name,\\\n",
+ "\t\tperceptual_model.num_spatial_zones,\\\n",
+ "\t\tspatial_zone_type.spatial_property,\\\n",
+ "\t\tperceptual_model.num_temporal_zones,\\\n",
+ "\t\ttemporal_zone_type.temporal_property,\\\n",
+ "\t\tperceptual_model.vegetation_info,\\\n",
+ "\t\tperceptual_model.soil_info,\\\n",
+ "\t\tperceptual_model.geol_info,\\\n",
+ "\t\tperceptual_model.topo_info,\\\n",
+ "\t\tperceptual_model.three_d_info,\\\n",
+ "\t\tperceptual_model.uncertainty_info,\\\n",
+ "\t\tperceptual_model.other_info\\\n",
+ "\tFROM perceptual_model \\\n",
+ "\tINNER JOIN citations \\\n",
+ "\t\tON citations.id = perceptual_model.citation_id \\\n",
+ "\tINNER JOIN locations \\\n",
+ "\t\tON locations.id = perceptual_model.location_id \\\n",
+ "\tINNER JOIN spatial_zone_type \\\n",
+ "\t\tON spatial_zone_type.id = perceptual_model.spatialzone_id \\\n",
+ "\tINNER JOIN temporal_zone_type \\\n",
+ "\t\tON temporal_zone_type.id = perceptual_model.temporalzone_id \\\n",
+ "\tINNER JOIN link_process_perceptual \\\n",
+ "\t\tON perceptual_model.id = link_process_perceptual.entry_id \\\n",
+ "\tINNER JOIN process_taxonomy \\\n",
+ "\t\tON link_process_perceptual.process_id = process_taxonomy.id \\\n",
+ "\tINNER JOIN function_type \\\n",
+ "\t\tON process_taxonomy.function_id = function_type.id \\\n",
+ "\tINNER JOIN model_type \\\n",
+ "\t\tON perceptual_model.model_type_id = model_type.id \\\n",
+ "ORDER BY perceptual_model.id \\\n",
+ ");\"\n",
+ "\n",
+ "try:\n",
+ " conn.execute(text(join_desired_tables))\n",
+ " print(\"Create base giant table -- success\")\n",
+ "except Exception as e:\n",
+ " print(e)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 64,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "396\n"
+ ]
+ }
+ ],
+ "source": [
+ "try:\n",
+ " result = conn.execute(text('SELECT COUNT(*) FROM perceptual_model;'))\n",
+ " print(result.fetchone()[0])\n",
+ "except Exception as e:\n",
+ " print(e)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Join tables and output results"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 65,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "output_dir = os.path.join(data_dir, \"for_arcgis_dashboard\")\n",
+ "if not os.path.exists(output_dir):\n",
+ " os.makedirs(output_dir)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 66,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Fetch results from giant tables -- success\n",
+ "Index(['id', 'figure_num', 'figure_url', 'figure_caption', 'textmodel_snipped',\n",
+ " 'textmodel_section_number', 'textmodel_page_number',\n",
+ " 'textmodel_section_name', 'num_spatial_zones', 'num_temporal_zones',\n",
+ " 'vegetation_info', 'soil_info', 'geol_info', 'topo_info',\n",
+ " 'three_d_info', 'uncertainty_info', 'other_info', 'location_id',\n",
+ " 'citation_id', 'spatialzone_id', 'temporalzone_id', 'model_type_id'],\n",
+ " dtype='object')\n"
+ ]
+ }
+ ],
+ "source": [
+ "query = \"SELECT * FROM perceptual_model\"\n",
+ "try:\n",
+ " df_results = pd.read_sql(text(query), conn)\n",
+ " # results = conn.execute(query).fetchall()\n",
+ " print(\"Fetch results from giant tables -- success\")\n",
+ " print(df_results.columns)\n",
+ "except Exception as e:\n",
+ " print(e)\n",
+ "df_results.to_csv(os.path.join(output_dir, 'giant_table_debug.csv'), sep=',', header=True, index=False, encoding='utf-8')"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 67,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Create giant model table with flux & stores -- success\n"
+ ]
+ }
+ ],
+ "source": [
+ "join_desired_tables2 = \"\\\n",
+ "CREATE TEMP TABLE giant_table_base AS ( \\\n",
+ "SELECT DISTINCT \\\n",
+ " id, \\\n",
+ "\tmodel_type,\\\n",
+ "\tcitation, \\\n",
+ "\turl, \\\n",
+ "\tattribution, \\\n",
+ "\tattribution_url, \\\n",
+ "\tfigure_num, \\\n",
+ "\tfigure_caption, \\\n",
+ "\tfigure_url, \\\n",
+ "\ttextmodel_snipped, \\\n",
+ "\ttextmodel_section_number, \\\n",
+ "\ttextmodel_section_name, \\\n",
+ "\ttextmodel_page_number, \\\n",
+ "\twatershed_name, \\\n",
+ "\tlat, \\\n",
+ "\tlon, \\\n",
+ "\tarea_km2, \\\n",
+ "\tnum_spatial_zones, \\\n",
+ "\tspatial_property, \\\n",
+ "\tnum_temporal_zones, \\\n",
+ "\ttemporal_property, \\\n",
+ "\tvegetation_info, \\\n",
+ "\tsoil_info, \\\n",
+ "\tgeol_info, \\\n",
+ "\ttopo_info, \\\n",
+ "\tthree_d_info, \\\n",
+ "\tuncertainty_info, \\\n",
+ "\tother_info \\\n",
+ "FROM giant_table \\\n",
+ "); \\\n",
+ "CREATE TEMP TABLE giant_table_flux AS ( \\\n",
+ "SELECT DISTINCT \\\n",
+ "id AS temp_id1, \\\n",
+ "COUNT(process) OVER(PARTITION BY id) AS num_flux, \\\n",
+ "STRING_AGG(process, ', ') OVER(PARTITION BY id) AS flux_list, \\\n",
+ "STRING_AGG(identifier, ', ') OVER(PARTITION BY id) AS flux_id_list \\\n",
+ "FROM giant_table \\\n",
+ "\tWHERE function_name ILIKE 'Filling of store' \\\n",
+ " OR function_name IS NULL\\\n",
+ "\tOR function_name ILIKE 'Release from store' \\\n",
+ "\tOR function_name ILIKE 'In-catchment flux' \\\n",
+ "\tOR function_name ILIKE 'In-store flux' \\\n",
+ "\tOR function_name ILIKE 'Release' \\\n",
+ "\t); \\\n",
+ "CREATE TEMP TABLE giant_table_store AS ( \\\n",
+ "SELECT DISTINCT id AS temp_id2, \\\n",
+ "COUNT(process) OVER(PARTITION BY id) AS num_store, \\\n",
+ "STRING_AGG(process, ', ') OVER(PARTITION BY id) AS store_list, \\\n",
+ "STRING_AGG(identifier, ', ') OVER(PARTITION BY id) AS store_id_list \\\n",
+ "FROM giant_table \\\n",
+ "\tWHERE function_name ILIKE 'Store' \\\n",
+ "\tOR function_name ILIKE 'Store, temporary' \\\n",
+ "\tOR function_name ILIKE 'Store characteristics, temporary' \\\n",
+ "\tOR function_name ILIKE 'Store characteristics, permanent' \\\n",
+ "\t); \\\n",
+ "CREATE TEMP TABLE giant_table_update AS ( \\\n",
+ "SELECT * FROM giant_table_base \\\n",
+ "LEFT JOIN giant_table_store \\\n",
+ "ON giant_table_base.id = giant_table_store.temp_id2 \\\n",
+ "LEFT JOIN giant_table_flux \\\n",
+ "ON giant_table_base.id = giant_table_flux.temp_id1 \\\n",
+ "ORDER BY id \\\n",
+ "\t); \\\n",
+ "ALTER TABLE giant_table_update \\\n",
+ "DROP COLUMN temp_id1, \\\n",
+ "DROP COLUMN temp_id2, \\\n",
+ "ADD COLUMN dummy_column NUMERIC DEFAULT 1; \\\n",
+ "\"\n",
+ "\n",
+ "try:\n",
+ " conn.execute(text(join_desired_tables2))\n",
+ " print(\"Create giant model table with flux & stores -- success\")\n",
+ "except Exception as e:\n",
+ " print(e)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 68,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "396\n"
+ ]
+ }
+ ],
+ "source": [
+ "try:\n",
+ " result = conn.execute(text('SELECT COUNT(*) FROM giant_table_base;'))\n",
+ " print(result.fetchone()[0])\n",
+ "except Exception as e:\n",
+ " print(e)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 69,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "'NoneType' object is not subscriptable\n"
+ ]
+ }
+ ],
+ "source": [
+ "try:\n",
+ " result = conn.execute(text('SELECT giant_table.id FROM giant_table LEFT OUTER JOIN giant_table_update ON giant_table.id = giant_table_update.id WHERE giant_table_update.id IS NULL;'))\n",
+ " print(result.fetchone()[0])\n",
+ "except Exception as e:\n",
+ " print(e)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 70,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Fetch results from giant tables -- success\n",
+ "Index(['id', 'model_type', 'citation', 'url', 'attribution', 'attribution_url',\n",
+ " 'figure_num', 'figure_caption', 'figure_url', 'textmodel_snipped',\n",
+ " 'textmodel_section_number', 'textmodel_section_name',\n",
+ " 'textmodel_page_number', 'watershed_name', 'lat', 'lon', 'area_km2',\n",
+ " 'num_spatial_zones', 'spatial_property', 'num_temporal_zones',\n",
+ " 'temporal_property', 'vegetation_info', 'soil_info', 'geol_info',\n",
+ " 'topo_info', 'three_d_info', 'uncertainty_info', 'other_info',\n",
+ " 'num_store', 'store_list', 'store_id_list', 'num_flux', 'flux_list',\n",
+ " 'flux_id_list', 'dummy_column'],\n",
+ " dtype='object')\n"
+ ]
+ }
+ ],
+ "source": [
+ "query = \"SELECT * FROM giant_table_update\"\n",
+ "try:\n",
+ " df_results = pd.read_sql(text(query), conn)\n",
+ " # results = conn.execute(query).fetchall()\n",
+ " print(\"Fetch results from giant tables -- success\")\n",
+ " print(df_results.columns)\n",
+ "except Exception as e:\n",
+ " print(e)\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 71,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "396\n"
+ ]
+ }
+ ],
+ "source": [
+ "try:\n",
+ " result = conn.execute(text('SELECT COUNT(*) FROM giant_table_update;'))\n",
+ " print(result.fetchone()[0])\n",
+ "except Exception as e:\n",
+ " print(e)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 72,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Some last housekeeping\n",
+ "df_results['huc_watershed_id'] = 'N/A'\n",
+ "df_results['num_store'].fillna(0, inplace=True)\n",
+ "df_results['num_flux'].fillna(0, inplace=True)\n",
+ "df_results['area_km2'].fillna(-9999, inplace=True)\n",
+ "df_results.fillna('N/A', inplace=True)\n",
+ "df_results.to_csv(os.path.join(output_dir, f'{out_file_name}.csv'), sep=',', header=True, index=False, encoding='utf-8')"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 73,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "396\n"
+ ]
+ }
+ ],
+ "source": [
+ "print(len(df_results))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 74,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Exported results to ../data/giantTable_public.csv:\n",
+ "2024-03-16 18:21:02.473221\n"
+ ]
+ }
+ ],
+ "source": [
+ "conn.close()\n",
+ "db.dispose()\n",
+ "print(fr'Exported results to ../data/{out_file_name}.csv:')\n",
+ "\n",
+ "import datetime\n",
+ "print(datetime.datetime.now())"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "arcgis",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.9.0"
+ },
+ "orig_nbformat": 4,
+ "vscode": {
+ "interpreter": {
+ "hash": "3140ae756112501f18b23ec79a6bbbb54e715b030c96600dfefb60d12a8f240f"
+ }
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/src/2-update_webmap.ipynb b/src/2-update_webmap.ipynb
new file mode 100644
index 0000000..7de1d87
--- /dev/null
+++ b/src/2-update_webmap.ipynb
@@ -0,0 +1,235 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "17ab89f6",
+ "metadata": {},
+ "source": [
+ "# Create ArcGIS webmap on perceptual-model database\n",
+ "\n",
+ "I referred to Jessica's instruction to create this notebook https://github.com/jlembury/GEOG594-Embury/blob/master/DEMO_ArcGIS_API_Python.ipynb"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6e793c21",
+ "metadata": {},
+ "source": [
+ "# Config"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "e7342024",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "data_dir = f\"G:\\Shared drives\\Perceptual model review\\ForRyoko\\data\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "4d8e4271",
+ "metadata": {},
+ "source": [
+ "## Import modules"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "id": "22ba798c-c407-427b-9f94-de4752a43cd2",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import os\n",
+ "import webbrowser\n",
+ "import pandas as pd\n",
+ "pd.options.mode.chained_assignment = None # default='warn'\n",
+ "import json\n",
+ "from arcgis.gis import GIS\n",
+ "from arcgis.features import FeatureLayerCollection"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "463eae66",
+ "metadata": {},
+ "source": [
+ "## Connect with ArcGIS\n",
+ "Reference for authentication schemes: https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "9f19dd88",
+ "metadata": {},
+ "source": [
+ "I ended up in using User autentification with OAuth 2.0 in Reference for authentication schemes: https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/\n",
+ "\n",
+ "Note: log-in expires after an hour or so.\n",
+ "When commands return \"Exception: A general error occurred: 'Response' object is not subscriptable\", log-in again. "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "id": "5328c70c",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "with open('./auth.json', 'r') as infile:\n",
+ " my_credentials = json.load(infile)\n",
+ "\n",
+ "gis = GIS(\"https://sdsugeo.maps.arcgis.com/\", client_id=my_credentials['client_id'])\n",
+ "print(\"Successfully logged in as: \" + gis.properties.user.username)\n",
+ "\n",
+ "# Clear the output for security \n",
+ "from IPython.display import clear_output\n",
+ "clear_output(wait=False)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "bfa15a0b",
+ "metadata": {},
+ "source": [
+ "open"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0108b7af",
+ "metadata": {},
+ "source": [
+ "If you have ArcGIS pro, this is the most straightforward and easy connection"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "ac4e04d5",
+ "metadata": {},
+ "source": [
+ "## Updating the existing webmap with additional data"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "id": "0aab2bae",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "def update_webmap(input_data, feature_layer_id, webmap_item_id):\n",
+ " try:\n",
+ " existing_item = gis.content.get(feature_layer_id)\n",
+ " print(existing_item)\n",
+ " except:\n",
+ " None\n",
+ " \n",
+ " try:\n",
+ " overwrite_layer = FeatureLayerCollection.fromitem(existing_item)\n",
+ " response = overwrite_layer.manager.overwrite(input_data)\n",
+ " print(f\"Update status: {response}\")\n",
+ " except:\n",
+ " None\n",
+ "\n",
+ " webbrowser.open('https://sdsugeo.maps.arcgis.com/apps/mapviewer/index.html?layers={}'.format(feature_layer_id), new=2)\n",
+ " webbrowser.open('https://sdsugeo.maps.arcgis.com/apps/mapviewer/index.html?webmap={}'.format(webmap_item_id), new=2)\n",
+ " "
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "f4c0a9d1",
+ "metadata": {},
+ "source": [
+ "### Public version"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "id": "a3e65aa2",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "- \n",
+ "Update status: {'success': True}\n"
+ ]
+ }
+ ],
+ "source": [
+ "update_webmap(\n",
+ " input_data=os.path.join(data_dir,\"giantTable_public.csv\"),\n",
+ " feature_layer_id = '91f146af61004ce799233fc30f52a783',\n",
+ " webmap_item_id = \"94bdbb06d8aa435598182f21c9ba067c\",\n",
+ " )"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b139031d",
+ "metadata": {},
+ "source": [
+ "## Private version"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "id": "65ef2b72",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "
- \n",
+ "Update status: {'success': True}\n"
+ ]
+ }
+ ],
+ "source": [
+ "update_webmap(\n",
+ " input_data=os.path.join(data_dir,\"giantTable_private.csv\"),\n",
+ " feature_layer_id = '0f495168b855499dbf628920f0d74da4',\n",
+ " webmap_item_id = \"e1377980633644b088cd55b7f1d102af\",\n",
+ " )"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "arcgis",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.9.0"
+ },
+ "vscode": {
+ "interpreter": {
+ "hash": "3140ae756112501f18b23ec79a6bbbb54e715b030c96600dfefb60d12a8f240f"
+ }
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/src/calc_stats.sql b/src/calc_stats.sql
new file mode 100644
index 0000000..4c9233d
--- /dev/null
+++ b/src/calc_stats.sql
@@ -0,0 +1,348 @@
+-- Calculate statistics from database
+
+-- Launch PostgreSQL
+-- "C:\Program Files\PostgreSQL\14\bin\psql.exe" -h localhost -U postgres -d postgres
+
+-- Preparation
+-- Set path in PostgreSQL. Specify the schema names (in this example, 'public' and 'perceptual_model')
+SET search_path TO public, perceptual_model;
+-- Set encoding
+SET CLIENT_ENCODING TO 'UTF8';
+
+-- Calculate key stats
+
+-- 1. Histograms (#spatial zones, temporal zones, fluxes, and stores)
+
+-- count the number of records
+SELECT COUNT(id)
+FROM perceptual_model;
+
+-- count by spatial zones
+SELECT id, num_spatial_zones
+FROM perceptual_model
+ORDER BY id;
+
+SELECT num_spatial_zones, COUNT(id)
+FROM perceptual_model
+GROUP BY num_spatial_zones
+ORDER BY num_spatial_zones;
+
+/*
+ num_spatial_zones | count
+-------------------+-------
+ 1 | 51
+ 2 | 7
+ 4 | 2
+ 6 | 2
+ 7 | 1
+*/
+
+-- count by temporal zones
+SELECT id, num_temporal_zones
+FROM perceptual_model
+ORDER BY id;
+
+SELECT num_temporal_zones, COUNT(id)
+FROM perceptual_model
+GROUP BY num_temporal_zones
+ORDER BY num_temporal_zones;
+
+/*
+ num_temporal_zones | count
+--------------------+-------
+ 1 | 35
+ 2 | 11
+ 3 | 8
+ 4 | 8
+ 5 | 1
+*/
+
+-- count by flux
+
+WITH flux_count AS
+(SELECT perceptual_model.id, COUNT(perceptual_model.id) AS num_flux_per_model
+ FROM perceptual_model
+ INNER JOIN link_process_perceptual
+ ON perceptual_model.id = link_process_perceptual.entry_id
+ INNER JOIN process_taxonomy
+ ON link_process_perceptual.process_id = process_taxonomy.id
+ INNER JOIN function_type
+ ON process_taxonomy.function_id = function_type.id
+ WHERE function_type.name ILIKE 'Filling of store'
+ OR function_type.name ILIKE 'Release from store'
+ OR function_type.name ILIKE 'In-catchment flux'
+ OR function_type.name ILIKE 'In-store flux'
+ OR function_type.name ILIKE 'Release'
+ GROUP BY perceptual_model.id)
+SELECT perceptual_model.id, flux_count.num_flux_per_model
+FROM flux_count
+RIGHT JOIN perceptual_model
+ON perceptual_model.id = flux_count.id
+ORDER BY perceptual_model.id;
+
+WITH flux_count AS
+(SELECT perceptual_model.id, COUNT(perceptual_model.id) AS num_flux_per_model
+ FROM perceptual_model
+ INNER JOIN link_process_perceptual
+ ON perceptual_model.id = link_process_perceptual.entry_id
+ INNER JOIN process_taxonomy
+ ON link_process_perceptual.process_id = process_taxonomy.id
+ INNER JOIN function_type
+ ON process_taxonomy.function_id = function_type.id
+ WHERE function_type.name ILIKE 'Filling of store'
+ OR function_type.name ILIKE 'Release from store'
+ OR function_type.name ILIKE 'In-catchment flux'
+ OR function_type.name ILIKE 'In-store flux'
+ OR function_type.name ILIKE 'Release'
+ GROUP BY perceptual_model.id)
+SELECT num_flux_per_model, COUNT(num_flux_per_model) AS num_models
+FROM flux_count
+GROUP BY num_flux_per_model
+ORDER BY num_flux_per_model;
+
+/*
+ num_flux_per_model | num_models
+--------------------+------------
+ 1 | 1
+ 2 | 5
+ 3 | 9
+ 4 | 17
+ 5 | 10
+ 6 | 7
+ 7 | 7
+ 8 | 4
+ 9 | 1
+*/
+
+
+-- count by stores
+WITH store_count AS
+(SELECT perceptual_model.id, COUNT(perceptual_model.id) AS num_store_per_model
+ FROM perceptual_model
+ INNER JOIN link_process_perceptual
+ ON perceptual_model.id = link_process_perceptual.entry_id
+ INNER JOIN process_taxonomy
+ ON link_process_perceptual.process_id = process_taxonomy.id
+ INNER JOIN function_type
+ ON process_taxonomy.function_id = function_type.id
+ WHERE function_type.name ILIKE 'Store'
+ OR function_type.name ILIKE 'Store, temporary'
+ OR function_type.name ILIKE 'Store characteristics, temporary'
+ OR function_type.name ILIKE 'Store characteristics, permanent'
+ GROUP BY perceptual_model.id)
+SELECT perceptual_model.id, store_count.num_store_per_model
+FROM store_count
+RIGHT JOIN perceptual_model
+ON perceptual_model.id = store_count.id
+ORDER BY perceptual_model.id;
+
+WITH store_count AS
+(SELECT perceptual_model.id, COUNT(perceptual_model.id) AS num_store_per_model
+ FROM perceptual_model
+ INNER JOIN link_process_perceptual
+ ON perceptual_model.id = link_process_perceptual.entry_id
+ INNER JOIN process_taxonomy
+ ON link_process_perceptual.process_id = process_taxonomy.id
+ INNER JOIN function_type
+ ON process_taxonomy.function_id = function_type.id
+ WHERE function_type.name ILIKE 'Store'
+ OR function_type.name ILIKE 'Store, temporary'
+ OR function_type.name ILIKE 'Store characteristics, temporary'
+ OR function_type.name ILIKE 'Store characteristics, permanent'
+ GROUP BY perceptual_model.id)
+SELECT num_store_per_model, COUNT(num_store_per_model) AS num_models
+FROM store_count
+GROUP BY num_store_per_model
+ORDER BY num_store_per_model;
+/*
+ num_store_per_model | num_models
+---------------------+------------
+ 1 | 2
+ 2 | 2
+ 3 | 11
+ 4 | 20
+ 5 | 8
+ 6 | 6
+ 7 | 4
+ 8 | 2
+ 9 | 3
+*/
+
+-- 2. Count by process
+
+-- Make a giant process table
+DROP TABLE process_table;
+CREATE TEMP TABLE process_table AS (
+SELECT perceptual_model.id, process_taxonomy.identifier, function_type.name AS function
+ FROM perceptual_model
+ INNER JOIN link_process_perceptual
+ ON perceptual_model.id = link_process_perceptual.entry_id
+ INNER JOIN process_taxonomy
+ ON link_process_perceptual.process_id = process_taxonomy.id
+ INNER JOIN function_type
+ ON function_type.id = process_taxonomy.function_id
+ORDER BY perceptual_model.id);
+
+
+-- # fluxes surface
+SELECT COUNT(id)
+FROM process_table
+ WHERE (function ILIKE 'Filling of store'
+ OR function ILIKE 'Release from store'
+ OR function ILIKE 'In-catchment flux'
+ OR function ILIKE 'In-store flux'
+ OR function ILIKE 'Release' )
+ AND identifier ILIKE 'Surf.%';
+
+-- # fluxes channel
+
+SELECT COUNT(id)
+FROM process_table
+ WHERE (function ILIKE 'Filling of store'
+ OR function ILIKE 'Release from store'
+ OR function ILIKE 'In-catchment flux'
+ OR function ILIKE 'In-store flux'
+ OR function ILIKE 'Release' )
+ AND identifier ILIKE 'Chan.%';
+
+-- # fluxes subsurface
+SELECT COUNT(id)
+FROM process_table
+ WHERE (function ILIKE 'Filling of store'
+ OR function ILIKE 'Release from store'
+ OR function ILIKE 'In-catchment flux'
+ OR function ILIKE 'In-store flux'
+ OR function ILIKE 'Release' )
+ AND identifier ILIKE 'Sub.%';
+
+-- # fluxes human
+SELECT COUNT(id)
+FROM process_table
+ WHERE (function ILIKE 'Filling of store'
+ OR function ILIKE 'Release from store'
+ OR function ILIKE 'In-catchment flux'
+ OR function ILIKE 'In-store flux'
+ OR function ILIKE 'Release' )
+ AND identifier ILIKE 'Human.%';
+
+ -- # stores surface
+ SELECT COUNT(id)
+ FROM process_table
+ WHERE (function ILIKE 'Store'
+ OR function ILIKE 'Store, temporary'
+ OR function ILIKE 'Store characteristics, temporary'
+ OR function ILIKE 'Store characteristics, permanent')
+ AND identifier ILIKE 'Surf.%';
+
+ -- # stores channel
+ SELECT COUNT(id)
+ FROM process_table
+ WHERE (function ILIKE 'Store'
+ OR function ILIKE 'Store, temporary'
+ OR function ILIKE 'Store characteristics, temporary'
+ OR function ILIKE 'Store characteristics, permanent')
+ AND identifier ILIKE 'Chan.%';
+
+ -- # stores subsurface
+ SELECT COUNT(id)
+ FROM process_table
+ WHERE (function ILIKE 'Store'
+ OR function ILIKE 'Store, temporary'
+ OR function ILIKE 'Store characteristics, temporary'
+ OR function ILIKE 'Store characteristics, permanent')
+ AND identifier ILIKE 'Sub.%';
+
+-- # total process
+ SELECT COUNT(id)
+ FROM process_table;
+
+-- # Surface
+ SELECT COUNT(id)
+ FROM process_table
+ WHERE identifier ILIKE 'Surf%';
+
+-- # Subsurface
+ SELECT COUNT(id)
+ FROM process_table
+ WHERE identifier ILIKE 'Sub%';
+
+-- # Channel
+ SELECT COUNT(id)
+ FROM process_table
+ WHERE identifier ILIKE 'Chan%';
+
+-- # Channel
+ SELECT COUNT(id)
+ FROM process_table
+ WHERE identifier ILIKE 'Human%';
+
+-- Common process in subsurface process
+-- # Groundwater
+ SELECT COUNT(id)
+ FROM process_table
+ WHERE identifier ILIKE 'Sub.GW%';
+
+-- # Soil
+ SELECT COUNT(id)
+ FROM process_table
+ WHERE identifier ILIKE 'Sub.Soil%';
+
+-- # Subsurface stormflow
+ SELECT COUNT(id)
+ FROM process_table
+ WHERE identifier ILIKE 'Sub.SSFlow%';
+
+-- # S-Groundwater
+ SELECT COUNT(id)
+ FROM process_table
+ WHERE identifier ILIKE 'Sub.GWSW%';
+
+
+-- # Infiltration
+ SELECT COUNT(id)
+ FROM process_table
+ WHERE identifier ILIKE 'Surf.Inf%';
+
+ SELECT identifier
+ FROM process_table
+ WHERE identifier ILIKE 'Surf.Inf%'
+ GROUP BY identifier;
+
+-- # Overland flow
+ SELECT COUNT(id)
+ FROM process_table
+ WHERE identifier ILIKE 'Surf.Over%';
+
+ SELECT identifier
+ FROM process_table
+ WHERE identifier ILIKE 'Surf.Over%'
+ GROUP BY identifier;
+
+
+-- # Channel storage
+ SELECT COUNT(id)
+ FROM process_table
+ WHERE identifier ILIKE 'Chan.Store%';
+
+ SELECT identifier
+ FROM process_table
+ WHERE identifier ILIKE 'Chan.Store%'
+ GROUP BY identifier;
+
+
+
+-- # Class, Process, Subprocess
+-- Count the # dots in the identifier
+ SELECT
+ CHAR_LENGTH(identifier) - CHAR_LENGTH(REPLACE(identifier, '.', '')) AS process_level,
+ COUNT(identifier)
+ FROM process_table
+ GROUP BY CHAR_LENGTH(identifier) - CHAR_LENGTH(REPLACE(identifier, '.', ''));
+
+/*
+ process_level | count
+---------------+-------
+ 3 | 177
+ 2 | 292
+ 1 | 85
+ */
\ No newline at end of file
diff --git a/src/debug/debug_build_database_plain.sql b/src/debug/debug_build_database_plain.sql
new file mode 100644
index 0000000..6bc279b
--- /dev/null
+++ b/src/debug/debug_build_database_plain.sql
@@ -0,0 +1,111 @@
+-- Use this code to debug if 1-1-build_database.ipynb don't work well
+
+CREATE TEMP TABLE giant_table AS (
+SELECT perceptual_model.id,
+ citations.citation,
+ citations.url,
+ citations.attribution,
+ citations.attribution_url,
+ perceptual_model.figure_num,
+ perceptual_model.figure_caption,
+ perceptual_model.figure_url,
+ locations.name AS watershed_name,
+ locations.lat,
+ locations.lon,
+ locations.area_km2,
+ process_taxonomy.process,
+ process_taxonomy.identifier,
+ function_type.name AS function_name,
+ perceptual_model.num_spatial_zones,
+ spatial_zone_type.spatial_property,
+ perceptual_model.num_temporal_zones,
+ temporal_zone_type.temporal_property,
+ perceptual_model.vegetation_info,
+ perceptual_model.soil_info,
+ perceptual_model.geol_info,
+ perceptual_model.topo_info,
+ perceptual_model.three_d_info,
+ perceptual_model.uncertainty_info,
+ perceptual_model.other_info
+ FROM perceptual_model
+ INNER JOIN citations
+ ON citations.id = perceptual_model.citation_id
+ INNER JOIN locations
+ ON locations.id = perceptual_model.location_id
+ INNER JOIN spatial_zone_type
+ ON spatial_zone_type.id = perceptual_model.spatialzone_id
+ INNER JOIN temporal_zone_type
+ ON temporal_zone_type.id = perceptual_model.temporalzone_id
+ INNER JOIN link_process_perceptual
+ ON perceptual_model.id = link_process_perceptual.entry_id
+ INNER JOIN process_taxonomy
+ ON link_process_perceptual.process_id = process_taxonomy.id
+ INNER JOIN function_type
+ ON process_taxonomy.function_id = function_type.id
+ORDER BY perceptual_model.id
+);
+
+
+CREATE TEMP TABLE giant_table_base AS (
+ SELECT DISTINCT
+ id,
+ citation,
+ url,
+ attribution,
+ attribution_url,
+ figure_num,
+ figure_caption,
+ figure_url,
+ watershed_name,
+ lat,
+ lon,
+ area_km2,
+ num_spatial_zones,
+ spatial_property,
+ num_temporal_zones,
+ temporal_property,
+ vegetation_info,
+ soil_info,
+ geol_info,
+ topo_info,
+ three_d_info,
+ uncertainty_info,
+ other_info
+ FROM giant_table
+);
+CREATE TEMP TABLE giant_table_flux AS (
+SELECT DISTINCT
+ id AS temp_id1,
+ COUNT(process) OVER(PARTITION BY id) AS num_flux,
+ STRING_AGG(process, ', ') OVER(PARTITION BY id) AS flux_list,
+ STRING_AGG(identifier, ', ') OVER(PARTITION BY id) AS flux_id_list
+FROM giant_table
+ WHERE function_name ILIKE 'Filling of store'
+ OR function_name ILIKE 'Release from store'
+ OR function_name ILIKE 'In-catchment flux'
+ OR function_name ILIKE 'In-store flux'
+ OR function_name ILIKE 'Release'
+ );
+CREATE TEMP TABLE giant_table_store AS (
+SELECT DISTINCT id AS temp_id2,
+COUNT(process) OVER(PARTITION BY id) AS num_store,
+ STRING_AGG(process, ', ') OVER(PARTITION BY id) AS store_list,
+ STRING_AGG(identifier, ', ') OVER(PARTITION BY id) AS store_id_list
+FROM giant_table
+ WHERE function_name ILIKE 'Store'
+ OR function_name ILIKE 'Store, temporary'
+ OR function_name ILIKE 'Store characteristics, temporary'
+ OR function_name ILIKE 'Store characteristics, permanent'
+ );
+CREATE TEMP TABLE giant_table_update AS (
+SELECT * FROM giant_table_base
+LEFT JOIN giant_table_store
+ON giant_table_base.id = giant_table_store.temp_id2
+LEFT JOIN giant_table_flux
+ON giant_table_base.id = giant_table_flux.temp_id1
+ORDER BY id
+ );
+ALTER TABLE giant_table_update
+DROP COLUMN temp_id1,
+DROP COLUMN temp_id2,
+ADD COLUMN dummy_column NUMERIC DEFAULT 1;
diff --git a/src/debug/debug_built_database.sql b/src/debug/debug_built_database.sql
new file mode 100644
index 0000000..2adcae2
--- /dev/null
+++ b/src/debug/debug_built_database.sql
@@ -0,0 +1,648 @@
+-- Use this code to debug if 1-1-build_database.ipynb don't work well
+
+
+-- Launch PostgreSQL
+-- "C:\Program Files\PostgreSQL\14\bin\psql.exe" -h [HOST_NAME] -U [USER_NAME] -d [PASSWORD]
+
+-- Just to check if PostGIS is properly working
+-- https://postgis.net/docs/ST_MakePoint.html
+SELECT ST_SetSRID(ST_MakePoint(-71.1043443253471, 42.3150676015829),4326);
+
+-- Preparation
+-- Set path in PostgreSQL. Specify the schema names (in this example, 'public' and 'perceptual_model')
+SET search_path TO public, perceptual_model;
+-- Set encoding
+SET CLIENT_ENCODING TO 'UTF8';
+
+-- display all table & schema information
+\d
+
+-- display a table informaton
+-- \d + table name
+\d perceptual_model
+\d process_taxonomy
+\d citations
+\d locations
+\d function_type
+\d link_process_perceptual
+\d process_alt_names
+\d spatial_zone_type
+\d temporal_zone_type
+
+-- display empty foreign keys (should show nothing)
+
+-- main table
+SELECT * FROM perceptual_model
+WHERE citation_id IS NULL
+OR citation_id::text = '';
+
+SELECT * FROM perceptual_model
+WHERE spatialzone_id IS NULL
+OR spatialzone_id::text = '';
+
+SELECT * FROM perceptual_model
+WHERE temporalzone_id IS NULL
+OR temporalzone_id::text = '';
+
+SELECT * FROM perceptual_model
+WHERE location_id IS NULL
+OR location_id::text = '';
+
+-- link process perceptual
+SELECT * FROM link_process_perceptual
+WHERE entry_id IS NULL
+OR entry_id::text = '';
+
+-- proces table
+SELECT * FROM process_alt_names
+WHERE process_id IS NULL
+OR process_id::text = '';
+
+-- This can show some results (some process up to Level 2 does not have function (yet))
+SELECT * FROM process_taxonomy
+WHERE function_id IS NULL
+OR function_id::text = '';
+
+-- process table
+SELECT * FROM process_taxonomy
+WHERE process_level IS NULL
+OR process_level::text = '';
+
+--
+SELECT * FROM citations
+WHERE attribution_url IS NULL
+OR attribution_url::text = '';
+
+
+
+-- Count some key stats
+
+-- count the number of records
+SELECT COUNT(id)
+FROM perceptual_model;
+
+-- count by spatial zones
+SELECT num_spatial_zones, COUNT(id)
+FROM perceptual_model
+GROUP BY num_spatial_zones
+ORDER BY num_spatial_zones;
+
+/*
+ num_spatial_zones | count
+-------------------+-------
+ 1 | 51
+ 2 | 7
+ 4 | 2
+ 6 | 2
+ 7 | 1
+*/
+
+-- count by temporal zones
+SELECT num_temporal_zones, COUNT(id)
+FROM perceptual_model
+GROUP BY num_temporal_zones
+ORDER BY num_temporal_zones;
+
+/*
+ num_temporal_zones | count
+--------------------+-------
+ 1 | 35
+ 2 | 11
+ 3 | 8
+ 4 | 8
+ 5 | 1
+*/
+
+-- count by flux
+WITH flux_count AS
+(SELECT perceptual_model.id, COUNT(perceptual_model.id) AS num_flux_per_model
+ FROM perceptual_model
+ INNER JOIN link_process_perceptual
+ ON perceptual_model.id = link_process_perceptual.entry_id
+ INNER JOIN process_taxonomy
+ ON link_process_perceptual.process_id = process_taxonomy.id
+ INNER JOIN function_type
+ ON process_taxonomy.function_id = function_type.id
+ WHERE function_type.name ILIKE 'Filling of store'
+ OR function_type.name ILIKE 'Release from store'
+ OR function_type.name ILIKE 'In-catchment flux'
+ OR function_type.name ILIKE 'In-store flux'
+ OR function_type.name ILIKE 'Release'
+ GROUP BY perceptual_model.id)
+SELECT num_flux_per_model, COUNT(num_flux_per_model) AS num_models
+FROM flux_count
+GROUP BY num_flux_per_model
+ORDER BY num_flux_per_model;
+
+SELECT num_flux, COUNT(temp_id1)
+FROM giant_table_flux
+GROUP BY num_flux
+ORDER BY num_flux;
+
+/*
+ num_flux | count
+----------+-------
+ 1 | 1
+ 2 | 5
+ 3 | 9
+ 4 | 14
+ 5 | 9
+ 6 | 11
+ 7 | 4
+ 8 | 6
+ 9 | 2
+*/
+
+
+-- count by stores
+WITH store_count AS
+(SELECT perceptual_model.id, COUNT(perceptual_model.id) AS num_store_per_model
+ FROM perceptual_model
+ INNER JOIN link_process_perceptual
+ ON perceptual_model.id = link_process_perceptual.entry_id
+ INNER JOIN process_taxonomy
+ ON link_process_perceptual.process_id = process_taxonomy.id
+ INNER JOIN function_type
+ ON process_taxonomy.function_id = function_type.id
+ WHERE function_type.name ILIKE 'Store'
+ OR function_type.name ILIKE 'Store, temporary'
+ OR function_type.name ILIKE 'Store characteristics, temporary'
+ OR function_type.name ILIKE 'Store characteristics, permanent'
+ GROUP BY perceptual_model.id)
+SELECT num_store_per_model, COUNT(num_store_per_model) AS num_models
+FROM store_count
+GROUP BY num_store_per_model
+ORDER BY num_store_per_model;
+
+SELECT num_store, COUNT(temp_id2)
+FROM giant_table_store
+GROUP BY num_store
+ORDER BY num_store;
+
+/*
+ num_store_per_model | num_models
+---------------------+------------
+ 1 | 2
+ 2 | 2
+ 3 | 11
+ 4 | 20
+ 5 | 8
+ 6 | 6
+ 7 | 4
+ 8 | 2
+ 9 | 3
+*/
+
+-- count by process
+
+-- subsurface processes
+SELECT COUNT(process_taxonomy.identifier) AS num_process
+ FROM perceptual_model
+ INNER JOIN link_process_perceptual
+ ON perceptual_model.id = link_process_perceptual.entry_id
+ INNER JOIN process_taxonomy
+ ON link_process_perceptual.process_id = process_taxonomy.id
+ WHERE process_taxonomy.identifier ILIKE 'Sub.%';
+
+SELECT link_process_perceptual.id, process_taxonomy.identifier
+ FROM perceptual_model
+ INNER JOIN link_process_perceptual
+ ON perceptual_model.id = link_process_perceptual.entry_id
+ INNER JOIN process_taxonomy
+ ON link_process_perceptual.process_id = process_taxonomy.id
+ WHERE process_taxonomy.identifier ILIKE 'Sub.%';
+
+
+/*
+ num_process
+-------------
+ 436
+
+
+*/
+
+SELECT process_taxonomy.identifier, COUNT(process_taxonomy.identifier) AS num_process
+ FROM perceptual_model
+ INNER JOIN link_process_perceptual
+ ON perceptual_model.id = link_process_perceptual.entry_id
+ INNER JOIN process_taxonomy
+ ON link_process_perceptual.process_id = process_taxonomy.id
+ WHERE process_taxonomy.identifier ILIKE 'Sub.%'
+GROUP BY process_taxonomy.identifier
+ORDER BY COUNT(process_taxonomy.identifier) DESC;
+
+-- Need to sum up by the 2nd category ...
+
+/*
+ identifier | num_process
+--------------------+-------------
+ Sub.Soil.Store | 71
+ Sub.GW.Store | 48
+ Sub.SSFlow | 37
+ Sub.Soil.Drain | 20
+ Sub.GW.Store.Perch | 15
+ */
+
+
+
+-- count by process level
+SELECT process_taxonomy.process_level, COUNT(process_taxonomy.process_level) AS num_process
+ FROM perceptual_model
+ INNER JOIN link_process_perceptual
+ ON perceptual_model.id = link_process_perceptual.entry_id
+ INNER JOIN process_taxonomy
+ ON link_process_perceptual.process_id = process_taxonomy.id
+GROUP BY process_taxonomy.process_level
+ORDER BY COUNT(process_taxonomy.process_level) DESC;
+
+/*
+ process_level | num_process
+---------------+-------------
+ 3 | 292
+ 4 | 177
+ 2 | 85
+
+True counts ---
+ process_level | num_process
+---------------+-------------
+ 3 | 222
+ 4 | 103
+ 2 | 86
+ | 0
+
+*/
+
+/* The results show that Subsurface Processes dominate the diagrams (299 instances), followed by Surface Processes (65) and Channel Processes (47).
+The most common classes in Subsurface Processes were Groundwater (126), Soils (94) and Subsurface Stormflow (62).
+The most common classes in Surface Processes were Overland Flow (35) and Infiltration (14).
+The most common class in Channel Processes was Channel Storage (33).
+For level of detail, diagrams most commonly contained Processes (222), followed by Sub-Processes (103) and Classes (86).
+*/
+
+-- Join almost all tables for webmap
+DROP TABLE giant_table;
+CREATE TEMP TABLE giant_table AS (
+SELECT perceptual_model.id,
+ citations.citation,
+ citations.url,
+ perceptual_model.figure_num,
+ locations.name AS watershed_name,
+ locations.lat,
+ locations.lon,
+ process_taxonomy.process,
+ process_taxonomy.identifier,
+ function_type.name AS function_name,
+ perceptual_model.num_spatial_zones,
+ spatial_zone_type.spatial_property,
+ perceptual_model.num_temporal_zones,
+ temporal_zone_type.temporal_property,
+ perceptual_model.vegetation_info,
+ perceptual_model.soil_info,
+ perceptual_model.geol_info,
+ perceptual_model.topo_info,
+ perceptual_model.three_d_info,
+ perceptual_model.uncertainty_info,
+ perceptual_model.other_info
+ FROM perceptual_model
+ INNER JOIN citations
+ ON citations.id = perceptual_model.citation_id
+ INNER JOIN locations
+ ON locations.id = perceptual_model.location_id
+ INNER JOIN spatial_zone_type
+ ON spatial_zone_type.id = perceptual_model.spatialzone_id
+ INNER JOIN temporal_zone_type
+ ON temporal_zone_type.id = perceptual_model.temporalzone_id
+ INNER JOIN link_process_perceptual
+ ON perceptual_model.id = link_process_perceptual.entry_id
+ INNER JOIN process_taxonomy
+ ON link_process_perceptual.process_id = process_taxonomy.id
+ INNER JOIN function_type
+ ON process_taxonomy.function_id = function_type.id
+ORDER BY perceptual_model.id
+);
+
+-- Compare giant_table_flux and giant_table_store with Excel for debug
+DROP TABLE giant_table_flux;
+CREATE TEMP TABLE giant_table_flux AS (
+SELECT DISTINCT
+ id,
+ citation,
+ url,
+ figure_num,
+ watershed_name,
+ lat,
+ lon,
+ num_spatial_zones,
+ spatial_property,
+ num_temporal_zones,
+ temporal_property,
+ vegetation_info,
+ soil_info,
+ geol_info,
+ topo_info,
+ three_d_info,
+ uncertainty_info,
+ other_info,
+ COUNT(process) OVER(PARTITION BY id) AS num_flux,
+ STRING_AGG(process, ', ') OVER(PARTITION BY id) AS flux_list,
+ STRING_AGG(identifier, ', ') OVER(PARTITION BY id) AS flux_id_list
+FROM giant_table
+ WHERE function_name ILIKE 'Filling of store'
+ OR function_name ILIKE 'Release from store'
+ OR function_name ILIKE 'In-catchment flux'
+ OR function_name ILIKE 'In-store flux'
+ OR function_name ILIKE 'Release'
+ );
+
+DROP TABLE giant_table_store;
+CREATE TEMP TABLE giant_table_store AS (
+SELECT DISTINCT id AS temp_id,
+COUNT(process) OVER(PARTITION BY id) AS num_store,
+ STRING_AGG(process, ', ') OVER(PARTITION BY id) AS store_list,
+ STRING_AGG(identifier, ', ') OVER(PARTITION BY id) AS store_id_list
+FROM giant_table
+ WHERE function_name ILIKE 'Store'
+ OR function_name ILIKE 'Store, temporary'
+ OR function_name ILIKE 'Store characteristics, temporary'
+ OR function_name ILIKE 'Store characteristics, permanent'
+ );
+
+DROP TABLE giant_table_update;
+CREATE TEMP TABLE giant_table_update AS (
+SELECT DISTINCT * FROM giant_table_flux
+FULL JOIN giant_table_store
+ON giant_table_flux.id = giant_table_store.temp_id
+ORDER BY id
+ );
+
+ALTER TABLE giant_table_update
+DROP COLUMN temp_id;
+
+-- save to csv
+\copy giant_table TO 'G://Shared drives/Perceptual model review/ForRyoko/perceptual-model-arcgis/db_dev/data/giant_table.csv' WITH DELIMITER ',' CSV HEADER;
+\copy giant_table_update TO 'G://Shared drives/Perceptual model review/ForRyoko/perceptual-model-arcgis/db_dev/data/giant_table_update.csv' WITH DELIMITER ',' CSV HEADER;
+
+\copy giant_table_store TO 'G://Shared drives/Perceptual model review/ForRyoko/perceptual-model-arcgis/db_dev/data/store.csv' WITH DELIMITER ',' CSV HEADER;
+\copy giant_table_flux TO 'G://Shared drives/Perceptual model review/ForRyoko/perceptual-model-arcgis/db_dev/data/flux.csv' WITH DELIMITER ',' CSV HEADER;
+
+
+------------------- some cutouts
+
+SELECT perceptual_model.id, COUNT(perceptual_model.id) AS num_flux_per_model
+ FROM perceptual_model
+ INNER JOIN link_process_perceptual
+ ON perceptual_model.id = link_process_perceptual.entry_id
+ INNER JOIN process_taxonomy
+ ON link_process_perceptual.process_id = process_taxonomy.id
+ INNER JOIN function_type
+ ON process_taxonomy.function_id = function_type.id
+ WHERE function_type.name ILIKE '%flux%'
+ GROUP BY perceptual_model.id
+ ORDER BY perceptual_model.id;
+
+SELECT perceptual_model.id, process_taxonomy.process, citations.citation
+ FROM perceptual_model
+ INNER JOIN link_process_perceptual
+ ON perceptual_model.id = link_process_perceptual.entry_id
+ INNER JOIN process_taxonomy
+ ON link_process_perceptual.process_id = process_taxonomy.id
+ INNER JOIN function_type
+ ON process_taxonomy.function_id = function_type.id
+ INNER JOIN citations
+ ON citations.id = perceptual_model.citation_id
+ WHERE function_type.name ILIKE 'Filling of store'
+ OR function_type.name ILIKE 'Release from store'
+ OR function_type.name ILIKE 'In-catchment flux'
+ OR function_type.name ILIKE 'In-store flux'
+ OR function_type.name ILIKE 'Release'
+ and perceptual_model.id = 1;
+
+ select * from link_process_perceptual
+ INNER JOIN process_taxonomy
+ ON link_process_perceptual.process_id = process_taxonomy.id
+ where entry_id =1;
+
+-- Compare giant_table_flux and giant_table_store with Excel for debug
+DROP TABLE giant_table;
+CREATE TEMP TABLE giant_table AS (
+SELECT perceptual_model.id,
+ citations.citation,
+ citations.url,
+ citations.attribution,
+ citations.attribution_url,
+ perceptual_model.figure_num,
+ perceptual_model.figure_caption,
+ perceptual_model.figure_url,
+ locations.name AS watershed_name,
+ locations.lat,
+ locations.lon,
+ locations.area_km2,
+ locations.huc_watershed_id,
+ process_taxonomy.process,
+ process_taxonomy.identifier,
+ function_type.name AS function_name,
+ perceptual_model.num_spatial_zones,
+ spatial_zone_type.spatial_property,
+ perceptual_model.num_temporal_zones,
+ temporal_zone_type.temporal_property,
+ perceptual_model.vegetation_info,
+ perceptual_model.soil_info,
+ perceptual_model.geol_info,
+ perceptual_model.topo_info,
+ perceptual_model.three_d_info,
+ perceptual_model.uncertainty_info,
+ perceptual_model.other_info
+ FROM perceptual_model
+ INNER JOIN citations
+ ON citations.id = perceptual_model.citation_id
+ INNER JOIN locations
+ ON locations.id = perceptual_model.location_id
+ INNER JOIN spatial_zone_type
+ ON spatial_zone_type.id = perceptual_model.spatialzone_id
+ INNER JOIN temporal_zone_type
+ ON temporal_zone_type.id = perceptual_model.temporalzone_id
+ INNER JOIN link_process_perceptual
+ ON perceptual_model.id = link_process_perceptual.entry_id
+ INNER JOIN process_taxonomy
+ ON link_process_perceptual.process_id = process_taxonomy.id
+ INNER JOIN function_type
+ ON process_taxonomy.function_id = function_type.id
+ORDER BY perceptual_model.id
+);
+
+
+CREATE TEMP TABLE giant_table_base AS (
+ SELECT DISTINCT
+ id,
+ citation,
+ url,
+ attribution,
+ attribution_url,
+ figure_num,
+ figure_caption,
+ figure_url,
+ watershed_name,
+ lat,
+ lon,
+ area_km2,
+ huc_watershed_id,
+ num_spatial_zones,
+ spatial_property,
+ num_temporal_zones,
+ temporal_property,
+ vegetation_info,
+ soil_info,
+ geol_info,
+ topo_info,
+ three_d_info,
+ uncertainty_info,
+ other_info
+ FROM giant_table
+);
+
+DROP TABLE giant_table_flux;
+CREATE TEMP TABLE giant_table_flux AS (
+SELECT DISTINCT
+ id AS temp_id1,
+ COUNT(process) OVER(PARTITION BY id) AS num_flux,
+ STRING_AGG(process, ', ') OVER(PARTITION BY id) AS flux_list,
+ STRING_AGG(identifier, ', ') OVER(PARTITION BY id) AS flux_id_list
+FROM giant_table
+ WHERE function_name ILIKE 'Filling of store'
+ OR function_name ILIKE 'Release from store'
+ OR function_name ILIKE 'In-catchment flux'
+ OR function_name ILIKE 'In-store flux'
+ OR function_name ILIKE 'Release'
+ );
+
+DROP TABLE giant_table_store;
+CREATE TEMP TABLE giant_table_store AS (
+SELECT DISTINCT id AS temp_id2,
+COUNT(process) OVER(PARTITION BY id) AS num_store,
+ STRING_AGG(process, ', ') OVER(PARTITION BY id) AS store_list,
+ STRING_AGG(identifier, ', ') OVER(PARTITION BY id) AS store_id_list
+FROM giant_table
+ WHERE function_name ILIKE 'Store'
+ OR function_name ILIKE 'Store, temporary'
+ OR function_name ILIKE 'Store characteristics, temporary'
+ OR function_name ILIKE 'Store characteristics, permanent'
+ );
+
+CREATE TEMP TABLE giant_table_update AS (
+SELECT * FROM giant_table_base
+LEFT JOIN giant_table_store
+ON giant_table_base.id = giant_table_store.temp_id2
+LEFT JOIN giant_table_flux
+ON giant_table_base.id = giant_table_flux.temp_id1
+ORDER BY id
+ );
+ALTER TABLE giant_table_update
+DROP COLUMN temp_id1,
+DROP COLUMN temp_id2;
+
+---------- Some more debugs
+-- Channel storage is not recognized as flux
+
+SELECT * FROM process_taxonomy INNER JOIN function_type
+ON process_taxonomy.function_id = function_type.id
+WHERE process_taxonomy.process ILIKE 'Channel%';
+
+SELECT * FROM process_taxonomy
+WHERE process_taxonomy.process ILIKE 'Channel%';
+
+-- function_id is missing where the 'Release' had extra white space in the string
+SELECT * FROM process_taxonomy
+WHERE function_id IS NULL;
+
+
+---- Some debugs
+SELECT id, flux_list, function_name FROM giant_table_update
+WHERE num_flux = 2;
+
+SELECT id, process, function_name
+FROM giant_table
+WHERE process LIKE 'Evapotranspiration';
+
+SELECT id, process, function_name
+FROM giant_table
+WHERE process LIKE 'Riparian transpiration';
+
+SELECT id, process, function_name
+FROM giant_table
+WHERE process LIKE 'Soil surface evaporation';
+
+SELECT citation, process, function_name, identifier
+FROM giant_table
+WHERE identifier ILIKE 'Human.%';
+
+
+
+CREATE TEMP TABLE giant_table_base AS ( \
+SELECT DISTINCT \
+ id, \
+ model_type,\
+ citation, \
+ url, \
+ attribution, \
+ attribution_url, \
+ figure_num, \
+ figure_caption, \
+ figure_url, \
+ textmodel_snipped, \
+ textmodel_section_number, \
+ textmodel_section_name, \
+ textmodel_page_number, \
+ watershed_name, \
+ lat, \
+ lon, \
+ area_km2, \
+ num_spatial_zones, \
+ spatial_property, \
+ num_temporal_zones, \
+ temporal_property, \
+ vegetation_info, \
+ soil_info, \
+ geol_info, \
+ topo_info, \
+ three_d_info, \
+ uncertainty_info, \
+ other_info \
+FROM giant_table \
+); \
+CREATE TEMP TABLE giant_table_flux AS ( \
+SELECT DISTINCT \
+id AS temp_id1, \
+COUNT(process) OVER(PARTITION BY id) AS num_flux, \
+STRING_AGG(process, ', ') OVER(PARTITION BY id) AS flux_list, \
+STRING_AGG(identifier, ', ') OVER(PARTITION BY id) AS flux_id_list \
+FROM giant_table \
+ WHERE function_name ILIKE 'Filling of store' \
+ OR function_name IS NULL\
+ OR function_name ILIKE 'Release from store' \
+ OR function_name ILIKE 'In-catchment flux' \
+ OR function_name ILIKE 'In-store flux' \
+ OR function_name ILIKE 'Release' \
+ ); \
+CREATE TEMP TABLE giant_table_store AS ( \
+SELECT DISTINCT id AS temp_id2, \
+COUNT(process) OVER(PARTITION BY id) AS num_store, \
+STRING_AGG(process, ', ') OVER(PARTITION BY id) AS store_list, \
+STRING_AGG(identifier, ', ') OVER(PARTITION BY id) AS store_id_list \
+FROM giant_table \
+ WHERE function_name ILIKE 'Store' \
+ OR function_name ILIKE 'Store, temporary' \
+ OR function_name ILIKE 'Store characteristics, temporary' \
+ OR function_name ILIKE 'Store characteristics, permanent' \
+ ); \
+CREATE TEMP TABLE giant_table_update AS ( \
+SELECT * FROM giant_table_base \
+LEFT JOIN giant_table_store \
+ON giant_table_base.id = giant_table_store.temp_id2 \
+LEFT JOIN giant_table_flux \
+ON giant_table_base.id = giant_table_flux.temp_id1 \
+ORDER BY id \
+ ); \
+ALTER TABLE giant_table_update \
+DROP COLUMN temp_id1, \
+DROP COLUMN temp_id2, \
+ADD COLUMN dummy_column NUMERIC DEFAULT 1; \
\ No newline at end of file
diff --git a/src/environment.yml b/src/environment.yml
new file mode 100644
index 0000000..707471c
--- /dev/null
+++ b/src/environment.yml
@@ -0,0 +1,237 @@
+name: arcgis
+channels:
+ - esri
+ - conda-forge
+ - defaults
+dependencies:
+ - anyio=3.6.2
+ - arcgis=2.0.1
+ - argon2-cffi=21.3.0
+ - argon2-cffi-bindings=21.2.0
+ - asgiref=3.6.0
+ - asttokens=2.2.1
+ - attrs=22.2.0
+ - backcall=0.2.0
+ - backports=1.0
+ - backports.functools_lru_cache=1.6.4
+ - backports.zoneinfo=0.2.1
+ - beautifulsoup4=4.11.2
+ - bleach=6.0.0
+ - blinker=1.5
+ - brotli=1.0.9
+ - brotli-bin=1.0.9
+ - brotlipy=0.7.0
+ - bzip2=1.0.8
+ - ca-certificates=2022.12.7
+ - cachetools=5.3.0
+ - certifi=2022.12.7
+ - cffi=1.15.1
+ - charset-normalizer=2.1.1
+ - colorama=0.4.6
+ - comm=0.1.2
+ - contourpy=1.0.7
+ - cryptography=39.0.0
+ - cycler=0.11.0
+ - debugpy=1.6.6
+ - decorator=5.1.1
+ - defusedxml=0.7.1
+ - django=4.1.7
+ - entrypoints=0.4
+ - et_xmlfile=1.1.0
+ - executing=1.2.0
+ - flit-core=3.8.0
+ - fonttools=4.38.0
+ - freetype=2.12.1
+ - gettext=0.21.1
+ - glib=2.74.1
+ - glib-tools=2.74.1
+ - greenlet=2.0.2
+ - gst-plugins-base=1.21.3
+ - gstreamer=1.21.3
+ - icu=70.1
+ - idna=3.4
+ - importlib-metadata=6.0.0
+ - importlib-resources=5.12.0
+ - importlib_metadata=6.0.0
+ - importlib_resources=5.12.0
+ - intel-openmp=2023.0.0
+ - ipykernel=6.21.2
+ - ipython=8.10.0
+ - ipython_genutils=0.2.0
+ - ipywidgets=8.0.4
+ - jaraco.classes=3.2.3
+ - jedi=0.18.2
+ - jinja2=3.1.2
+ - jpeg=9e
+ - jsonschema=4.17.3
+ - jupyter=1.0.0
+ - jupyter_client=6.1.12
+ - jupyter_console=6.4.2
+ - jupyter_core=5.2.0
+ - jupyter_events=0.6.3
+ - jupyter_server=1.23.6
+ - jupyter_server_terminals=0.4.4
+ - jupyterlab_pygments=0.2.2
+ - jupyterlab_widgets=3.0.5
+ - keyring=23.13.1
+ - kiwisolver=1.4.4
+ - krb5=1.20.1
+ - lcms2=2.14
+ - lerc=3.0
+ - libblas=3.9.0
+ - libbrotlicommon=1.0.9
+ - libbrotlidec=1.0.9
+ - libbrotlienc=1.0.9
+ - libcblas=3.9.0
+ - libclang=15.0.7
+ - libclang13=15.0.7
+ - libdeflate=1.12
+ - libffi=3.4.2
+ - libglib=2.74.1
+ - libhwloc=2.9.0
+ - libiconv=1.17
+ - liblapack=3.9.0
+ - libogg=1.3.4
+ - libpng=1.6.39
+ - libpq=15.1
+ - libsodium=1.0.18
+ - libsqlite=3.40.0
+ - libtiff=4.4.0
+ - libvorbis=1.3.7
+ - libwebp-base=1.2.4
+ - libxcb=1.13
+ - libxml2=2.10.3
+ - libxslt=1.1.37
+ - libzlib=1.2.13
+ - lxml=4.9.2
+ - m2w64-gcc-libgfortran=5.3.0
+ - m2w64-gcc-libs=5.3.0
+ - m2w64-gcc-libs-core=5.3.0
+ - m2w64-gmp=6.1.0
+ - m2w64-libwinpthread-git=5.0.0.4634.697f757
+ - markupsafe=2.1.2
+ - matplotlib=3.7.0
+ - matplotlib-base=3.7.0
+ - matplotlib-inline=0.1.6
+ - mistune=2.0.5
+ - mkl=2022.1.0
+ - more-itertools=9.0.0
+ - msys2-conda-epoch=20160418
+ - munkres=1.1.4
+ - nbclassic=0.5.2
+ - nbclient=0.7.2
+ - nbconvert=7.2.9
+ - nbconvert-core=7.2.9
+ - nbconvert-pandoc=7.2.9
+ - nbformat=5.7.3
+ - nest-asyncio=1.5.6
+ - notebook=6.5.2
+ - notebook-shim=0.2.2
+ - numpy=1.24.2
+ - oauthlib=3.2.2
+ - openjpeg=2.5.0
+ - openpyxl=3.1.1
+ - openssl=1.1.1t
+ - packaging=23.0
+ - pandas=1.5.3
+ - pandoc=2.19.2
+ - pandocfilters=1.5.0
+ - parso=0.8.3
+ - pcre2=10.40
+ - pickleshare=0.7.5
+ - pillow=9.2.0
+ - pip=23.0.1
+ - pkgutil-resolve-name=1.3.10
+ - platformdirs=3.0.0
+ - ply=3.11
+ - prometheus_client=0.16.0
+ - prompt-toolkit=3.0.36
+ - prompt_toolkit=3.0.36
+ - psutil=5.9.4
+ - pthread-stubs=0.4
+ - pthreads-win32=2.9.1
+ - pure_eval=0.2.2
+ - pycparser=2.21
+ - pygments=2.14.0
+ - pyjwt=2.6.0
+ - pyopenssl=23.0.0
+ - pyparsing=3.0.9
+ - pyqt=5.15.7
+ - pyqt5-sip=12.11.0
+ - pyrsistent=0.19.3
+ - pyshp=2.3.1
+ - pysocks=1.7.1
+ - pyspnego=0.3.0
+ - python=3.9.0
+ - python-certifi-win32=1.2
+ - python-dateutil=2.8.2
+ - python-fastjsonschema=2.16.2
+ - python-json-logger=2.0.6
+ - python_abi=3.9
+ - pytz=2022.7.1
+ - pywin32=304
+ - pywin32-ctypes=0.2.0
+ - pywin32-security=302
+ - pywinpty=2.0.10
+ - pyyaml=6.0
+ - pyzmq=25.0.0
+ - qt-main=5.15.6
+ - qtconsole=5.4.0
+ - qtconsole-base=5.4.0
+ - qtpy=2.3.0
+ - requests=2.28.2
+ - requests-kerberos=0.12.0
+ - requests-negotiate-sspi=0.5.3
+ - requests-oauthlib=1.3.1
+ - requests-toolbelt=0.10.1
+ - requests_ntlm=1.2.0
+ - rfc3339-validator=0.1.4
+ - rfc3986-validator=0.1.1
+ - ruamel.yaml=0.17.21
+ - ruamel.yaml.clib=0.2.7
+ - send2trash=1.8.0
+ - setuptools=67.4.0
+ - sip=6.7.7
+ - six=1.16.0
+ - sniffio=1.3.0
+ - soupsieve=2.3.2.post1
+ - sqlalchemy=2.0.4
+ - sqlite=3.40.0
+ - sqlparse=0.4.3
+ - stack_data=0.6.2
+ - tbb=2021.8.0
+ - terminado=0.17.0
+ - tinycss2=1.2.1
+ - tk=8.6.12
+ - toml=0.10.2
+ - tornado=6.2
+ - traitlets=5.9.0
+ - typing-extensions=4.4.0
+ - typing_extensions=4.4.0
+ - tzdata=2022g
+ - ucrt=10.0.22621.0
+ - ujson=5.7.0
+ - unicodedata2=15.0.0
+ - urllib3=1.26.14
+ - vc=14.3
+ - vs2015_runtime=14.34.31931
+ - wcwidth=0.2.6
+ - webencodings=0.5.1
+ - websocket-client=1.5.1
+ - wheel=0.38.4
+ - widgetsnbextension=4.0.5
+ - win_inet_pton=1.1.0
+ - wincertstore=0.2
+ - winkerberos=0.9.1
+ - winpty=0.4.3
+ - wrapt=1.14.1
+ - xlrd=2.0.1
+ - xorg-libxau=1.0.9
+ - xorg-libxdmcp=1.1.3
+ - xz=5.2.6
+ - yaml=0.2.5
+ - zeromq=4.3.4
+ - zipp=3.14.0
+ - zstd=1.5.2
+ - pip:
+ - psycopg2==2.9.5
diff --git a/src/environment_minimal.yml b/src/environment_minimal.yml
new file mode 100644
index 0000000..c74c763
--- /dev/null
+++ b/src/environment_minimal.yml
@@ -0,0 +1,13 @@
+name: arcgis
+channels:
+ - conda-forge
+ - esri
+dependencies:
+ - python == 3.9
+ - numpy
+ - matplotlib
+ - jupyter
+ - pandas
+ - requests
+ - ipykernel
+ - arcgis == 2.0.1
\ No newline at end of file
diff --git a/src/example_config.ini b/src/example_config.ini
new file mode 100644
index 0000000..35c7adb
--- /dev/null
+++ b/src/example_config.ini
@@ -0,0 +1,6 @@
+[postgresql]
+HOST = your_host
+DB_NAME = your_dbname
+PORT = your_port
+USER_NAME = your_username
+PASSWD = your_password
\ No newline at end of file
diff --git a/src/init_create_webmap_private.ipynb b/src/init_create_webmap_private.ipynb
new file mode 100644
index 0000000..db64d77
--- /dev/null
+++ b/src/init_create_webmap_private.ipynb
@@ -0,0 +1,1889 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "17ab89f6",
+ "metadata": {},
+ "source": [
+ "# Create ArcGIS webmap on perceptual-model database\n",
+ "\n",
+ "I referred to Jessica's instruction to create this notebook https://github.com/jlembury/GEOG594-Embury/blob/master/DEMO_ArcGIS_API_Python.ipynb"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "cf8bcc1a",
+ "metadata": {},
+ "source": [
+ "# Config"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "id": "72a3ecac",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "data_dir = f\"G:\\Shared drives\\Perceptual model review\\ForRyoko\\data\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "4d8e4271",
+ "metadata": {},
+ "source": [
+ "## Import modules"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "22ba798c-c407-427b-9f94-de4752a43cd2",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import os\n",
+ "import webbrowser\n",
+ "import pandas as pd\n",
+ "pd.options.mode.chained_assignment = None # default='warn'\n",
+ "import json\n",
+ "from arcgis.gis import GIS\n",
+ "from arcgis.features import FeatureLayerCollection"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "463eae66",
+ "metadata": {},
+ "source": [
+ "## Connect with ArcGIS\n",
+ "Reference for authentication schemes: https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "9f19dd88",
+ "metadata": {},
+ "source": [
+ "I ended up in using User autentification with OAuth 2.0 in Reference for authentication schemes: https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/\n",
+ "\n",
+ "Note: log-in expires after an hour or so.\n",
+ "When commands return \"Exception: A general error occurred: 'Response' object is not subscriptable\", log-in again. "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "5328c70c",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "with open('./auth.json', 'r') as infile:\n",
+ " my_credentials = json.load(infile)\n",
+ "\n",
+ "gis = GIS(\"https://sdsugeo.maps.arcgis.com/\", client_id=my_credentials['client_id'])\n",
+ "print(\"Successfully logged in as: \" + gis.properties.user.username)\n",
+ "\n",
+ "# Clear the output for security \n",
+ "from IPython.display import clear_output\n",
+ "clear_output(wait=False)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "bfa15a0b",
+ "metadata": {},
+ "source": [
+ "open"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0108b7af",
+ "metadata": {},
+ "source": [
+ "If you have ArcGIS pro, this is the most straightforward and easy connection"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "id": "da85ed62",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# gis = GIS('Pro')\n",
+ "# print(\"Logged in as \" + str(gis.properties.user.username))"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "f70e7222",
+ "metadata": {},
+ "source": [
+ "## Newly create a webmap (skip the rest of the blocks if you are updating)"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "84b0fa5d",
+ "metadata": {},
+ "source": [
+ "### Publish the CSV data to ArcGIS online"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "aee09ff8",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "NameError",
+ "evalue": "name 'gis' is not defined",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
+ "Cell \u001b[1;32mIn[1], line 8\u001b[0m\n\u001b[0;32m 4\u001b[0m csv_path \u001b[39m=\u001b[39m \u001b[39m\"\u001b[39m\u001b[39mG:\u001b[39m\u001b[39m\\\\\u001b[39;00m\u001b[39mShared drives\u001b[39m\u001b[39m\\\u001b[39m\u001b[39mPerceptual model review\u001b[39m\u001b[39m\\\\\u001b[39;00m\u001b[39mForRyoko\u001b[39m\u001b[39m\\\\\u001b[39;00m\u001b[39mperceptual-model-arcgis\u001b[39m\u001b[39m\\\\\u001b[39;00m\u001b[39mdev\u001b[39m\u001b[39m\\\\\u001b[39;00m\u001b[39mdata\u001b[39m\u001b[39m\\\\\u001b[39;00m\u001b[39mgiantTable_private.csv\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m 5\u001b[0m csv_properties\u001b[39m=\u001b[39m{\u001b[39m'\u001b[39m\u001b[39mtitle\u001b[39m\u001b[39m'\u001b[39m:\u001b[39m'\u001b[39m\u001b[39mprivate_dataset_v1\u001b[39m\u001b[39m'\u001b[39m,\n\u001b[0;32m 6\u001b[0m \u001b[39m'\u001b[39m\u001b[39mdescription\u001b[39m\u001b[39m'\u001b[39m:\u001b[39m'\u001b[39m\u001b[39mResults of perceptual model analysis. Including Figure and Text models. Private version, including all text models. Copyright figures are still not shown here.\u001b[39m\u001b[39m'\u001b[39m,\n\u001b[0;32m 7\u001b[0m \u001b[39m'\u001b[39m\u001b[39mtags\u001b[39m\u001b[39m'\u001b[39m:\u001b[39m'\u001b[39m\u001b[39mperceptual_model\u001b[39m\u001b[39m'\u001b[39m} \u001b[39m# Use different title for the new data \u001b[39;00m\n\u001b[1;32m----> 8\u001b[0m csv_item \u001b[39m=\u001b[39m gis\u001b[39m.\u001b[39mcontent\u001b[39m.\u001b[39madd(item_properties\u001b[39m=\u001b[39mcsv_properties, data\u001b[39m=\u001b[39mcsv_path)\n\u001b[0;32m 10\u001b[0m \u001b[39mprint\u001b[39m(csv_item)\n",
+ "\u001b[1;31mNameError\u001b[0m: name 'gis' is not defined"
+ ]
+ }
+ ],
+ "source": [
+ "# This section is to create a new webmap only\n",
+ "# Note: if this module says 'data already exist', skip to the section called 'Update to new data'\n",
+ "\n",
+ "csv_path = os.path.join(data_dir, \"giantTable_private.csv\")\n",
+ "csv_properties={'title':'private_dataset_v1',\n",
+ " 'description':'Results of perceptual model analysis. Including Figure and Text models. Private version, including all text models. Copyright figures are still not shown here.',\n",
+ " 'tags':'perceptual_model'} # Use different title for the new data \n",
+ "csv_item = gis.content.add(item_properties=csv_properties, data=csv_path)\n",
+ "\n",
+ "print(csv_item)"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "c6a5da6f",
+ "metadata": {},
+ "source": [
+ "### Publish a feature layer from the CSV item"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "id": "b61a8155",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "
- \n",
+ "0f495168b855499dbf628920f0d74da4\n"
+ ]
+ },
+ {
+ "data": {
+ "text/plain": [
+ "True"
+ ]
+ },
+ "execution_count": 4,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Note: this automatically converts latitude and longitude to point geometry\n",
+ "feature_layer_item = csv_item.publish()\n",
+ "print(feature_layer_item)\n",
+ "# Get feature layer id\n",
+ "feature_layer_id = feature_layer_item.id\n",
+ "print(feature_layer_id)\n",
+ "webbrowser.open('https://sdsugeo.maps.arcgis.com/apps/mapviewer/index.html?layers={}'.format(feature_layer_id), new=2)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "id": "332980ad",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "added_item = gis.content.get(feature_layer_id)"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "80c13878",
+ "metadata": {},
+ "source": [
+ "### Create a webmap from the feature layers "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "e1377980633644b088cd55b7f1d102af\n"
+ ]
+ },
+ {
+ "data": {
+ "text/html": [
+ "
\n",
+ "
\n",
+ "\n",
+ "
\n",
+ "
\n",
+ " "
+ ],
+ "text/plain": [
+ "- "
+ ]
+ },
+ "execution_count": 6,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Initialize map widget\n",
+ "webmap = gis.map()\n",
+ "\n",
+ "# Set an map extent (global)\n",
+ "webmap.extent = {'xmin': -140,\n",
+ " 'ymin':-50,\n",
+ " 'xmax':180,\n",
+ " 'ymax':65,\n",
+ " }\n",
+ "\n",
+ "# Add the created layer\n",
+ "webmap.add_layer(added_item)\n",
+ "\n",
+ "# Save the webmap\n",
+ "webmap_properties = {'title':'Perceptual Models Around the World v2.0',\n",
+ " 'snippet': 'description',\n",
+ " 'tags':'perceptual_model'}\n",
+ "\n",
+ "webmap_item = webmap.save(webmap_properties)\n",
+ "\n",
+ "# Display the webmap\n",
+ "webmap_item_id = webmap_item.id\n",
+ "print(webmap_item_id)\n",
+ "webbrowser.open('https://sdsugeo.maps.arcgis.com/apps/mapviewer/index.html?webmap={}'.format(webmap_item_id), new=2)\n",
+ "webmap_item"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "33a43684",
+ "metadata": {},
+ "source": [
+ "## Adjust display of webmap (need to run only after creating a new map)"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "bc7c98d0",
+ "metadata": {},
+ "source": [
+ "This code is written for Updating webmap layer, due to weird behavior of ArcGIS. \n",
+ "\n",
+ "- Editing webmap vs. feature layer\n",
+ " - Webmap can contain multiple feature layers, whereas feature layer is just a one gis layer. \n",
+ " - Webmap json will be pripritized over feature layer json, in terms of appearance setting (pop-up etc.) \n",
+ "\n",
+ "- What happens\n",
+ " - When you first create webmap, you can only edit the appearance (pop-up etc.) of the feature layers. \n",
+ " - However, once you edit something and save on webmap, variable \"['operationalLayers']\" appears in the webmap json. After that, you'll only be able to edit the appearance of feature layer via \"['operationalLayers']\" in the webmap json file. "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "id": "1e66c130",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "def get_map (map_id):\n",
+ " '''\n",
+ " GET MAP DATA FOR CHANGES\n",
+ " '''\n",
+ " \n",
+ " m = gis.content.get(map_id)\n",
+ "\n",
+ " data = m.get_data()\n",
+ " \n",
+ " #Include the below line for prettified JSON\n",
+ " #print(json.dumps(data, indent=4, sort_keys=True))\n",
+ "\n",
+ " print(m)\n",
+ " \n",
+ " return data\n",
+ " \n",
+ "def update_map (map_id, data):\n",
+ " '''\n",
+ " UPDATE MAP TO SAVE CHANGES\n",
+ " '''\n",
+ " m = gis.content.get(map_id)\n",
+ " \n",
+ " # Set the item_properties to include the desired update\n",
+ " properties = {\"text\": json.dumps(data)}\n",
+ "\n",
+ " # 'Commit' the updates to the Item\n",
+ " update = m.update(item_properties=properties)\n",
+ " \n",
+ " return update"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "3892bc98",
+ "metadata": {},
+ "source": [
+ "### Webmap update"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "id": "bf77e240",
+ "metadata": {
+ "scrolled": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "
- \n",
+ "{\n",
+ " \"authoringApp\": \"ArcGISMapViewer\",\n",
+ " \"authoringAppVersion\": \"2023.1\",\n",
+ " \"baseMap\": {\n",
+ " \"baseMapLayers\": [\n",
+ " {\n",
+ " \"id\": \"18700c0a454-layer-1\",\n",
+ " \"layerType\": \"ArcGISTiledMapServiceLayer\",\n",
+ " \"title\": \"World Topo Map\",\n",
+ " \"url\": \"https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer\"\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"Topographic\"\n",
+ " },\n",
+ " \"initialState\": {\n",
+ " \"viewpoint\": {\n",
+ " \"targetGeometry\": {\n",
+ " \"spatialReference\": {\n",
+ " \"latestWkid\": 3857,\n",
+ " \"wkid\": 102100\n",
+ " },\n",
+ " \"xmax\": 14378042.824526384,\n",
+ " \"xmin\": -3624406.0771935405,\n",
+ " \"ymax\": 8674404.05932065,\n",
+ " \"ymin\": -10091192.132798271\n",
+ " }\n",
+ " }\n",
+ " },\n",
+ " \"operationalLayers\": [\n",
+ " {\n",
+ " \"id\": \"128578565145\",\n",
+ " \"itemId\": \"0f495168b855499dbf628920f0d74da4\",\n",
+ " \"layerDefinition\": {\n",
+ " \"definitionExpression\": null,\n",
+ " \"drawingInfo\": {\n",
+ " \"renderer\": {\n",
+ " \"symbol\": {\n",
+ " \"angle\": 0,\n",
+ " \"contentType\": \"image/png\",\n",
+ " \"height\": 23.25,\n",
+ " \"imageData\": \"iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQBQYWludC5ORVQgdjMuNS4xTuc4+QAAB3VJREFUeF7tmPlTlEcexnve94U5mANQbgQSbgiHXHINlxpRIBpRI6wHorLERUmIisKCQWM8cqigESVQS1Kx1piNi4mW2YpbcZONrilE140RCTcy3DDAcL/zbJP8CYPDL+9Ufau7uqb7eZ7P+/a8PS8hwkcgIBAQCAgEBAICAYGAQEAgIBAQCAgEBAICAYGAQEAgIBAQCDx/AoowKXFMUhD3lQrioZaQRVRS+fxl51eBTZUTdZ41U1Rox13/0JF9csGJ05Qv4jSz/YPWohtvLmSKN5iTGGqTm1+rc6weICOBRbZs1UVnrv87T1PUeovxyNsUP9P6n5cpHtCxu24cbrmwKLdj+osWiqrVKhI0xzbmZ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BgYBAQCAgEBAICAQEAgIBgYBAQCAgEBAICAQEAv8H44b/6ZiGvGAAAAAASUVORK5CYII=\",\n",
+ " \"type\": \"esriPMS\",\n",
+ " \"url\": \"./RedSphere.png\",\n",
+ " \"width\": 23.25,\n",
+ " \"xoffset\": 0,\n",
+ " \"yoffset\": 0\n",
+ " },\n",
+ " \"type\": \"simple\"\n",
+ " }\n",
+ " }\n",
+ " },\n",
+ " \"layerType\": \"ArcGISFeatureLayer\",\n",
+ " \"opacity\": 1,\n",
+ " \"popupInfo\": {\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"id\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"id\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"model_type\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"model_type\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"citation\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"citation\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"url\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"url\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"attribution\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"attribution\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"attribution_url\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"attribution_url\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"figure_num\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"figure_num\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"figure_caption\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"figure_caption\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"figure_url\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"figure_url\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"textmodel_snipped\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"textmodel_snipped\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"textmodel_section_number\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"textmodel_section_number\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"textmodel_section_name\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"textmodel_section_name\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"textmodel_page_number\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"textmodel_page_number\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"watershed_name\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"watershed_name\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"lat\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"lat\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"lon\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"lon\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"area_km2\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"area_km2\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_spatial_zones\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"num_spatial_zones\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"spatial_property\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"spatial_property\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_temporal_zones\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"num_temporal_zones\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"temporal_property\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"temporal_property\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"vegetation_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"vegetation_info\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"soil_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"soil_info\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"geol_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"geol_info\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"topo_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"topo_info\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"three_d_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"three_d_info\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"uncertainty_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"uncertainty_info\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"other_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"other_info\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_store\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"num_store\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"store_list\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_id_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"store_id_list\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_flux\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"num_flux\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"flux_list\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_id_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"flux_id_list\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"dummy_column\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"dummy_column\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"huc_watershed_id\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"huc_watershed_id\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"ObjectId\",\n",
+ " \"label\": \"ObjectId\",\n",
+ " \"visible\": true\n",
+ " }\n",
+ " ],\n",
+ " \"popupElements\": [\n",
+ " {\n",
+ " \"type\": \"fields\"\n",
+ " },\n",
+ " {\n",
+ " \"displayType\": \"auto\",\n",
+ " \"type\": \"attachments\"\n",
+ " }\n",
+ " ],\n",
+ " \"showAttachments\": true,\n",
+ " \"title\": \"private_dataset_v1\"\n",
+ " },\n",
+ " \"title\": \"private_dataset_v1\",\n",
+ " \"url\": \"https://services1.arcgis.com/SIYkiqjmENweC50g/arcgis/rest/services/private_dataset_v1/FeatureServer/0\",\n",
+ " \"visibility\": true\n",
+ " }\n",
+ " ],\n",
+ " \"spatialReference\": {\n",
+ " \"latestWkid\": 3857,\n",
+ " \"wkid\": 102100\n",
+ " },\n",
+ " \"version\": \"2.27\"\n",
+ "}\n"
+ ]
+ }
+ ],
+ "source": [
+ "webmap_item_id = 'e1377980633644b088cd55b7f1d102af'\n",
+ "webmap_data = get_map(webmap_item_id)\n",
+ "print(json.dumps(webmap_data, indent=4, sort_keys=True))"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "5755f340",
+ "metadata": {},
+ "source": [
+ "### Feature layer update"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "cb1633fa",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "
- \n",
+ "{\n",
+ " \"layers\": [\n",
+ " {\n",
+ " \"id\": 0,\n",
+ " \"layerDefinition\": {\n",
+ " \"defaultVisibility\": true,\n",
+ " \"definitionExpression\": null,\n",
+ " \"drawingInfo\": {\n",
+ " \"renderer\": {\n",
+ " \"field1\": \"model_type\",\n",
+ " \"type\": \"uniqueValue\",\n",
+ " \"uniqueValueGroups\": [\n",
+ " {\n",
+ " \"classes\": [\n",
+ " {\n",
+ " \"label\": \"Text model\",\n",
+ " \"symbol\": {\n",
+ " \"angle\": 0,\n",
+ " \"contentType\": \"image/png\",\n",
+ " \"height\": 15,\n",
+ " \"imageData\": \"iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAmoSURBVHhe7Z1Lbt82EMZzhBwhixyhB8g+geG8H02RtEGbNk3TBEX3WXSfI2TRA+QIXmTVduFFD+JFD/DvfAIV29I3FClxKIriB/xg2BalGQ4kDh+irjQ1bUL37j+6JtwQ3gsfhRPHIYK+zAcB58H5rrlLNOWWCwACgaCcCSxoqcD5cZ0u8M6EptSSyr0qPBc+3b338D/5yYKRBXf9TwLsuepMbJorV5GoUFrhhdAF3JncFCKpMLSvaBetH8Opgb2wu7XjmqRybty5++BPV2GzePT46eHrp88Oz7/9/vDdi5eHH16+Ovz06s0kL3983R2PciiP87Dzh+L8aO13r6Oj219JhSCxoRXmA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za5kvoEL6lzy6IrC/HnPOeQH1q2TTi4EJiI7nI6fCiwKJbtVd83SXh1IXCTjdvHV2XC9FsGzNVLdDLQP2hHln9CmeofxcKW8nFjgcX/4L1lGTteAIMjl0I8kguSLtVIMdyoRrxLOcBabtLoZIL09Ew0AIdx0SAl49qLZH01z4TozpaGz3NRBuM/vBnV9XrSQzBCk+acYMWaJ2pAAuoV//Ky1yCIc4gZmjrRxN8/WBHOQHuBYOcYczgziGLeegtgnrYXIB7wTBfGw2QYOz18Q2/JxKsrg2Wn2UG+KLESDXrBphVsVorVirw1zOb1LNuFh0rMVjtR/dgIrz2uxr+eSb8L7JOP3ipxHCMjNEh0J6a2+qAthegfvKOZKWWG+tWE7IerEKs5REOPya6Rj2n2caic0ibphyy5WDDbs+S2UuYTxeuJUx0Y0UDc3oIkhQ87kpvs2Ef7AxIqjrgv9mEf0kSZ5GUedvqHrRp6HaUNpgCe2BXQJvbA3+3mVzNlTiMVaDertYQ3C3IVNd6nOO6uH7oXXsB+JlmVeUW5daO0Tc1pkD7h43KUPmpH+s4H86L84e2s4STXTyaQyUVckPaK/qSXSi4wxAQ3G0IDtpKBGoKHIfjUQ7lZ9ypl3B+zHs3aQ+SysFjHO9HB7XZBQF7Yfd+H8tzJBWGrS1Ge5gUBuwL28KhSZdUIma4uoCzDeVy4q7fBVYofyJhq5LKxbvT6IYhYbN+rOP8uA6u19rZtSSVj3a8DzzaRQQlNmPvy6B8F1Chta9NW9CVK/8Dprxw+rO3yFQAAAAASUVORK5CYII=\",\n",
+ " \"type\": \"esriPMS\",\n",
+ " \"url\": \"https://static.arcgis.com/images/Symbols/Government/Warrant.png\",\n",
+ " \"width\": 15,\n",
+ " \"xoffset\": 0,\n",
+ " \"yoffset\": 0\n",
+ " },\n",
+ " \"values\": [\n",
+ " [\n",
+ " \"Text model\"\n",
+ " ]\n",
+ " ]\n",
+ " },\n",
+ " {\n",
+ " \"label\": \"Figure model\",\n",
+ " \"symbol\": {\n",
+ " \"angle\": 0,\n",
+ " \"contentType\": \"image/png\",\n",
+ " \"height\": 18.75,\n",
+ " \"imageData\": \"iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAANaElEQVR4Xu2dz+ocSxXH5xHyCFncB3DhA+QRcsGFMYhXXIgIchERcZUr4kZuQlAQFMniigsRIiiCoAQMuhAuP0TuwoWKIOJCjKBwFy7G+aSmfulfzzmnqk6d6p6ZzBe+/Eimu7qqTp+/Vd29ueCC08D9x7d3vLPjgx2f7Phsz20D8zmPdqSdOzve3l/hgsXxSqAI5cWOktCiSPtcJwn+gkG4//jWjm/t+HTziUf/2f2VhLEM0/Wf7kh/bu17eIEbWbDSZB8Pk8AvaEDyr/jF0WY4mvSXfl/8uAr83b1339tPmI+f+s5285nvbzef++F28/kfbTdf+Ml288Wfl/n2T9PxnMf5tCO1X8s0jov/vsbHvvHR3YS0RsKJCAThIKivPNtuvvrrONIe7dI+15GuX+azl+N7bZHMMumONDky0TC0jcmXBDOaXJfrt2s643zNzHhKR+p87ie/vd189r3t5ku/kCd+LdIf+kX/pH4fkvE+2M/AGQPTde/hH2aDl/np7yafGm2Go0n/6GetdjP+szXhH3/36+Kg58T/rWWOe0m/a/0383E2ePOdN3aDujoY5JynLNw564V99XJ+Thr3H9/d0fa9+DTMnTRZp07GVfbZzM/d/YydGFJwJQ3qFYlUj93n9pLxMU5p/Dd5YkFZKTUiSDkX01xLxlsOzp7sZ/CIQcH+3sPns47fJGnHuWuvRsbN+KV5yUzzd6QLH2mlSA+wztn3trLsq5nHIxN0jYBXLGZ85Fvvb+987/cHvP3N34nHL0Lm42QEXRIwRY0FzPOtr/32peAe/Oqv26cf/HN79ff/blvw7M//fnke59OOdI1wMi/MjzRviUciaMsHDxYwGvroN39rFmgtEPzbP/vTWI0vCZr5XRVWFE2AIQ2qk0w42va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spRdCusPDqThfBz12rGpy/4T7lSHtyLVBmTS6CZ5+yry74XMj8LV7KikWrdekCWyS7EczHhjMNOjTKvlqtFLwFtmXLOUxY2/da3zN7k8OXCtcBCt7bDZE6CFMzdsfts+kc/y0FVIuMftuB/TEhBme2rM/FppB3HVkyhP/Sr7HMzGe+JBldepF2gdqo1J9pCpLqWOee6XL9Wa1+RcQbtqjxFpL1j8pMaJeL/eFEZkx9t1mmPdmm/1s8e8tnrYZprwbM82kN2tUTDEAjahnDwlQiqRI7jeM7j/HZNvck0DuezSa8Dkhnn+eg6n308pL/0+zU2yx6kV1scvsPkuEj/Kl/hcIGOtMKVBC69UG5JpusnwZ7EQsKpIj07TRpGwDbarNM+1+F6Fz+7GpIfv7MXBH4RobRG7Pkczk8CvfjXC04Dm83/AZ9peMb+hNWWAAAAAElFTkSuQmCC\",\n",
+ " \"type\": \"esriPMS\",\n",
+ " \"url\": \"https://static.arcgis.com/images/Symbols/Government/Water-Teatment-Plant-Permit.png\",\n",
+ " \"width\": 18.75,\n",
+ " \"xoffset\": 0,\n",
+ " \"yoffset\": 0\n",
+ " },\n",
+ " \"values\": [\n",
+ " [\n",
+ " \"Figure model\"\n",
+ " ]\n",
+ " ]\n",
+ " }\n",
+ " ]\n",
+ " }\n",
+ " ],\n",
+ " \"uniqueValueInfos\": [\n",
+ " {\n",
+ " \"label\": \"Text model\",\n",
+ " \"symbol\": {\n",
+ " \"angle\": 0,\n",
+ " \"contentType\": \"image/png\",\n",
+ " \"height\": 15,\n",
+ " \"imageData\": \"iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAmoSURBVHhe7Z1Lbt82EMZzhBwhixyhB8g+geG8H02RtEGbNk3TBEX3WXSfI2TRA+QIXmTVduFFD+JFD/DvfAIV29I3FClxKIriB/xg2BalGQ4kDh+irjQ1bUL37j+6JtwQ3gs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arcgis.com/images/Symbols/Government/Warrant.png\",\n",
+ " \"width\": 15,\n",
+ " \"xoffset\": 0,\n",
+ " \"yoffset\": 0\n",
+ " },\n",
+ " \"value\": \"Text model\"\n",
+ " },\n",
+ " {\n",
+ " \"label\": \"Figure model\",\n",
+ " \"symbol\": {\n",
+ " \"angle\": 0,\n",
+ " \"contentType\": \"image/png\",\n",
+ " \"height\": 18.75,\n",
+ " \"imageData\": \"iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAANaElEQVR4Xu2dz+ocSxXH5xHyCFncB3DhA+QRcsGFMYhXXIgIchERcZUr4kZuQlAQFMniigsRIiiCoAQMuhAuP0TuwoWKIOJCjKBwFy7G+aSmfulfzzmnqk6d6p6ZzBe+/Eimu7qqTp+/Vd29ueCC08D9x7d3vLPjgx2f7Phsz20D8zmPdqSdOzve3l/hgsXxSqAI5cWOktCiSPtcJwn+gkG4//jWjm/t+HTziUf/2f2VhLEM0/Wf7kh/bu17eIEbWbDSZB8Pk8AvaEDyr/jF0WY4mvSXfl/8uAr83b1339tPmI+f+s5285nvbzef++F28/kfbTdf+Ml288Wfl/n2T9PxnMf5tCO1X8s0jov/vsbHvvHR3YS0RsKJCAThIKivPNtuvvrrONIe7dI+15GuX+azl+N7bZHMMumONDky0TC0jcmXBDOaXJfrt2s643zNzHhKR+p87ie/vd189r3t5ku/kCd+LdIf+kX/pH4fkvE+2M/AGQPTde/hH2aDl/np7yafGm2Go0n/6GetdjP+szXhH3/36+Kg58T/rWWOe0m/a/0383E2ePOdN3aDujoY5JynLNw564V99XJ+Thr3H9/d0fa9+DTMnTRZp07GVfbZzM/d/YydGFJwJQ3qFYlUj93n9pLxMU5p/Dd5YkFZKTUiSDkX01xLxlsOzp7sZ/CIQcH+3sPns47fJGnHuWuvRsbN+KV5yUzzd6Q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wudSgz00RLRboopBFfRGo4GYzm4oULMsEbbB5MPP9/P9IpIOzzliBsOFvSUOQXCRxLV1mp7jrAJsnpSsGaWBJzmtbDzcimUBB2UR58VrTw48YgEnFEj6IDK2FmQeTg5AWfQMctHQwKMhcz30ZFx2wFW8sFHK+AprKgbsqrSuUx5cmS8+mpS5spRdCusPDqThfBz12rGpy/4T7lSHtyLVBmTS6CZ5+yry74XMj8LV7KikWrdekCWyS7EczHhjMNOjTKvlqtFLwFtmXLOUxY2/da3zN7k8OXCtcBCt7bDZE6CFMzdsfts+kc/y0FVIuMftuB/TEhBme2rM/FppB3HVkyhP/Sr7HMzGe+JBldepF2gdqo1J9pCpLqWOee6XL9Wa1+RcQbtqjxFpL1j8pMaJeL/eFEZkx9t1mmPdmm/1s8e8tnrYZprwbM82kN2tUTDEAjahnDwlQiqRI7jeM7j/HZNvck0DuezSa8Dkhnn+eg6n308pL/0+zU2yx6kV1scvsPkuEj/Kl/hcIGOtMKVBC69UG5JpusnwZ7EQsKpIj07TRpGwDbarNM+1+F6Fz+7GpIfv7MXBH4RobRG7Pkczk8CvfjXC04Dm83/AZ9peMb+hNWWAAAAAElFTkSuQmCC\",\n",
+ " \"type\": \"esriPMS\",\n",
+ " \"url\": \"https://static.arcgis.com/images/Symbols/Government/Water-Teatment-Plant-Permit.png\",\n",
+ " \"width\": 18.75,\n",
+ " \"xoffset\": 0,\n",
+ " \"yoffset\": 0\n",
+ " },\n",
+ " \"value\": \"Figure model\"\n",
+ " }\n",
+ " ],\n",
+ " \"visualVariables\": [\n",
+ " {\n",
+ " \"stops\": [\n",
+ " {\n",
+ " \"size\": 46.875,\n",
+ " \"value\": 1155581.108577\n",
+ " },\n",
+ " {\n",
+ " \"size\": 37.5,\n",
+ " \"value\": 9244648.868618\n",
+ " },\n",
+ " {\n",
+ " \"size\": 18.75,\n",
+ " \"value\": 73957190.948944\n",
+ " },\n",
+ " {\n",
+ " \"size\": 9.375,\n",
+ " \"value\": 591657527.591555\n",
+ " }\n",
+ " ],\n",
+ " \"type\": \"sizeInfo\",\n",
+ " \"valueExpression\": \"$view.scale\"\n",
+ " }\n",
+ " ]\n",
+ " },\n",
+ " \"transparency\": 0\n",
+ " }\n",
+ " },\n",
+ " \"popupInfo\": {\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"id\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Model ID\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"model_type\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Model type\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"citation\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Citation\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"url\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"URL\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"attribution\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Attribution\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"attribution_url\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Attribution link\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"figure_num\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Figure number\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"figure_caption\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Figure caption\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"figure_url\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Figure URL\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"textmodel_snipped\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Text model snipped\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"textmodel_section_number\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Text section number\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"textmodel_section_name\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Text section name\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"textmodel_page_number\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Text page number\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"watershed_name\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Watershed name\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"lat\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"latitude\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"lon\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"longitude\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"area_km2\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"longitude\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_spatial_zones\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of spatial zones\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"spatial_property\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Spatial property\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_temporal_zones\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of temporal zones\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"temporal_property\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Temporal property\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"vegetation_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Vegetation\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"soil_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Soil\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"geol_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Geology\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"topo_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Topography\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"three_d_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"3-dimensional description\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"uncertainty_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Uncertainty range\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"other_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Information: other\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_store\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of stores\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"List of stores\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_id_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Hashtags of stores\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_flux\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of fluxes\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"List of fluxes\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_id_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Hashtags of fluxes\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"dummy_column\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"dummy_column\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"huc_watershed_id\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"US HUC8\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"ObjectId\",\n",
+ " \"label\": \"ObjectID\",\n",
+ " \"visible\": false\n",
+ " }\n",
+ " ],\n",
+ " \"popupElements\": [\n",
+ " {\n",
+ " \"text\": \"
{model_type} of {watershed_name}
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"Text model: {textmodel_snipped}
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"mediaInfos\": [\n",
+ " {\n",
+ " \"altText\": \"Text model\",\n",
+ " \"caption\": \"Caption: {figure_caption}; From Figure {figure_num} in {citation}; {attribution}\",\n",
+ " \"refreshInterval\": 0,\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"image\",\n",
+ " \"value\": {\n",
+ " \"linkURL\": \"{url}\",\n",
+ " \"sourceURL\": \"{figure_url}\"\n",
+ " }\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"media\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Process information in the model
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"num_store\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of stores\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"List of stores\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_id_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Hashtags of stores\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_flux\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of fluxes\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"List of fluxes\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_id_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Hashtags of fluxes\",\n",
+ " \"visible\": true\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Spatio-temporal heterogeneity in the model
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"num_spatial_zones\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of spatial zones\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"spatial_property\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Spatial property\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_temporal_zones\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of temporal zones\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"temporal_property\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Temporal property\",\n",
+ " \"visible\": true\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Ancillary information in the model
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"vegetation_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Vegetation\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"soil_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Soil\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"geol_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Geology\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"topo_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Topography\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"uncertainty_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Uncertainty range\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"three_d_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"3-dimensional description\",\n",
+ " \"visible\": true\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Watershed information
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"area_km2\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Watershed area (km2)\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"huc_watershed_id\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"US HUC8 watershed ID\",\n",
+ " \"visible\": true\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " }\n",
+ " ],\n",
+ " \"showAttachments\": true,\n",
+ " \"title\": \"\"\n",
+ " }\n",
+ " }\n",
+ " ],\n",
+ " \"tables\": []\n",
+ "}\n"
+ ]
+ }
+ ],
+ "source": [
+ "feature_layer_id = '0f495168b855499dbf628920f0d74da4'\n",
+ "feature_layer_data = get_map(feature_layer_id)\n",
+ "print(json.dumps(feature_layer_data, indent=4, sort_keys=True))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "id": "8031f31f",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Update the basemaps\n",
+ "\n",
+ "# US HUC8 layer \n",
+ "HUC8_dict = {\n",
+ " \"id\": \"183343475b2-layer-50\",\n",
+ " \"itemId\": \"988c850f4c944d53bd29bd934dd6ac22\",\n",
+ " \"layerType\": \"ArcGISMapServiceLayer\",\n",
+ " \"opacity\": 0.25,\n",
+ " \"title\": \"Watershed Boundary Dataset (WBD) from NHDPlus Version 2.1 (Simplified/Nested), EPA OW\",\n",
+ " \"url\": \"https://watersgeo.epa.gov/arcgis/rest/services/NHDPlus_NP21/WBD_NP21_Simplified/MapServer\"\n",
+ " }\n",
+ "\n",
+ "# World waterbody maps\n",
+ "river_dict = {\n",
+ " \"id\": \"1830ae1b2b9-layer-53\",\n",
+ " \"itemId\": \"9f86716d941c4410b0b406d911754b2c\",\n",
+ " \"layerType\": \"ArcGISTiledMapServiceLayer\",\n",
+ " \"title\": \"Esri Hydro Reference Overlay\",\n",
+ " \"url\": \"https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Esri_Hydro_Reference_Overlay/MapServer\",\n",
+ " \"visibility\": True\n",
+ " }\n",
+ "\n",
+ "webmap_data['baseMap']['baseMapLayers'].append(HUC8_dict)\n",
+ "webmap_data['baseMap']['baseMapLayers'].append(river_dict)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "id": "66219435",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The dictionary is in correct order\n",
+ "id\n",
+ "Model ID\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "model_type\n",
+ "Model type\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "citation\n",
+ "Citation\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "url\n",
+ "URL\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "attribution\n",
+ "Attribution\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "attribution_url\n",
+ "Attribution link\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "figure_num\n",
+ "Figure number\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "figure_caption\n",
+ "Figure caption\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "figure_url\n",
+ "Figure URL\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "textmodel_snipped\n",
+ "Text model snipped\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "textmodel_section_number\n",
+ "Text section number\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "textmodel_section_name\n",
+ "Text section name\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "textmodel_page_number\n",
+ "Text page number\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "watershed_name\n",
+ "Watershed name\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "lat\n",
+ "latitude\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "lon\n",
+ "longitude\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "area_km2\n",
+ "longitude\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "num_spatial_zones\n",
+ "Number of spatial zones\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "spatial_property\n",
+ "Spatial property\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "num_temporal_zones\n",
+ "Number of temporal zones\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "temporal_property\n",
+ "Temporal property\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "vegetation_info\n",
+ "Vegetation\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "soil_info\n",
+ "Soil\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "geol_info\n",
+ "Geology\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "topo_info\n",
+ "Topography\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "three_d_info\n",
+ "3-dimensional description\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "uncertainty_info\n",
+ "Uncertainty range\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "other_info\n",
+ "Information: other\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "num_store\n",
+ "Number of stores\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "store_list\n",
+ "List of stores\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "store_id_list\n",
+ "Hashtags of stores\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "num_flux\n",
+ "Number of fluxes\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "flux_list\n",
+ "List of fluxes\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "flux_id_list\n",
+ "Hashtags of fluxes\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "dummy_column\n",
+ "dummy_column\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "huc_watershed_id\n",
+ "US HUC8\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "ObjectId\n",
+ "ObjectID\n",
+ "True\n",
+ "False\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Make some changes\n",
+ "\n",
+ "# Change the display names \n",
+ "mylabel_dict = {0:{\"fieldName\":\"id\",\"label\":\"Model ID\",\"visible\":False},\n",
+ " 1:{\"fieldName\":\"model_type\",\"label\":\"Model type\",\"visible\":False},\n",
+ " 2:{\"fieldName\":\"citation\",\"label\":\"Citation\",\"visible\":False},\n",
+ " 3:{\"fieldName\":\"url\",\"label\":\"URL\",\"visible\":False},\n",
+ " 4:{\"fieldName\":\"attribution\",\"label\":\"Attribution\",\"visible\":False},\n",
+ " 5:{\"fieldName\":\"attribution_url\",\"label\":\"Attribution link\",\"visible\":False},\n",
+ " 6:{\"fieldName\":\"figure_num\",\"label\":\"Figure number\",\"visible\":False},\n",
+ " 7:{\"fieldName\":\"figure_caption\",\"label\":\"Figure caption\",\"visible\":False},\n",
+ " 8:{\"fieldName\":\"figure_url\",\"label\":\"Figure URL\",\"visible\":False},\n",
+ " 9:{\"fieldName\":\"textmodel_snipped\",\"label\":\"Text model snipped\",\"visible\":True},\n",
+ " 10:{\"fieldName\":\"textmodel_section_number\",\"label\":\"Text section number\",\"visible\":False},\n",
+ " 11:{\"fieldName\":\"textmodel_section_name\",\"label\":\"Text section name\",\"visible\":False},\n",
+ " 12:{\"fieldName\":\"textmodel_page_number\",\"label\":\"Text page number\",\"visible\":False},\n",
+ " 13:{\"fieldName\":\"watershed_name\",\"label\":\"Watershed name\",\"visible\":True},\n",
+ " 14:{\"fieldName\":\"lat\",\"label\":\"latitude\",\"visible\":False},\n",
+ " 15:{\"fieldName\":\"lon\",\"label\":\"longitude\",\"visible\":False},\n",
+ " 16:{\"fieldName\":\"area_km2\",\"label\":\"longitude\",\"visible\":False},\n",
+ " 17:{\"fieldName\":\"num_spatial_zones\",\"label\":\"Number of spatial zones\",\"visible\":True},\n",
+ " 18:{\"fieldName\":\"spatial_property\",\"label\":\"Spatial property\",\"visible\":True},\n",
+ " 19:{\"fieldName\":\"num_temporal_zones\",\"label\":\"Number of temporal zones\",\"visible\":True},\n",
+ " 20:{\"fieldName\":\"temporal_property\",\"label\":\"Temporal property\",\"visible\":True},\n",
+ " 21:{\"fieldName\":\"vegetation_info\",\"label\":\"Vegetation\",\"visible\":True},\n",
+ " 22:{\"fieldName\":\"soil_info\",\"label\":\"Soil\",\"visible\":True},\n",
+ " 23:{\"fieldName\":\"geol_info\",\"label\":\"Geology\",\"visible\":True},\n",
+ " 24:{\"fieldName\":\"topo_info\",\"label\":\"Topography\",\"visible\":True},\n",
+ " 25:{\"fieldName\":\"three_d_info\",\"label\":\"3-dimensional description\",\"visible\":True},\n",
+ " 26:{\"fieldName\":\"uncertainty_info\",\"label\":\"Uncertainty range\",\"visible\":True},\n",
+ " 27:{\"fieldName\":\"other_info\",\"label\":\"Information: other\",\"visible\":True},\n",
+ " 28:{\"fieldName\":\"num_store\",\"label\":\"Number of stores\",\"visible\":True},\n",
+ " 29:{\"fieldName\":\"store_list\",\"label\":\"List of stores\",\"visible\":True},\n",
+ " 30:{\"fieldName\":\"store_id_list\",\"label\":\"Hashtags of stores\",\"visible\":True},\n",
+ " 31:{\"fieldName\":\"num_flux\",\"label\":\"Number of fluxes\",\"visible\":True},\n",
+ " 32:{\"fieldName\":\"flux_list\",\"label\":\"List of fluxes\",\"visible\":True},\n",
+ " 33:{\"fieldName\":\"flux_id_list\",\"label\":\"Hashtags of fluxes\",\"visible\":True},\n",
+ " 34:{\"fieldName\":\"dummy_column\",\"label\":\"dummy_column\",\"visible\":False},\n",
+ " 35:{\"fieldName\":\"huc_watershed_id\",\"label\":\"US HUC8\",\"visible\":False},\n",
+ " 36:{\"fieldName\":\"ObjectId\",\"label\":\"ObjectID\",\"visible\":False}\n",
+ " }\n",
+ "\n",
+ "for i in range(len(mylabel_dict)): \n",
+ " if webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['fieldName'] == mylabel_dict[i]['fieldName']:\n",
+ " print('The dictionary is in correct order')\n",
+ " \n",
+ " print(webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['label'])\n",
+ " webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['label'] = mylabel_dict[i]['label']\n",
+ " print(webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['label'])\n",
+ "\n",
+ " print(webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['visible'])\n",
+ " webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['visible'] = mylabel_dict[i]['visible']\n",
+ " print(webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['visible'])\n",
+ " else:\n",
+ " print('The dictionary is in wrong order')"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "id": "2168e832",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Turn off the layer name\n",
+ "webmap_data['operationalLayers'][0]['popupInfo']['title'] = \"\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "id": "8bb3bf8b",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# TODO: Add 'hand drawn figures' later \n",
+ "render = {'type': 'uniqueValue',\n",
+ " 'visualVariables': [{'type': 'sizeInfo',\n",
+ " 'valueExpression': '$view.scale',\n",
+ " 'stops': [{'size': 46.875, 'value': 1155581.108577},\n",
+ " {'size': 37.5, 'value': 9244648.868618},\n",
+ " {'size': 18.75, 'value': 73957190.948944},\n",
+ " {'size': 9.375, 'value': 591657527.591555}]}],\n",
+ " 'field1': 'model_type',\n",
+ " 'uniqueValueGroups': [{'classes': [{'label': 'Text model',\n",
+ " 'symbol': {'type': 'esriPMS',\n",
+ " 'angle': 0,\n",
+ " 'xoffset': 0,\n",
+ " 'yoffset': 0,\n",
+ " 'contentType': 'image/png',\n",
+ " 'imageData': 'iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAmoSURBVHhe7Z1Lbt82EMZzhBwhixyhB8g+geG8H02RtEGbNk3TBEX3WXSfI2TRA+QIXmTVduFFD+JFD/DvfAIV29I3FClxKIriB/xg2BalGQ4kDh+irjQ1bUL37j+6JtwQ3gsfhRPHIYK+zAcB58H5rrlLNOWWCwACgaCcCSxoqcD5cZ0u8M6EptSSyr0qPBc+3b338D/5yYKRBXf9TwLsuepMbJorV5GoUFrhhdAF3JncFCKpMLSvaBetH8Opgb2wu7XjmqRybty5++BPV2GzePT46eHrp88Oz7/9/vDdi5eHH16+Ovz06s0kL3983R2PciiP87Dzh+L8aO13r6Oj219JhSCxoRXmAwFBcBCoN7/+dnj77vdk4Hw4L86P67DrB3AC/5yr+5NUAB7L6O6wyqHgDsPdhspngbEG18X1Z9zp8HNfj3FxGN2RoDb3wcMnh2fPXxx+fv2WVvxawB7YBfuY3QT4+95VQb3Co0vaq38HzlMeP/mma1NTP4ZTA/tgJ+xlfgyB/9U+wm/fuf8Hc3oI2r+1HsdLgd2h7Tfqw1XN9nXz1tF1cep06OSQLQd3SESwT1E/rqq2KXHiWPC2vWjT8LhjlbV14FdAm436OXZVti2J4UiumFNfQKZaepu7FPgHP5n/A7aVlInB3q4RuiC1PJpDgb8BXa+PrgrLlRh5VbLHzwPDL4FuR+13rwb8hv+sXnpc/ZU58QHDBDXBqrntjSWgrUY9lhVoGOQMYwZ3DpU2mLE2qI/NBBqGOIOYod0gwV4fz1OgXiYGUcoItK8NbgGeZirQqF9X1etIjFCzaCQYzKkGZyIhWyfrlgur/eAW4HlMBDpvP1ouiJEsZkj36GEONMKY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VaDertYQ3C3IVNd6nOO6uH7oXXsB+JlmVeUW5daO0Tc1pkD7h43KUPmpH+s4H86L84e2s4STXTyaQyUVckPaK/qSXSi4wxAQ3G0IDtpKBGoKHIfjUQ7lZ9ypl3B+zHs3aQ+SysFjHO9HB7XZBQF7Yfd+H8tzJBWGrS1Ge5gUBuwL28KhSZdUIma4uoCzDeVy4q7fBVYofyJhq5LKxbvT6IYhYbN+rOP8uA6u19rZtSSVj3a8DzzaRQQlNmPvy6B8F1Chta9NW9CVK/8Dprxw+rO3yFQAAAAASUVORK5CYII=',\n",
+ " 'url': 'https://static.arcgis.com/images/Symbols/Government/Warrant.png',\n",
+ " 'height': 15,\n",
+ " 'width': 15},\n",
+ " 'values': [['Text model']]},\n",
+ " {'label': 'Figure model',\n",
+ " 'symbol': {'type': 'esriPMS',\n",
+ " 'angle': 0,\n",
+ " 'xoffset': 0,\n",
+ " 'yoffset': 0,\n",
+ " 'contentType': 'image/png',\n",
+ " 'imageData': 'iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAANaElEQVR4Xu2dz+ocSxXH5xHyCFncB3DhA+QRcsGFMYhXXIgIchERcZUr4kZuQlAQFMniigsRIiiCoAQMuhAuP0TuwoWKIOJCjKBwFy7G+aSmfulfzzmnqk6d6p6ZzBe+/Eimu7qqTp+/Vd29ueCC08D9x7d3vLPjgx2f7Phsz20D8zmPdqSdOzve3l/hgsXxSqAI5cWOktCiSPtcJwn+gkG4//jWjm/t+HTziUf/2f2VhLEM0/Wf7kh/bu17eIEbWbDSZB8Pk8AvaEDyr/jF0WY4mvSXfl/8uAr83b1339tPmI+f+s5285nvbzef++F28/kfbTdf+Ml288Wfl/n2T9PxnMf5tCO1X8s0jov/vsbHvvHR3YS0RsKJCAThIKivPNtuvvrrONIe7dI+15GuX+azl+N7b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hT6tH0oC+hA76lL12QqM+x5jwn5qlUGdOQBY5gvOVCbhYsBLFCtiw1y4AtMIU6JfOpRdPIYSjuP746uCjsTKumRFAt5lsC5zOh3DRMqkaOgRo4RurjlBaqhTqllS4x/8Px5jtv7C4kR9usVAUJGq1GM9dGq5AJmLJFkY4tkvljHqX5Zd6Z/0Vw//Hd2cVf0bkkqbF1RSkaXFvq15RZqCH5vC5geHcvgYWgpVUwIOKeMwu714y3Al8v9WcI9e08MDhdqoVWDYMDBA3RFoIjzOJSWKSObgs4oKrVg3sPnwudSgz00RLRboopBFfRGo4GYzm4oULMsEbbB5MPP9/P9IpIOzzliBsOFvSUOQXCRxLV1mp7jrAJsnpSsGaWBJzmtbDzcimUBB2UR58VrTw48YgEnFEj6IDK2FmQeTg5AWfQMctHQwKMhcz30ZFx2wFW8sFHK+AprKgbsqrSuUx5cmS8+mpS5spRdCusPDqThfBz12rGpy/4T7lSHtyLVBmTS6CZ5+yry74XMj8LV7KikWrdekCWyS7EczHhjMNOjTKvlqtFLwFtmXLOUxY2/da3zN7k8OXCtcBCt7bDZE6CFMzdsfts+kc/y0FVIuMftuB/TEhBme2rM/FppB3HVkyhP/Sr7HMzGe+JBldepF2gdqo1J9pCpLqWOee6XL9Wa1+RcQbtqjxFpL1j8pMaJeL/eFEZkx9t1mmPdmm/1s8e8tnrYZprwbM82kN2tUTDEAjahnDwlQiqRI7jeM7j/HZNvck0DuezSa8Dkhnn+eg6n308pL/0+zU2yx6kV1scvsPkuEj/Kl/hcIGOtMKVBC69UG5JpusnwZ7EQsKpIj07TRpGwDbarNM+1+F6Fz+7GpIfv7MXBH4RobRG7Pkczk8CvfjXC04Dm83/AZ9peMb+hNWWAAAAAElFTkSuQmCC',\n",
+ " 'url': 'https://static.arcgis.com/images/Symbols/Government/Water-Teatment-Plant-Permit.png',\n",
+ " 'height': 18.75,\n",
+ " 'width': 18.75},\n",
+ " 'values': [['Figure model']]}]}],\n",
+ " 'uniqueValueInfos': [{'label': 'Text model',\n",
+ " 'symbol': {'type': 'esriPMS',\n",
+ " 'angle': 0,\n",
+ " 'xoffset': 0,\n",
+ " 'yoffset': 0,\n",
+ " 'contentType': 'image/png',\n",
+ " 'imageData': 'iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAmoSURBVHhe7Z1Lbt82EMZzhBwhixyhB8g+geG8H02RtEGbNk3TBEX3WXSfI2TRA+QIXmTVduFFD+JFD/DvfAIV29I3FClxKIriB/xg2BalGQ4kDh+irjQ1bUL37j+6JtwQ3gsfhRPHIYK+zAcB58H5rrlLNOWWCwACgaCcCSxoqcD5cZ0u8M6EptSSyr0qPBc+3b338D/5yYKRBXf9TwLsuepMbJorV5GoUFrhhdAF3JncFCKpMLSvaBetH8Opgb2wu7XjmqRybty5++BPV2GzePT46eHrp88Oz7/9/vDdi5eHH16+Ovz06s0kL3983R2PciiP87Dzh+L8aO13r6Oj219JhSCxoRXmAwFBcBCoN7/+dnj77vdk4Hw4L86P67DrB3AC/5yr+5NUAB7L6O6wyqHgDsPdhspngbEG18X1Z9zp8HNfj3FxGN2RoDb3wcMnh2fPXxx+fv2WVvxawB7YBfuY3QT4+95VQb3Co0vaq38HzlMeP/mma1NTP4ZTA/tgJ+xlfgyB/9U+wm/fuf8Hc3oI2r+1HsdLgd2h7Tfqw1XN9nXz1tF1cep06OSQLQd3SESwT1E/rqq2KXHiWPC2vWjT8LhjlbV14FdAm436OXZVti2J4UiumFNfQKZaepu7FPgHP5n/A7aVlInB3q4RuiC1PJpDgb8BXa+PrgrLlRh5VbLHzwPDL4FuR+13rwb8hv+sXnpc/ZU58QHDBDXBqrntjSWgrUY9lhVoGOQMYwZ3DpU2mLE2qI/NBBqGOIOYod0gwV4fz1OgXiYGUcoItK8NbgGeZirQqF9X1etIjFCzaCQYzKkGZyIhWyfrlgur/eAW4HlMBDpvP1ouiJEs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+3mVzNlTiMVaDertYQ3C3IVNd6nOO6uH7oXXsB+JlmVeUW5daO0Tc1pkD7h43KUPmpH+s4H86L84e2s4STXTyaQyUVckPaK/qSXSi4wxAQ3G0IDtpKBGoKHIfjUQ7lZ9ypl3B+zHs3aQ+SysFjHO9HB7XZBQF7Yfd+H8tzJBWGrS1Ge5gUBuwL28KhSZdUIma4uoCzDeVy4q7fBVYofyJhq5LKxbvT6IYhYbN+rOP8uA6u19rZtSSVj3a8DzzaRQQlNmPvy6B8F1Chta9NW9CVK/8Dprxw+rO3yFQAAAAASUVORK5CYII=',\n",
+ " 'url': 'https://static.arcgis.com/images/Symbols/Government/Warrant.png',\n",
+ " 'height': 15,\n",
+ " 'width': 15},\n",
+ " 'value': 'Text model'},\n",
+ " {'label': 'Figure model',\n",
+ " 'symbol': {'type': 'esriPMS',\n",
+ " 'angle': 0,\n",
+ " 'xoffset': 0,\n",
+ " 'yoffset': 0,\n",
+ " 'contentType': 'image/png',\n",
+ " 'imageData': 'iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAANaElEQVR4Xu2dz+ocSxXH5xHyCFncB3DhA+QRcsGFMYhXXIgIchERcZUr4kZuQlAQFMniigsRIiiCoAQMuhAuP0TuwoWKIOJCjKBwFy7G+aSmfulfzzmnqk6d6p6ZzBe+/Eimu7qqTp+/Vd29ueCC08D9x7d3vLPjgx2f7Phsz20D8zmPdqSdOzve3l/hgsXxSqAI5cWOktCiSPtcJwn+gkG4//jWjm/t+HTziUf/2f2VhLEM0/Wf7kh/bu17eIEbWbDSZB8Pk8AvaEDyr/jF0WY4mvSXfl/8uAr83b1339tPmI+f+s5285nvbzef++F28/kfbTdf+Ml288Wfl/n2T9PxnMf5tCO1X8s0jov/vsbHvvHR3YS0RsKJCAThIKivPNtuvvrrONIe7dI+15G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rHGcvTgQKhT6tH0oC+hA76lL12QqM+x5jwn5qlUGdOQBY5gvOVCbhYsBLFCtiw1y4AtMIU6JfOpRdPIYSjuP746uCjsTKumRFAt5lsC5zOh3DRMqkaOgRo4RurjlBaqhTqllS4x/8Px5jtv7C4kR9usVAUJGq1GM9dGq5AJmLJFkY4tkvljHqX5Zd6Z/0Vw//Hd2cVf0bkkqbF1RSkaXFvq15RZqCH5vC5geHcvgYWgpVUwIOKeMwu714y3Al8v9WcI9e08MDhdqoVWDYMDBA3RFoIjzOJSWKSObgs4oKrVg3sPnwudSgz00RLRboopBFfRGo4GYzm4oULMsEbbB5MPP9/P9IpIOzzliBsOFvSUOQXCRxLV1mp7jrAJsnpSsGaWBJzmtbDzcimUBB2UR58VrTw48YgEnFEj6IDK2FmQeTg5AWfQMctHQwKMhcz30ZFx2wFW8sFHK+AprKgbsqrSuUx5cmS8+mpS5spRdCusPDqThfBz12rGpy/4T7lSHtyLVBmTS6CZ5+yry74XMj8LV7KikWrdekCWyS7EczHhjMNOjTKvlqtFLwFtmXLOUxY2/da3zN7k8OXCtcBCt7bDZE6CFMzdsfts+kc/y0FVIuMftuB/TEhBme2rM/FppB3HVkyhP/Sr7HMzGe+JBldepF2gdqo1J9pCpLqWOee6XL9Wa1+RcQbtqjxFpL1j8pMaJeL/eFEZkx9t1mmPdmm/1s8e8tnrYZprwbM82kN2tUTDEAjahnDwlQiqRI7jeM7j/HZNvck0DuezSa8Dkhnn+eg6n308pL/0+zU2yx6kV1scvsPkuEj/Kl/hcIGOtMKVBC69UG5JpusnwZ7EQsKpIj07TRpGwDbarNM+1+F6Fz+7GpIfv7MXBH4RobRG7Pkczk8CvfjXC04Dm83/AZ9peMb+hNWWAAAAAElFTkSuQmCC',\n",
+ " 'url': 'https://static.arcgis.com/images/Symbols/Government/Water-Teatment-Plant-Permit.png',\n",
+ " 'height': 18.75,\n",
+ " 'width': 18.75},\n",
+ " 'value': 'Figure model'}]}\n",
+ "\n",
+ "webmap_data['operationalLayers'][0]['layerDefinition']['drawingInfo']['renderer'] = render\n",
+ "# feature_layer_data['layers'][0]['layerDefinition']['drawingInfo']['renderer']['uniqueValueInfos']\n",
+ "# feature_layer_data['layers'][0]['layerDefinition']['drawingInfo']['renderer']['field1'] == 'model_type' #['uniqueValueGroups'] #['uniqueValueGroups'] #['drawingInfo'] #['renderer']['symbol']['imageData']\n",
+ "\n",
+ "# Update the icon to prettier one\n",
+ "# webmap_data['operationalLayers'][0]['layerDefinition']['drawingInfo']['renderer']['symbol']['url'] = \"https://static.arcgis.com/images/Symbols/Government/Water-Teatment-Plant-Permit.png\"\n",
+ "# webmap_data['operationalLayers'][0]['layerDefinition']['drawingInfo']['renderer']['symbol']['imageData'] = \"iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAANaElEQVR4Xu2dz+ocSxXH5xHyCFncB3DhA+QRcsGFMYhXXIgIchERcZUr4kZuQlAQFMniigsRIiiCoAQMuhAuP0TuwoWKIOJCjKBwFy7G+aSmfulfzzmnqk6d6p6ZzBe+/Eimu7qqTp+/Vd29ueCC08D9x7d3vLPjgx2f7Phsz20D8zmPdqSdOzve3l/hgsXxSqAI5cWOktCiSPtcJwn+gkG4//jWjm/t+HTziUf/2f2VhLEM0/Wf7kh/bu17eIEbWbDSZB8Pk8AvaEDyr/jF0WY4mvSXfl/8uAr83b1339tPmI+f+s5285nvbzef++F28/kfbTdf+Ml288Wfl/n2T9PxnMf5tCO1X8s0jov/vsbHvvHR3YS0RsKJCAThIKivPNtuvvrrONIe7dI+15GuX+azl+N7bZHMMumONDky0TC0jcmXBDOaXJfrt2s643zNzHhKR+p87ie/vd189r3t5ku/kCd+LdIf+kX/pH4fkvE+2M/AGQPTde/hH2aDl/np7yafGm2Go0n/6GetdjP+szXhH3/36+Kg58T/rWWOe0m/a/0383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usVAUJGq1GM9dGq5AJmLJFkY4tkvljHqX5Zd6Z/0Vw//Hd2cVf0bkkqbF1RSkaXFvq15RZqCH5vC5geHcvgYWgpVUwIOKeMwu714y3Al8v9WcI9e08MDhdqoVWDYMDBA3RFoIjzOJSWKSObgs4oKrVg3sPnwudSgz00RLRboopBFfRGo4GYzm4oULMsEbbB5MPP9/P9IpIOzzliBsOFvSUOQXCRxLV1mp7jrAJsnpSsGaWBJzmtbDzcimUBB2UR58VrTw48YgEnFEj6IDK2FmQeTg5AWfQMctHQwKMhcz30ZFx2wFW8sFHK+AprKgbsqrSuUx5cmS8+mpS5spRdCusPDqThfBz12rGpy/4T7lSHtyLVBmTS6CZ5+yry74XMj8LV7KikWrdekCWyS7EczHhjMNOjTKvlqtFLwFtmXLOUxY2/da3zN7k8OXCtcBCt7bDZE6CFMzdsfts+kc/y0FVIuMftuB/TEhBme2rM/FppB3HVkyhP/Sr7HMzGe+JBldepF2gdqo1J9pCpLqWOee6XL9Wa1+RcQbtqjxFpL1j8pMaJeL/eFEZkx9t1mmPdmm/1s8e8tnrYZprwbM82kN2tUTDEAjahnDwlQiqRI7jeM7j/HZNvck0DuezSa8Dkhnn+eg6n308pL/0+zU2yx6kV1scvsPkuEj/Kl/hcIGOtMKVBC69UG5JpusnwZ7EQsKpIj07TRpGwDbarNM+1+F6Fz+7GpIfv7MXBH4RobRG7Pkczk8CvfjXC04Dm83/AZ9peMb+hNWWAAAAAElFTkSuQmCC\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "id": "eed843dc",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Change the pop-up\n",
+ "webmap_data['operationalLayers'][0]['popupInfo']['popupElements'] = [\n",
+ " {\n",
+ " \"text\": \"Perceptual model of {watershed_name}
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"mediaInfos\": [\n",
+ " {\n",
+ " \"altText\": \"\",\n",
+ " \"caption\": \"{citation}; {attribution};  From Figure {figure_num};  Caption: {figure_caption}; Section {textmodel_section_number} “{textmodel_section_name}” of pp.{textmodel_page_number}\",\n",
+ " \"refreshInterval\": 0,\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"image\",\n",
+ " \"value\": {\n",
+ " \"linkURL\": \"{url}\",\n",
+ " \"sourceURL\": \"{figure_url}\"\n",
+ " }\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"media\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"Text model{textmodel_snipped}
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Process information in the model
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"num_store\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Number of stores\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_list\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"List of stores\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_id_list\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Hashtags of stores\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_flux\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Number of fluxes\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_list\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"List of fluxes\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_id_list\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Hashtags of fluxes\",\n",
+ " \"visible\": True\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Spatio-temporal heterogeneity in the model
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"num_spatial_zones\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Number of spatial zones\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"spatial_property\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Spatial property\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_temporal_zones\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Number of temporal zones\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"temporal_property\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Temporal property\",\n",
+ " \"visible\": True\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Ancillary information in the model
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"vegetation_info\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Vegetation\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"soil_info\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Soil\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"geol_info\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Geology\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"topo_info\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Topography\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"uncertainty_info\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Uncertainty range\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"three_d_info\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"3-dimensional description\",\n",
+ " \"visible\": True\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Watershed information
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"area_km2\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Watershed area (km2)\",\n",
+ " \"visible\": True\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " }\n",
+ " ]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "id": "01251618",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "True"
+ ]
+ },
+ "execution_count": 14,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# # Update the map\n",
+ "# feature_layer_update = update_map(feature_layer_id, feature_layer_data)\n",
+ "# feature_layer_update\n",
+ "\n",
+ "# Update the map\n",
+ "webmap_update = update_map(webmap_item_id, webmap_data)\n",
+ "webmap_update"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "id": "4f8a2737",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "True"
+ ]
+ },
+ "execution_count": 15,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Verify changes updated\n",
+ "webbrowser.open('https://sdsugeo.maps.arcgis.com/apps/mapviewer/index.html?webmap={}'.format(webmap_item_id), new=2)\n",
+ "\n",
+ "# https://sdsugeo.maps.arcgis.com/apps/mapviewer/index.html?webmap=e535103892fd41cd915d60ca4d1d9d44"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "71111d63",
+ "metadata": {},
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "arcgis",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.9.0"
+ },
+ "vscode": {
+ "interpreter": {
+ "hash": "3140ae756112501f18b23ec79a6bbbb54e715b030c96600dfefb60d12a8f240f"
+ }
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/src/init_create_webmap_public.ipynb b/src/init_create_webmap_public.ipynb
new file mode 100644
index 0000000..6091712
--- /dev/null
+++ b/src/init_create_webmap_public.ipynb
@@ -0,0 +1,2349 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "17ab89f6",
+ "metadata": {},
+ "source": [
+ "# Create ArcGIS webmap on perceptual-model database\n",
+ "\n",
+ "I referred to Jessica's instruction to create this notebook https://github.com/jlembury/GEOG594-Embury/blob/master/DEMO_ArcGIS_API_Python.ipynb"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0109e593",
+ "metadata": {},
+ "source": [
+ "# Config"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "2d15ac2b",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "data_dir = f\"G:\\Shared drives\\Perceptual model review\\ForRyoko\\data\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "4d8e4271",
+ "metadata": {},
+ "source": [
+ "## Import modules"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "22ba798c-c407-427b-9f94-de4752a43cd2",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import os\n",
+ "import webbrowser\n",
+ "import pandas as pd\n",
+ "pd.options.mode.chained_assignment = None # default='warn'\n",
+ "import json\n",
+ "from arcgis.gis import GIS"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "463eae66",
+ "metadata": {},
+ "source": [
+ "## Connect with ArcGIS\n",
+ "Reference for authentication schemes: https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "9f19dd88",
+ "metadata": {},
+ "source": [
+ "I ended up in using User autentification with OAuth 2.0 in Reference for authentication schemes: https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/\n",
+ "\n",
+ "Note: log-in expires after an hour or so.\n",
+ "When commands return \"Exception: A general error occurred: 'Response' object is not subscriptable\", log-in again. "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "5328c70c",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "with open('./auth.json', 'r') as infile:\n",
+ " my_credentials = json.load(infile)\n",
+ "\n",
+ "gis = GIS(\"https://sdsugeo.maps.arcgis.com/\", client_id=my_credentials['client_id'])\n",
+ "print(\"Successfully logged in as: \" + gis.properties.user.username)\n",
+ "\n",
+ "# Clear the output for security \n",
+ "from IPython.display import clear_output\n",
+ "clear_output(wait=False)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "bfa15a0b",
+ "metadata": {},
+ "source": [
+ "open"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0108b7af",
+ "metadata": {},
+ "source": [
+ "If you have ArcGIS pro, this is the most straightforward and easy connection"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "da85ed62",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# gis = GIS('Pro')\n",
+ "# print(\"Logged in as \" + str(gis.properties.user.username))"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "f70e7222",
+ "metadata": {},
+ "source": [
+ "## Newly create a webmap (skip the rest of the blocks if you are updating)"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "84b0fa5d",
+ "metadata": {},
+ "source": [
+ "### Publish the CSV data to ArcGIS online"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "aee09ff8",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "- \n"
+ ]
+ }
+ ],
+ "source": [
+ "# This section is to create a new webmap only\n",
+ "# Note: if this module says 'data already exist', skip to the section called 'Update to new data'\n",
+ "csv_path = os.path.join(data_dir, \"giantTable_public.csv\")\n",
+ "csv_path = \"G:\\\\Shared drives\\Perceptual model review\\\\ForRyoko\\\\perceptual-model-arcgis\\\\dev\\\\data\\\\giantTable_incl_allModelTypes_v1.csv\"\n",
+ "csv_properties={'title':'alltype_models_v1',\n",
+ " 'description':'Results of perceptual model analysis. Including Figure and Text models',\n",
+ " 'tags':'perceptual_model'} # Use different title for the new data \n",
+ "csv_item = gis.content.add(item_properties=csv_properties, data=csv_path)\n",
+ "\n",
+ "print(csv_item)"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "c6a5da6f",
+ "metadata": {},
+ "source": [
+ "### Publish a feature layer from the CSV item"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "b61a8155",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "NameError",
+ "evalue": "name 'csv_item' is not defined",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
+ "Cell \u001b[1;32mIn[119], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[39m# Note: this automatically converts latitude and longitude to point geometry\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m feature_layer_item \u001b[39m=\u001b[39m csv_item\u001b[39m.\u001b[39mpublish()\n\u001b[0;32m 3\u001b[0m \u001b[39mprint\u001b[39m(feature_layer_item)\n\u001b[0;32m 4\u001b[0m \u001b[39m# Get feature layer id\u001b[39;00m\n",
+ "\u001b[1;31mNameError\u001b[0m: name 'csv_item' is not defined"
+ ]
+ }
+ ],
+ "source": [
+ "# Note: this automatically converts latitude and longitude to point geometry\n",
+ "feature_layer_item = csv_item.publish()\n",
+ "print(feature_layer_item)\n",
+ "# Get feature layer id\n",
+ "feature_layer_id = feature_layer_item.id\n",
+ "print(feature_layer_id)\n",
+ "webbrowser.open('https://sdsugeo.maps.arcgis.com/apps/mapviewer/index.html?layers={}'.format(feature_layer_id), new=2)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "332980ad",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "added_item = gis.content.get(feature_layer_id)"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "80c13878",
+ "metadata": {},
+ "source": [
+ "### Create a webmap from the feature layers "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "94bdbb06d8aa435598182f21c9ba067c\n"
+ ]
+ },
+ {
+ "data": {
+ "text/html": [
+ "
\n",
+ "
\n",
+ "\n",
+ "
\n",
+ "
\n",
+ " "
+ ],
+ "text/plain": [
+ "- "
+ ]
+ },
+ "execution_count": 121,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Initialize map widget\n",
+ "webmap = gis.map()\n",
+ "\n",
+ "# Set an map extent (global)\n",
+ "webmap.extent = {'xmin': -140,\n",
+ " 'ymin':-50,\n",
+ " 'xmax':180,\n",
+ " 'ymax':65,\n",
+ " }\n",
+ "\n",
+ "# Add the created layer\n",
+ "webmap.add_layer(added_item)\n",
+ "\n",
+ "# Save the webmap\n",
+ "webmap_properties = {'title':'Perceptual Models Around the World v2.0',\n",
+ " 'snippet': 'description',\n",
+ " 'tags':'perceptual_model'}\n",
+ "\n",
+ "webmap_item = webmap.save(webmap_properties)\n",
+ "\n",
+ "# Display the webmap\n",
+ "webmap_item_id = webmap_item.id\n",
+ "print(webmap_item_id)\n",
+ "webbrowser.open('https://sdsugeo.maps.arcgis.com/apps/mapviewer/index.html?webmap={}'.format(webmap_item_id), new=2)\n",
+ "webmap_item"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "33a43684",
+ "metadata": {},
+ "source": [
+ "## Adjust display of webmap (need to run only after creating a new map)"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "bc7c98d0",
+ "metadata": {},
+ "source": [
+ "This code is written for Updating webmap layer, due to weird behavior of ArcGIS. \n",
+ "\n",
+ "- Editing webmap vs. feature layer\n",
+ " - Webmap can contain multiple feature layers, whereas feature layer is just a one gis layer. \n",
+ " - Webmap json will be pripritized over feature layer json, in terms of appearance setting (pop-up etc.) \n",
+ "\n",
+ "- What happens\n",
+ " - When you first create webmap, you can only edit the appearance (pop-up etc.) of the feature layers. \n",
+ " - However, once you edit something and save on webmap, variable \"['operationalLayers']\" appears in the webmap json. After that, you'll only be able to edit the appearance of feature layer via \"['operationalLayers']\" in the webmap json file. "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "1e66c130",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "def get_map (map_id):\n",
+ " '''\n",
+ " GET MAP DATA FOR CHANGES\n",
+ " '''\n",
+ " \n",
+ " m = gis.content.get(map_id)\n",
+ "\n",
+ " data = m.get_data()\n",
+ " \n",
+ " #Include the below line for prettified JSON\n",
+ " #print(json.dumps(data, indent=4, sort_keys=True))\n",
+ "\n",
+ " print(m)\n",
+ " \n",
+ " return data\n",
+ " \n",
+ "def update_map (map_id, data):\n",
+ " '''\n",
+ " UPDATE MAP TO SAVE CHANGES\n",
+ " '''\n",
+ " m = gis.content.get(map_id)\n",
+ " \n",
+ " # Set the item_properties to include the desired update\n",
+ " properties = {\"text\": json.dumps(data)}\n",
+ "\n",
+ " # 'Commit' the updates to the Item\n",
+ " update = m.update(item_properties=properties)\n",
+ " \n",
+ " return update"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "3892bc98",
+ "metadata": {},
+ "source": [
+ "### Webmap update"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "bf77e240",
+ "metadata": {
+ "scrolled": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "
- \n",
+ "{\n",
+ " \"authoringApp\": \"ArcGISPythonAPI\",\n",
+ " \"authoringAppVersion\": \"2.0.1\",\n",
+ " \"baseMap\": {\n",
+ " \"baseMapLayers\": [\n",
+ " {\n",
+ " \"layerType\": \"ArcGISTiledMapServiceLayer\",\n",
+ " \"resourceInfo\": {\n",
+ " \"capabilities\": \"Map,Tilemap,Query,Data\",\n",
+ " \"currentVersion\": 10.3,\n",
+ " \"exportTilesAllowed\": false,\n",
+ " \"fullExtent\": {\n",
+ " \"spatialReference\": {\n",
+ " \"latestWkid\": 3857,\n",
+ " \"wkid\": 102100\n",
+ " },\n",
+ " \"xmax\": 20037507.067161843,\n",
+ " \"xmin\": -20037507.067161843,\n",
+ " \"ymax\": 19971868.88040863,\n",
+ " \"ymin\": -19971868.880408604\n",
+ " },\n",
+ " \"initialExtent\": {\n",
+ " \"spatialReference\": {\n",
+ " \"latestWkid\": 3857,\n",
+ " \"wkid\": 102100\n",
+ " },\n",
+ " \"xmax\": 28848255.049479112,\n",
+ " \"xmin\": -28848255.049479112,\n",
+ " \"ymax\": 16430757.376790084,\n",
+ " \"ymin\": -2077452.082122866\n",
+ " },\n",
+ " \"layers\": [\n",
+ " {\n",
+ " \"defaultVisibility\": false,\n",
+ " \"id\": 0,\n",
+ " \"maxScale\": 0,\n",
+ " \"minScale\": 0,\n",
+ " \"name\": \"Citations\",\n",
+ " \"parentLayerId\": -1,\n",
+ " \"subLayerIds\": null\n",
+ " }\n",
+ " ],\n",
+ " \"mapName\": \"Layers\",\n",
+ " \"maxImageHeight\": 4096,\n",
+ " \"maxImageWidth\": 4096,\n",
+ " \"maxRecordCount\": 100,\n",
+ " \"maxScale\": 70.5310735,\n",
+ " \"minScale\": 591657527.591555,\n",
+ " \"singleFusedMapCache\": true,\n",
+ " \"spatialReference\": {\n",
+ " \"latestWkid\": 3857,\n",
+ " \"wkid\": 102100\n",
+ " },\n",
+ " \"supportedExtensions\": \"KmlServer\",\n",
+ " \"supportedImageFormatTypes\": \"PNG32,PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,BMP\",\n",
+ " \"supportedQueryFormats\": \"JSON, AMF\",\n",
+ " \"supportsDynamicLayers\": false,\n",
+ " \"tables\": [],\n",
+ " \"tileInfo\": {\n",
+ " \"cols\": 256,\n",
+ " \"compressionQuality\": 90,\n",
+ " \"dpi\": 96,\n",
+ " \"format\": \"JPEG\",\n",
+ " \"lods\": [\n",
+ " {\n",
+ " \"level\": 0,\n",
+ " \"resolution\": 156543.03392800014,\n",
+ " \"scale\": 591657527.591555\n",
+ " },\n",
+ " {\n",
+ " \"level\": 1,\n",
+ " \"resolution\": 78271.51696399994,\n",
+ " \"scale\": 295828763.795777\n",
+ " },\n",
+ " {\n",
+ " \"level\": 2,\n",
+ " \"resolution\": 39135.75848200009,\n",
+ " \"scale\": 147914381.897889\n",
+ " },\n",
+ " {\n",
+ " \"level\": 3,\n",
+ " \"resolution\": 19567.87924099992,\n",
+ " \"scale\": 73957190.948944\n",
+ " },\n",
+ " {\n",
+ " \"level\": 4,\n",
+ " \"resolution\": 9783.93962049996,\n",
+ " \"scale\": 36978595.474472\n",
+ " },\n",
+ " {\n",
+ " \"level\": 5,\n",
+ " \"resolution\": 4891.96981024998,\n",
+ " \"scale\": 18489297.737236\n",
+ " },\n",
+ " {\n",
+ " \"level\": 6,\n",
+ " \"resolution\": 2445.98490512499,\n",
+ " \"scale\": 9244648.868618\n",
+ " },\n",
+ " {\n",
+ " \"level\": 7,\n",
+ " \"resolution\": 1222.992452562495,\n",
+ " \"scale\": 4622324.434309\n",
+ " },\n",
+ " {\n",
+ " \"level\": 8,\n",
+ " \"resolution\": 611.4962262813797,\n",
+ " \"scale\": 2311162.217155\n",
+ " },\n",
+ " {\n",
+ " \"level\": 9,\n",
+ " \"resolution\": 305.74811314055756,\n",
+ " \"scale\": 1155581.108577\n",
+ " },\n",
+ " {\n",
+ " \"level\": 10,\n",
+ " \"resolution\": 152.87405657041106,\n",
+ " \"scale\": 577790.554289\n",
+ " },\n",
+ " {\n",
+ " \"level\": 11,\n",
+ " \"resolution\": 76.43702828507324,\n",
+ " \"scale\": 288895.277144\n",
+ " },\n",
+ " {\n",
+ " \"level\": 12,\n",
+ " \"resolution\": 38.21851414253662,\n",
+ " \"scale\": 144447.638572\n",
+ " },\n",
+ " {\n",
+ " \"level\": 13,\n",
+ " \"resolution\": 19.10925707126831,\n",
+ " \"scale\": 72223.819286\n",
+ " },\n",
+ " {\n",
+ " \"level\": 14,\n",
+ " \"resolution\": 9.554628535634155,\n",
+ " \"scale\": 36111.909643\n",
+ " },\n",
+ " {\n",
+ " \"level\": 15,\n",
+ " \"resolution\": 4.77731426794937,\n",
+ " \"scale\": 18055.954822\n",
+ " },\n",
+ " {\n",
+ " \"level\": 16,\n",
+ " \"resolution\": 2.388657133974685,\n",
+ " \"scale\": 9027.977411\n",
+ " },\n",
+ " {\n",
+ " \"level\": 17,\n",
+ " \"resolution\": 1.1943285668550503,\n",
+ " \"scale\": 4513.988705\n",
+ " },\n",
+ " {\n",
+ " \"level\": 18,\n",
+ " \"resolution\": 0.5971642835598172,\n",
+ " \"scale\": 2256.994353\n",
+ " },\n",
+ " {\n",
+ " \"level\": 19,\n",
+ " \"resolution\": 0.29858214164761665,\n",
+ " \"scale\": 1128.497176\n",
+ " },\n",
+ " {\n",
+ " \"level\": 20,\n",
+ " \"resolution\": 0.14929107082380833,\n",
+ " \"scale\": 564.248588\n",
+ " },\n",
+ " {\n",
+ " \"level\": 21,\n",
+ " \"resolution\": 0.07464553541190416,\n",
+ " \"scale\": 282.124294\n",
+ " },\n",
+ " {\n",
+ " \"level\": 22,\n",
+ " \"resolution\": 0.03732276770595208,\n",
+ " \"scale\": 141.062147\n",
+ " },\n",
+ " {\n",
+ " \"level\": 23,\n",
+ " \"resolution\": 0.01866138385297604,\n",
+ " \"scale\": 70.5310735\n",
+ " }\n",
+ " ],\n",
+ " \"origin\": {\n",
+ " \"x\": -20037508.342787,\n",
+ " \"y\": 20037508.342787\n",
+ " },\n",
+ " \"rows\": 256,\n",
+ " \"spatialReference\": {\n",
+ " \"latestWkid\": 3857,\n",
+ " \"wkid\": 102100\n",
+ " }\n",
+ " },\n",
+ " \"units\": \"esriMeters\"\n",
+ " },\n",
+ " \"url\": \"https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer\"\n",
+ " },\n",
+ " {\n",
+ " \"id\": \"183343475b2-layer-50\",\n",
+ " \"itemId\": \"988c850f4c944d53bd29bd934dd6ac22\",\n",
+ " \"layerType\": \"ArcGISMapServiceLayer\",\n",
+ " \"opacity\": 0.25,\n",
+ " \"title\": \"Watershed Boundary Dataset (WBD) from NHDPlus Version 2.1 (Simplified/Nested), EPA OW\",\n",
+ " \"url\": \"https://watersgeo.epa.gov/arcgis/rest/services/NHDPlus_NP21/WBD_NP21_Simplified/MapServer\"\n",
+ " },\n",
+ " {\n",
+ " \"id\": \"1830ae1b2b9-layer-53\",\n",
+ " \"itemId\": \"9f86716d941c4410b0b406d911754b2c\",\n",
+ " \"layerType\": \"ArcGISTiledMapServiceLayer\",\n",
+ " \"title\": \"Esri Hydro Reference Overlay\",\n",
+ " \"url\": \"https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Esri_Hydro_Reference_Overlay/MapServer\",\n",
+ " \"visibility\": true\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"Topographic\"\n",
+ " },\n",
+ " \"operationalLayers\": [\n",
+ " {\n",
+ " \"id\": \"142949090244\",\n",
+ " \"itemId\": \"91f146af61004ce799233fc30f52a783\",\n",
+ " \"layerDefinition\": {\n",
+ " \"definitionExpression\": null,\n",
+ " \"drawingInfo\": {\n",
+ " \"renderer\": {\n",
+ " \"field1\": \"model_type\",\n",
+ " \"type\": \"uniqueValue\",\n",
+ " \"uniqueValueGroups\": [\n",
+ " {\n",
+ " \"classes\": [\n",
+ " {\n",
+ " \"label\": \"Text model\",\n",
+ " \"symbol\": {\n",
+ " \"angle\": 0,\n",
+ " \"contentType\": \"image/png\",\n",
+ " \"height\": 15,\n",
+ " \"imageData\": \"iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAmoSURBVHhe7Z1Lbt82EMZzhBwhixyhB8g+geG8H02RtEGbNk3TBEX3WXSfI2TRA+QIXmTVduFFD+JFD/DvfAIV29I3FClxKIriB/xg2BalGQ4kDh+irjQ1bUL37j+6JtwQ3gsfhRPHIYK+zAcB58H5rrlLNOWWCwACgaCcCSxoqcD5cZ0u8M6EptSSyr0qPBc+3b338D/5yYKRBXf9TwLsuepMbJorV5GoUFrhhdAF3JncFCKpMLSvaBetH8Opgb2wu7XjmqRybty5++BPV2GzePT46eHrp88Oz7/9/vDdi5eHH16+Ovz06s0kL3983R2PciiP87Dzh+L8aO13r6Oj219JhSCxoRXmAwFBcBCoN7/+dnj77vdk4Hw4L86P67DrB3AC/5yr+5NUAB7L6O6wyqHgDsPdhspngbEG18X1Z9zp8HNfj3FxGN2RoDb3wcMnh2fPXxx+fv2WVvxawB7YBfuY3QT4+95VQb3Co0vaq38HzlMeP/mma1NTP4ZTA/tgJ+xlfgyB/9U+wm/fuf8Hc3oI2r+1Hs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Ck+acYMWaJ2pAAuoV//Ky1yCIc4gZmjrRxN8/WBHOQHuBYOcYczgziGLeegtgnrYXIB7wTBfGw2QYOz18Q2/JxKsrg2Wn2UG+KLESDXrBphVsVorVirw1zOb1LNuFh0rMVjtR/dgIrz2uxr+eSb8L7JOP3ipxHCMjNEh0J6a2+qAthegfvKOZKWWG+tWE7IerEKs5REOPya6Rj2n2caic0ibphyy5WDDbs+S2UuYTxeuJUx0Y0UDc3oIkhQ87kpvs2Ef7AxIqjrgv9mEf0kSZ5GUedvqHrRp6HaUNpgCe2BXQJvbA3+3mVzNlTiMVaDertYQ3C3IVNd6nOO6uH7oXXsB+JlmVeUW5daO0Tc1pkD7h43KUPmpH+s4H86L84e2s4STXTyaQyUVckPaK/qSXSi4wxAQ3G0IDtpKBGoKHIfjUQ7lZ9ypl3B+zHs3aQ+SysFjHO9HB7XZBQF7Yfd+H8tzJBWGrS1Ge5gUBuwL28KhSZdUIma4uoCzDeVy4q7fBVYofyJhq5LKxbvT6IYhYbN+rOP8uA6u19rZtSSVj3a8DzzaRQQlNmPvy6B8F1Chta9NW9CVK/8Dprxw+rO3yFQAAAAASUVORK5CYII=\",\n",
+ " \"type\": \"esriPMS\",\n",
+ " \"url\": \"https://static.arcgis.com/images/Symbols/Government/Warrant.png\",\n",
+ " \"width\": 15,\n",
+ " \"xoffset\": 0,\n",
+ " \"yoffset\": 0\n",
+ " },\n",
+ " \"values\": [\n",
+ " [\n",
+ " \"Text model\"\n",
+ " ]\n",
+ " ]\n",
+ " },\n",
+ " {\n",
+ " \"label\": \"Figure model\",\n",
+ " \"symbol\": {\n",
+ " \"angle\": 0,\n",
+ " \"contentType\": \"image/png\",\n",
+ " \"height\": 18.75,\n",
+ " \"imageData\": \"iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAANa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XL9Wa1+RcQbtqjxFpL1j8pMaJeL/eFEZkx9t1mmPdmm/1s8e8tnrYZprwbM82kN2tUTDEAjahnDwlQiqRI7jeM7j/HZNvck0DuezSa8Dkhnn+eg6n308pL/0+zU2yx6kV1scvsPkuEj/Kl/hcIGOtMKVBC69UG5JpusnwZ7EQsKpIj07TRpGwDbarNM+1+F6Fz+7GpIfv7MXBH4RobRG7Pkczk8CvfjXC04Dm83/AZ9peMb+hNWWAAAAAElFTkSuQmCC\",\n",
+ " \"type\": \"esriPMS\",\n",
+ " \"url\": \"https://static.arcgis.com/images/Symbols/Government/Water-Teatment-Plant-Permit.png\",\n",
+ " \"width\": 18.75,\n",
+ " \"xoffset\": 0,\n",
+ " \"yoffset\": 0\n",
+ " },\n",
+ " \"values\": [\n",
+ " [\n",
+ " \"Figure model\"\n",
+ " ]\n",
+ " ]\n",
+ " }\n",
+ " ]\n",
+ " }\n",
+ " ],\n",
+ " \"uniqueValueInfos\": [\n",
+ " {\n",
+ " \"label\": \"Text model\",\n",
+ " \"symbol\": {\n",
+ " \"angle\": 0,\n",
+ " \"contentType\": \"image/png\",\n",
+ " \"height\": 15,\n",
+ " \"imageData\": \"iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAmoSURBVHhe7Z1Lbt82EMZzhBwhixyhB8g+geG8H02RtEGbNk3TBEX3WXSfI2TRA+QIXmTVduFFD+JFD/DvfAIV29I3FClxKIriB/xg2BalGQ4kDh+irjQ1bUL37j+6JtwQ3gsfhRPHIYK+zAcB58H5rrlLNOWWCwACgaCcCSxoqcD5cZ0u8M6EptSSyr0qPBc+3b338D/5yYKRBXf9TwLsuepMbJorV5GoUFrhhdAF3JncFCKpMLSvaBetH8Opgb2wu7XjmqRybty5++BPV2GzePT46eHrp88Oz7/9/vDdi5eHH16+Ovz06s0kL3983R2PciiP87Dzh+L8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wtNOmlJGEiRbdcq5msonmza5kvoEL6lzy6IrC/HnPOeQH1q2TTi4EJiI7nI6fCiwKJbtVd83SXh1IXCTjdvHV2XC9FsGzNVLdDLQP2hHln9CmeofxcKW8nFjgcX/4L1lGTteAIMjl0I8kguSLtVIMdyoRrxLOcBabtLoZIL09Ew0AIdx0SAl49qLZH01z4TozpaGz3NRBuM/vBnV9XrSQzBCk+acYMWaJ2pAAuoV//Ky1yCIc4gZmjrRxN8/WBHOQHuBYOcYczgziGLeegtgnrYXIB7wTBfGw2QYOz18Q2/JxKsrg2Wn2UG+KLESDXrBphVsVorVirw1zOb1LNuFh0rMVjtR/dgIrz2uxr+eSb8L7JOP3ipxHCMjNEh0J6a2+qAthegfvKOZKWWG+tWE7IerEKs5REOPya6Rj2n2caic0ibphyy5WDDbs+S2UuYTxeuJUx0Y0UDc3oIkhQ87kpvs2Ef7AxIqjrgv9mEf0kSZ5GUedvqHrRp6HaUNpgCe2BXQJvbA3+3mVzNlTiMVaDertYQ3C3IVNd6nOO6uH7oXXsB+JlmVeUW5daO0Tc1pkD7h43KUPmpH+s4H86L84e2s4STXTyaQyUVckPaK/qSXSi4wxAQ3G0IDtpKBGoKHIfjUQ7lZ9ypl3B+zHs3aQ+SysFjHO9HB7XZBQF7Yfd+H8tzJBWGrS1Ge5gUBuwL28KhSZdUIma4uoCzDeVy4q7fBVYofyJhq5LKxbvT6IYhYbN+rOP8uA6u19rZtSSVj3a8DzzaRQQlNmPvy6B8F1Chta9NW9CVK/8Dprxw+rO3yFQAAAAASUVORK5CYII=\",\n",
+ " \"type\": \"esriPMS\",\n",
+ " \"url\": \"https://static.arcgis.com/images/Symbols/Government/Warrant.png\",\n",
+ " \"width\": 15,\n",
+ " \"xoffset\": 0,\n",
+ " \"yoffset\": 0\n",
+ " },\n",
+ " \"value\": \"Text model\"\n",
+ " },\n",
+ " {\n",
+ " \"label\": \"Figure model\",\n",
+ " \"symbol\": {\n",
+ " \"angle\": 0,\n",
+ " \"contentType\": \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py/4T7lSHtyLVBmTS6CZ5+yry74XMj8LV7KikWrdekCWyS7EczHhjMNOjTKvlqtFLwFtmXLOUxY2/da3zN7k8OXCtcBCt7bDZE6CFMzdsfts+kc/y0FVIuMftuB/TEhBme2rM/FppB3HVkyhP/Sr7HMzGe+JBldepF2gdqo1J9pCpLqWOee6XL9Wa1+RcQbtqjxFpL1j8pMaJeL/eFEZkx9t1mmPdmm/1s8e8tnrYZprwbM82kN2tUTDEAjahnDwlQiqRI7jeM7j/HZNvck0DuezSa8Dkhnn+eg6n308pL/0+zU2yx6kV1scvsPkuEj/Kl/hcIGOtMKVBC69UG5JpusnwZ7EQsKpIj07TRpGwDbarNM+1+F6Fz+7GpIfv7MXBH4RobRG7Pkczk8CvfjXC04Dm83/AZ9peMb+hNWWAAAAAElFTkSuQmCC\",\n",
+ " \"type\": \"esriPMS\",\n",
+ " \"url\": \"https://static.arcgis.com/images/Symbols/Government/Water-Teatment-Plant-Permit.png\",\n",
+ " \"width\": 18.75,\n",
+ " \"xoffset\": 0,\n",
+ " \"yoffset\": 0\n",
+ " },\n",
+ " \"value\": \"Figure model\"\n",
+ " }\n",
+ " ],\n",
+ " \"visualVariables\": [\n",
+ " {\n",
+ " \"stops\": [\n",
+ " {\n",
+ " \"size\": 46.875,\n",
+ " \"value\": 1155581.108577\n",
+ " },\n",
+ " {\n",
+ " \"size\": 37.5,\n",
+ " \"value\": 9244648.868618\n",
+ " },\n",
+ " {\n",
+ " \"size\": 18.75,\n",
+ " \"value\": 73957190.948944\n",
+ " },\n",
+ " {\n",
+ " \"size\": 9.375,\n",
+ " \"value\": 591657527.591555\n",
+ " }\n",
+ " ],\n",
+ " \"type\": \"sizeInfo\",\n",
+ " \"valueExpression\": \"$view.scale\"\n",
+ " }\n",
+ " ]\n",
+ " }\n",
+ " }\n",
+ " },\n",
+ " \"layerType\": \"ArcGISFeatureLayer\",\n",
+ " \"opacity\": 1,\n",
+ " \"popupInfo\": {\n",
+ " \"description\": null,\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"id\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Model ID\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"model_type\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Model type\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"citation\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Citation\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"url\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"URL\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"attribution\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Attribution\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"attribution_url\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Attribution link\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"figure_num\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Figure number\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"figure_caption\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Figure caption\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"figure_url\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Figure URL\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"textmodel_snipped\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Text model snipped\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"textmodel_section_number\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Text section number\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"textmodel_section_name\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Text section name\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"textmodel_page_number\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Text page number\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"watershed_name\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Watershed name\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"lat\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"latitude\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"lon\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"longitude\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"area_km2\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"longitude\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_spatial_zones\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of spatial zones\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"spatial_property\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Spatial property\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_temporal_zones\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of temporal zones\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"temporal_property\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Temporal property\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"vegetation_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Vegetation\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"soil_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Soil\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"geol_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Geology\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"topo_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Topography\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"three_d_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"3-dimensional description\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"uncertainty_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Uncertainty range\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"other_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Information: other\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_store\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of stores\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"List of stores\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_id_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Hashtags of stores\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_flux\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of fluxes\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"List of fluxes\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_id_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Hashtags of fluxes\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"dummy_column\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"dummy_column\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"huc_watershed_id\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"US HUC8\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"ObjectId\",\n",
+ " \"isEditable\": false,\n",
+ " \"label\": \"ObjectID\",\n",
+ " \"visible\": false\n",
+ " }\n",
+ " ],\n",
+ " \"mediaInfos\": [],\n",
+ " \"popupElements\": [\n",
+ " {\n",
+ " \"text\": \"
Perceptual model of {watershed_name}
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"mediaInfos\": [\n",
+ " {\n",
+ " \"altText\": \"\",\n",
+ " \"caption\": \"{citation}; {attribution};  From Figure {figure_num};  Caption: {figure_caption}; Section {textmodel_section_number} “{textmodel_section_name}” of pp.{textmodel_page_number}\",\n",
+ " \"refreshInterval\": 0,\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"image\",\n",
+ " \"value\": {\n",
+ " \"linkURL\": \"{url}\",\n",
+ " \"sourceURL\": \"{figure_url}\"\n",
+ " }\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"media\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"Text model; {textmodel_snipped}
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Process information in the model
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"num_store\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of stores\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"List of stores\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_id_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Hashtags of stores\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_flux\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of fluxes\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"List of fluxes\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_id_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Hashtags of fluxes\",\n",
+ " \"visible\": true\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Spatio-temporal heterogeneity in the model
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"num_spatial_zones\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of spatial zones\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"spatial_property\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Spatial property\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_temporal_zones\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of temporal zones\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"temporal_property\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Temporal property\",\n",
+ " \"visible\": true\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Ancillary information in the model
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"vegetation_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Vegetation\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"soil_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Soil\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"geol_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Geology\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"topo_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Topography\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"uncertainty_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Uncertainty range\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"three_d_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"3-dimensional description\",\n",
+ " \"visible\": true\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Watershed information
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"area_km2\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Watershed area (km2)\",\n",
+ " \"visible\": true\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " }\n",
+ " ],\n",
+ " \"showAttachments\": true,\n",
+ " \"title\": \"\"\n",
+ " },\n",
+ " \"title\": \"alltype_models_v1\",\n",
+ " \"url\": \"https://services1.arcgis.com/SIYkiqjmENweC50g/arcgis/rest/services/alltype_models_v1/FeatureServer/0\",\n",
+ " \"visibility\": true\n",
+ " }\n",
+ " ],\n",
+ " \"spatialReference\": {\n",
+ " \"latestWkid\": 3857,\n",
+ " \"wkid\": 102100\n",
+ " },\n",
+ " \"version\": \"2.10\"\n",
+ "}\n"
+ ]
+ }
+ ],
+ "source": [
+ "webmap_item_id = '94bdbb06d8aa435598182f21c9ba067c'\n",
+ "webmap_data = get_map(webmap_item_id)\n",
+ "print(json.dumps(webmap_data, indent=4, sort_keys=True))"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "id": "5755f340",
+ "metadata": {},
+ "source": [
+ "### Feature layer update"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "cb1633fa",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "- \n",
+ "{\n",
+ " \"layers\": [\n",
+ " {\n",
+ " \"id\": 0,\n",
+ " \"layerDefinition\": {\n",
+ " \"defaultVisibility\": true,\n",
+ " \"definitionExpression\": null,\n",
+ " \"drawingInfo\": {\n",
+ " \"renderer\": {\n",
+ " \"field1\": \"model_type\",\n",
+ " \"type\": \"uniqueValue\",\n",
+ " \"uniqueValueGroups\": [\n",
+ " {\n",
+ " \"classes\": [\n",
+ " {\n",
+ " \"label\": \"Text model\",\n",
+ " \"symbol\": {\n",
+ " \"angle\": 0,\n",
+ " \"contentType\": \"image/png\",\n",
+ " \"height\": 15,\n",
+ " \"imageData\": \"iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAmoSURBVHhe7Z1Lbt82EMZzhBwhixyhB8g+geG8H02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mPvy6B8F1Chta9NW9CVK/8Dprxw+rO3yFQAAAAASUVORK5CYII=\",\n",
+ " \"type\": \"esriPMS\",\n",
+ " \"url\": \"https://static.arcgis.com/images/Symbols/Government/Warrant.png\",\n",
+ " \"width\": 15,\n",
+ " \"xoffset\": 0,\n",
+ " \"yoffset\": 0\n",
+ " },\n",
+ " \"values\": [\n",
+ " [\n",
+ " \"Text model\"\n",
+ " ]\n",
+ " ]\n",
+ " },\n",
+ " {\n",
+ " \"label\": \"Figure model\",\n",
+ " \"symbol\": {\n",
+ " \"angle\": 0,\n",
+ " \"contentType\": \"image/png\",\n",
+ " \"height\": 18.75,\n",
+ " \"imageData\": \"iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAANaElEQVR4Xu2dz+ocSxXH5xHyCFncB3DhA+QRcsGFMYhXXIgIchERcZUr4kZuQlAQFMniigsRIiiCoAQMuhAuP0TuwoWKIOJCjKBwFy7G+aSmfulfzzmnqk6d6p6ZzBe+/Eimu7qqTp+/Vd29ueCC08D9x7d3vLPjgx2f7Phsz20D8zmPdqSdOzve3l/hgsXxSqAI5cWOktCiSPtcJwn+gkG4//jWjm/t+HTziUf/2f2VhLEM0/Wf7kh/bu17eIEbWbDSZB8Pk8AvaEDyr/jF0WY4mvSXfl/8uAr83b1339tPmI+f+s5285nvbzef++F28/kfbTdf+Ml288Wfl/n2T9PxnMf5tCO1X8s0jov/vsbHvvHR3YS0RsKJCAThIKivPNtuvvrrONIe7dI+15GuX+azl+N7bZHMMumONDky0TC0jcmXBDOaXJfrt2s643zNzHhKR+p87ie/vd189r3t5ku/kCd+LdIf+kX/pH4fkvE+2M/AGQPTde/hH2aDl/np7yafGm2Go0n/6GetdjP+szXhH3/36+Kg58T/rWWOe0m/a/0383E2ePOdN3aDujoY5JynLNw564V99XJ+Th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HqX5Zd6Z/0Vw//Hd2cVf0bkkqbF1RSkaXFvq15RZqCH5vC5geHcvgYWgpVUwIOKeMwu714y3Al8v9WcI9e08MDhdqoVWDYMDBA3RFoIjzOJSWKSObgs4oKrVg3sPnwudSgz00RLRboopBFfRGo4GYzm4oULMsEbbB5MPP9/P9IpIOzzliBsOFvSUOQXCRxLV1mp7jrAJsnpSsGaWBJzmtbDzcimUBB2UR58VrTw48YgEnFEj6IDK2FmQeTg5AWfQMctHQwKMhcz30ZFx2wFW8sFHK+AprKgbsqrSuUx5cmS8+mpS5spRdCusPDqThfBz12rGpy/4T7lSHtyLVBmTS6CZ5+yry74XMj8LV7KikWrdekCWyS7EczHhjMNOjTKvlqtFLwFtmXLOUxY2/da3zN7k8OXCtcBCt7bDZE6CFMzdsfts+kc/y0FVIuMftuB/TEhBme2rM/FppB3HVkyhP/Sr7HMzGe+JBldepF2gdqo1J9pCpLqWOee6XL9Wa1+RcQbtqjxFpL1j8pMaJeL/eFEZkx9t1mmPdmm/1s8e8tnrYZprwbM82kN2tUTDEAjahnDwlQiqRI7jeM7j/HZNvck0DuezSa8Dkhnn+eg6n308pL/0+zU2yx6kV1scvsPkuEj/Kl/hcIGOtMKVBC69UG5JpusnwZ7EQsKpIj07TRpGwDbarNM+1+F6Fz+7GpIfv7MXBH4RobRG7Pkczk8CvfjXC04Dm83/AZ9peMb+hNWWAAAAAElFTkSuQmCC\",\n",
+ " \"type\": \"esriPMS\",\n",
+ " \"url\": \"https://static.arcgis.com/images/Symbols/Government/Water-Teatment-Plant-Permit.png\",\n",
+ " \"width\": 18.75,\n",
+ " \"xoffset\": 0,\n",
+ " \"yoffset\": 0\n",
+ " },\n",
+ " \"values\": [\n",
+ " [\n",
+ " \"Figure model\"\n",
+ " ]\n",
+ " ]\n",
+ " }\n",
+ " ]\n",
+ " }\n",
+ " ],\n",
+ " \"uniqueValueInfos\": [\n",
+ " {\n",
+ " \"label\": \"Text model\",\n",
+ " \"symbol\": {\n",
+ " \"angle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c1pkD7h43KUPmpH+s4H86L84e2s4STXTyaQyUVckPaK/qSXSi4wxAQ3G0IDtpKBGoKHIfjUQ7lZ9ypl3B+zHs3aQ+SysFjHO9HB7XZBQF7Yfd+H8tzJBWGrS1Ge5gUBuwL28KhSZdUIma4uoCzDeVy4q7fBVYofyJhq5LKxbvT6IYhYbN+rOP8uA6u19rZtSSVj3a8DzzaRQQlNmPvy6B8F1Chta9NW9CVK/8Dprxw+rO3yFQAAAAASUVORK5CYII=\",\n",
+ " \"type\": \"esriPMS\",\n",
+ " \"url\": \"https://static.arcgis.com/images/Symbols/Government/Warrant.png\",\n",
+ " \"width\": 15,\n",
+ " \"xoffset\": 0,\n",
+ " \"yoffset\": 0\n",
+ " },\n",
+ " \"value\": \"Text model\"\n",
+ " },\n",
+ " {\n",
+ " \"label\": \"Figure model\",\n",
+ " \"symbol\": {\n",
+ " \"angle\": 0,\n",
+ " \"contentType\": \"image/png\",\n",
+ " \"height\": 18.75,\n",
+ " \"imageData\": \"iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAANaElEQVR4Xu2dz+ocSxXH5xHyCFncB3DhA+QRcsGFMYhXXIgIchERcZUr4kZuQlAQFMniigsRIiiCoAQMuhAuP0TuwoWKIOJCjKBwFy7G+aSmfulfzzmnqk6d6p6ZzBe+/Eimu7qqTp+/Vd29ueCC08D9x7d3vLPjgx2f7Phsz20D8zmPdqSdOzve3l/hgsXxSqAI5cWOktCiSPtcJwn+gkG4//jWjm/t+HTziUf/2f2VhLEM0/Wf7kh/bu17eIEbWbDSZB8Pk8AvaEDyr/jF0WY4mvSXfl/8uAr83b1339tPmI+f+s5285nvbzef++F28/kfbTdf+Ml288Wfl/n2T9PxnMf5tCO1X8s0jov/vsbHvvHR3YS0RsKJCAThIKivPNtuvvrrONIe7dI+15Gu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HGcvTgQKhT6tH0oC+hA76lL12QqM+x5jwn5qlUGdOQBY5gvOVCbhYsBLFCtiw1y4AtMIU6JfOpRdPIYSjuP746uCjsTKumRFAt5lsC5zOh3DRMqkaOgRo4RurjlBaqhTqllS4x/8Px5jtv7C4kR9usVAUJGq1GM9dGq5AJmLJFkY4tkvljHqX5Zd6Z/0Vw//Hd2cVf0bkkqbF1RSkaXFvq15RZqCH5vC5geHcvgYWgpVUwIOKeMwu714y3Al8v9WcI9e08MDhdqoVWDYMDBA3RFoIjzOJSWKSObgs4oKrVg3sPnwudSgz00RLRboopBFfRGo4GYzm4oULMsEbbB5MPP9/P9IpIOzzliBsOFvSUOQXCRxLV1mp7jrAJsnpSsGaWBJzmtbDzcimUBB2UR58VrTw48YgEnFEj6IDK2FmQeTg5AWfQMctHQwKMhcz30ZFx2wFW8sFHK+AprKgbsqrSuUx5cmS8+mpS5spRdCusPDqThfBz12rGpy/4T7lSHtyLVBmTS6CZ5+yry74XMj8LV7KikWrdekCWyS7EczHhjMNOjTKvlqtFLwFtmXLOUxY2/da3zN7k8OXCtcBCt7bDZE6CFMzdsfts+kc/y0FVIuMftuB/TEhBme2rM/FppB3HVkyhP/Sr7HMzGe+JBldepF2gdqo1J9pCpLqWOee6XL9Wa1+RcQbtqjxFpL1j8pMaJeL/eFEZkx9t1mmPdmm/1s8e8tnrYZprwbM82kN2tUTDEAjahnDwlQiqRI7jeM7j/HZNvck0DuezSa8Dkhnn+eg6n308pL/0+zU2yx6kV1scvsPkuEj/Kl/hcIGOtMKVBC69UG5JpusnwZ7EQsKpIj07TRpGwDbarNM+1+F6Fz+7GpIfv7MXBH4RobRG7Pkczk8CvfjXC04Dm83/AZ9peMb+hNWWAAAAAElFTkSuQmCC\",\n",
+ " \"type\": \"esriPMS\",\n",
+ " \"url\": \"https://static.arcgis.com/images/Symbols/Government/Water-Teatment-Plant-Permit.png\",\n",
+ " \"width\": 18.75,\n",
+ " \"xoffset\": 0,\n",
+ " \"yoffset\": 0\n",
+ " },\n",
+ " \"value\": \"Figure model\"\n",
+ " }\n",
+ " ],\n",
+ " \"visualVariables\": [\n",
+ " {\n",
+ " \"stops\": [\n",
+ " {\n",
+ " \"size\": 46.875,\n",
+ " \"value\": 1155581.108577\n",
+ " },\n",
+ " {\n",
+ " \"size\": 37.5,\n",
+ " \"value\": 9244648.868618\n",
+ " },\n",
+ " {\n",
+ " \"size\": 18.75,\n",
+ " \"value\": 73957190.948944\n",
+ " },\n",
+ " {\n",
+ " \"size\": 9.375,\n",
+ " \"value\": 591657527.591555\n",
+ " }\n",
+ " ],\n",
+ " \"type\": \"sizeInfo\",\n",
+ " \"valueExpression\": \"$view.scale\"\n",
+ " }\n",
+ " ]\n",
+ " },\n",
+ " \"transparency\": 0\n",
+ " }\n",
+ " },\n",
+ " \"popupInfo\": {\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"id\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Model ID\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"model_type\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Model type\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"citation\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Citation\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"url\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"URL\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"attribution\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Attribution\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"attribution_url\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Attribution link\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"figure_num\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Figure number\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"figure_caption\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Figure caption\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"figure_url\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Figure URL\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"textmodel_snipped\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Text model snipped\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"textmodel_section_number\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Text section number\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"textmodel_section_name\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Text section name\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"textmodel_page_number\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Text page number\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"watershed_name\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Watershed name\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"lat\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"latitude\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"lon\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"longitude\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"area_km2\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"longitude\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_spatial_zones\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of spatial zones\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"spatial_property\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Spatial property\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_temporal_zones\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of temporal zones\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"temporal_property\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Temporal property\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"vegetation_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Vegetation\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"soil_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Soil\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"geol_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Geology\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"topo_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Topography\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"three_d_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"3-dimensional description\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"uncertainty_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Uncertainty range\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"other_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Information: other\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_store\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of stores\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"List of stores\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_id_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Hashtags of stores\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_flux\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of fluxes\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"List of fluxes\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_id_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Hashtags of fluxes\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"dummy_column\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"dummy_column\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"huc_watershed_id\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"US HUC8\",\n",
+ " \"visible\": false\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"ObjectId\",\n",
+ " \"label\": \"ObjectID\",\n",
+ " \"visible\": false\n",
+ " }\n",
+ " ],\n",
+ " \"popupElements\": [\n",
+ " {\n",
+ " \"text\": \"
{model_type} of {watershed_name}
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"Text model: {textmodel_snipped}
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"mediaInfos\": [\n",
+ " {\n",
+ " \"altText\": \"Text model\",\n",
+ " \"caption\": \"Caption: {figure_caption}; From Figure {figure_num} in {citation}; {attribution}\",\n",
+ " \"refreshInterval\": 0,\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"image\",\n",
+ " \"value\": {\n",
+ " \"linkURL\": \"{url}\",\n",
+ " \"sourceURL\": \"{figure_url}\"\n",
+ " }\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"media\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Process information in the model
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"num_store\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of stores\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"List of stores\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_id_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Hashtags of stores\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_flux\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of fluxes\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"List of fluxes\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_id_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Hashtags of fluxes\",\n",
+ " \"visible\": true\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Spatio-temporal heterogeneity in the model
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"num_spatial_zones\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of spatial zones\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"spatial_property\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Spatial property\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_temporal_zones\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Number of temporal zones\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"temporal_property\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Temporal property\",\n",
+ " \"visible\": true\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Ancillary information in the model
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"vegetation_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Vegetation\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"soil_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Soil\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"geol_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Geology\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"topo_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Topography\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"uncertainty_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Uncertainty range\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"three_d_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"3-dimensional description\",\n",
+ " \"visible\": true\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Watershed information
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"area_km2\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"Watershed area (km2)\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"huc_watershed_id\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"US HUC8 watershed ID\",\n",
+ " \"visible\": true\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " }\n",
+ " ],\n",
+ " \"showAttachments\": true,\n",
+ " \"title\": \"\"\n",
+ " }\n",
+ " }\n",
+ " ],\n",
+ " \"tables\": []\n",
+ "}\n"
+ ]
+ }
+ ],
+ "source": [
+ "feature_layer_id = '91f146af61004ce799233fc30f52a783'\n",
+ "feature_layer_data = get_map(feature_layer_id)\n",
+ "print(json.dumps(feature_layer_data, indent=4, sort_keys=True))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "8031f31f",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Update the basemaps\n",
+ "\n",
+ "# US HUC8 layer \n",
+ "HUC8_dict = {\n",
+ " \"id\": \"183343475b2-layer-50\",\n",
+ " \"itemId\": \"988c850f4c944d53bd29bd934dd6ac22\",\n",
+ " \"layerType\": \"ArcGISMapServiceLayer\",\n",
+ " \"opacity\": 0.25,\n",
+ " \"title\": \"Watershed Boundary Dataset (WBD) from NHDPlus Version 2.1 (Simplified/Nested), EPA OW\",\n",
+ " \"url\": \"https://watersgeo.epa.gov/arcgis/rest/services/NHDPlus_NP21/WBD_NP21_Simplified/MapServer\"\n",
+ " }\n",
+ "\n",
+ "# World waterbody maps\n",
+ "river_dict = {\n",
+ " \"id\": \"1830ae1b2b9-layer-53\",\n",
+ " \"itemId\": \"9f86716d941c4410b0b406d911754b2c\",\n",
+ " \"layerType\": \"ArcGISTiledMapServiceLayer\",\n",
+ " \"title\": \"Esri Hydro Reference Overlay\",\n",
+ " \"url\": \"https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Esri_Hydro_Reference_Overlay/MapServer\",\n",
+ " \"visibility\": True\n",
+ " }\n",
+ "\n",
+ "webmap_data['baseMap']['baseMapLayers'].append(HUC8_dict)\n",
+ "webmap_data['baseMap']['baseMapLayers'].append(river_dict)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "66219435",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The dictionary is in correct order\n",
+ "id\n",
+ "Model ID\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "model_type\n",
+ "Model type\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "citation\n",
+ "Citation\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "url\n",
+ "URL\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "attribution\n",
+ "Attribution\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "attribution_url\n",
+ "Attribution link\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "figure_num\n",
+ "Figure number\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "figure_caption\n",
+ "Figure caption\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "figure_url\n",
+ "Figure URL\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "textmodel_snipped\n",
+ "Text model snipped\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "textmodel_section_number\n",
+ "Text section number\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "textmodel_section_name\n",
+ "Text section name\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "textmodel_page_number\n",
+ "Text page number\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "watershed_name\n",
+ "Watershed name\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "lat\n",
+ "latitude\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "lon\n",
+ "longitude\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "area_km2\n",
+ "longitude\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "num_spatial_zones\n",
+ "Number of spatial zones\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "spatial_property\n",
+ "Spatial property\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "num_temporal_zones\n",
+ "Number of temporal zones\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "temporal_property\n",
+ "Temporal property\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "vegetation_info\n",
+ "Vegetation\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "soil_info\n",
+ "Soil\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "geol_info\n",
+ "Geology\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "topo_info\n",
+ "Topography\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "three_d_info\n",
+ "3-dimensional description\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "uncertainty_info\n",
+ "Uncertainty range\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "other_info\n",
+ "Information: other\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "num_store\n",
+ "Number of stores\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "store_list\n",
+ "List of stores\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "store_id_list\n",
+ "Hashtags of stores\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "num_flux\n",
+ "Number of fluxes\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "flux_list\n",
+ "List of fluxes\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "flux_id_list\n",
+ "Hashtags of fluxes\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "dummy_column\n",
+ "dummy_column\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "huc_watershed_id\n",
+ "US HUC8\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "ObjectId\n",
+ "ObjectID\n",
+ "True\n",
+ "False\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Make some changes\n",
+ "\n",
+ "# Change the display names \n",
+ "mylabel_dict = {0:{\"fieldName\":\"id\",\"label\":\"Model ID\",\"visible\":False},\n",
+ " 1:{\"fieldName\":\"model_type\",\"label\":\"Model type\",\"visible\":False},\n",
+ " 2:{\"fieldName\":\"citation\",\"label\":\"Citation\",\"visible\":False},\n",
+ " 3:{\"fieldName\":\"url\",\"label\":\"URL\",\"visible\":False},\n",
+ " 4:{\"fieldName\":\"attribution\",\"label\":\"Attribution\",\"visible\":False},\n",
+ " 5:{\"fieldName\":\"attribution_url\",\"label\":\"Attribution link\",\"visible\":False},\n",
+ " 6:{\"fieldName\":\"figure_num\",\"label\":\"Figure number\",\"visible\":False},\n",
+ " 7:{\"fieldName\":\"figure_caption\",\"label\":\"Figure caption\",\"visible\":False},\n",
+ " 8:{\"fieldName\":\"figure_url\",\"label\":\"Figure URL\",\"visible\":False},\n",
+ " 9:{\"fieldName\":\"textmodel_snipped\",\"label\":\"Text model snipped\",\"visible\":True},\n",
+ " 10:{\"fieldName\":\"textmodel_section_number\",\"label\":\"Text section number\",\"visible\":False},\n",
+ " 11:{\"fieldName\":\"textmodel_section_name\",\"label\":\"Text section name\",\"visible\":False},\n",
+ " 12:{\"fieldName\":\"textmodel_page_number\",\"label\":\"Text page number\",\"visible\":False},\n",
+ " 13:{\"fieldName\":\"watershed_name\",\"label\":\"Watershed name\",\"visible\":True},\n",
+ " 14:{\"fieldName\":\"lat\",\"label\":\"latitude\",\"visible\":False},\n",
+ " 15:{\"fieldName\":\"lon\",\"label\":\"longitude\",\"visible\":False},\n",
+ " 16:{\"fieldName\":\"area_km2\",\"label\":\"longitude\",\"visible\":False},\n",
+ " 17:{\"fieldName\":\"num_spatial_zones\",\"label\":\"Number of spatial zones\",\"visible\":True},\n",
+ " 18:{\"fieldName\":\"spatial_property\",\"label\":\"Spatial property\",\"visible\":True},\n",
+ " 19:{\"fieldName\":\"num_temporal_zones\",\"label\":\"Number of temporal zones\",\"visible\":True},\n",
+ " 20:{\"fieldName\":\"temporal_property\",\"label\":\"Temporal property\",\"visible\":True},\n",
+ " 21:{\"fieldName\":\"vegetation_info\",\"label\":\"Vegetation\",\"visible\":True},\n",
+ " 22:{\"fieldName\":\"soil_info\",\"label\":\"Soil\",\"visible\":True},\n",
+ " 23:{\"fieldName\":\"geol_info\",\"label\":\"Geology\",\"visible\":True},\n",
+ " 24:{\"fieldName\":\"topo_info\",\"label\":\"Topography\",\"visible\":True},\n",
+ " 25:{\"fieldName\":\"three_d_info\",\"label\":\"3-dimensional description\",\"visible\":True},\n",
+ " 26:{\"fieldName\":\"uncertainty_info\",\"label\":\"Uncertainty range\",\"visible\":True},\n",
+ " 27:{\"fieldName\":\"other_info\",\"label\":\"Information: other\",\"visible\":True},\n",
+ " 28:{\"fieldName\":\"num_store\",\"label\":\"Number of stores\",\"visible\":True},\n",
+ " 29:{\"fieldName\":\"store_list\",\"label\":\"List of stores\",\"visible\":True},\n",
+ " 30:{\"fieldName\":\"store_id_list\",\"label\":\"Hashtags of stores\",\"visible\":True},\n",
+ " 31:{\"fieldName\":\"num_flux\",\"label\":\"Number of fluxes\",\"visible\":True},\n",
+ " 32:{\"fieldName\":\"flux_list\",\"label\":\"List of fluxes\",\"visible\":True},\n",
+ " 33:{\"fieldName\":\"flux_id_list\",\"label\":\"Hashtags of fluxes\",\"visible\":True},\n",
+ " 34:{\"fieldName\":\"dummy_column\",\"label\":\"dummy_column\",\"visible\":False},\n",
+ " 35:{\"fieldName\":\"huc_watershed_id\",\"label\":\"US HUC8\",\"visible\":False},\n",
+ " 36:{\"fieldName\":\"ObjectId\",\"label\":\"ObjectID\",\"visible\":False}\n",
+ " }\n",
+ "\n",
+ "for i in range(len(mylabel_dict)): \n",
+ " if webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['fieldName'] == mylabel_dict[i]['fieldName']:\n",
+ " print('The dictionary is in correct order')\n",
+ " \n",
+ " print(webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['label'])\n",
+ " webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['label'] = mylabel_dict[i]['label']\n",
+ " print(webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['label'])\n",
+ "\n",
+ " print(webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['visible'])\n",
+ " webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['visible'] = mylabel_dict[i]['visible']\n",
+ " print(webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['visible'])\n",
+ " else:\n",
+ " print('The dictionary is in wrong order')"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "2168e832",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Turn off the layer name\n",
+ "webmap_data['operationalLayers'][0]['popupInfo']['title'] = \"\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "8bb3bf8b",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# TODO: Add 'hand drawn figures' later \n",
+ "render = {'type': 'uniqueValue',\n",
+ " 'visualVariables': [{'type': 'sizeInfo',\n",
+ " 'valueExpression': '$view.scale',\n",
+ " 'stops': [{'size': 46.875, 'value': 1155581.108577},\n",
+ " {'size': 37.5, 'value': 9244648.868618},\n",
+ " {'size': 18.75, 'value': 73957190.948944},\n",
+ " {'size': 9.375, 'value': 591657527.591555}]}],\n",
+ " 'field1': 'model_type',\n",
+ " 'uniqueValueGroups': [{'classes': [{'label': 'Text model',\n",
+ " 'symbol': {'type': 'esriPMS',\n",
+ " 'angle': 0,\n",
+ " 'xoffset': 0,\n",
+ " 'yoffset': 0,\n",
+ " 'contentType': 'image/png',\n",
+ " 'imageData': 'iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAmoSURBVHhe7Z1Lbt82EMZzhBwhixyhB8g+geG8H02RtEGbNk3TBEX3WXSfI2TRA+QIXmTVduFFD+JFD/DvfAIV29I3FClxKIriB/xg2BalGQ4kDh+irjQ1bUL37j+6JtwQ3gsfhRPHIYK+zAcB58H5rrlLNOWWCwACgaCcCSxoqcD5cZ0u8M6EptSSyr0qPBc+3b338D/5yYKRBXf9TwLsuepMbJorV5GoUFrhhdAF3JncFCKpMLSvaBetH8Opgb2wu7XjmqRybty5++BPV2GzePT46eHrp88Oz7/9/vDdi5eHH16+Ovz06s0kL3983R2PciiP87Dzh+L8aO13r6Oj219JhSCxoRXmAwFBcBCoN7/+dnj77vdk4Hw4L86P67DrB3AC/5yr+5NUAB7L6O6wyqHgDsPdhspngbEG18X1Z9zp8HNfj3FxGN2RoDb3wcMnh2fPXxx+fv2WVvxawB7YBfuY3QT4+95VQb3Co0vaq38HzlMeP/mma1NTP4ZTA/tgJ+xlfgyB/9U+wm/fuf8Hc3oI2r+1HsdLgd2h7Tfqw1XN9nXz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ky1yCIc4gZmjrRxN8/WBHOQHuBYOcYczgziGLeegtgnrYXIB7wTBfGw2QYOz18Q2/JxKsrg2Wn2UG+KLESDXrBphVsVorVirw1zOb1LNuFh0rMVjtR/dgIrz2uxr+eSb8L7JOP3ipxHCMjNEh0J6a2+qAthegfvKOZKWWG+tWE7IerEKs5REOPya6Rj2n2caic0ibphyy5WDDbs+S2UuYTxeuJUx0Y0UDc3oIkhQ87kpvs2Ef7AxIqjrgv9mEf0kSZ5GUedvqHrRp6HaUNpgCe2BXQJvbA3+3mVzNlTiMVaDertYQ3C3IVNd6nOO6uH7oXXsB+JlmVeUW5daO0Tc1pkD7h43KUPmpH+s4H86L84e2s4STXTyaQyUVckPaK/qSXSi4wxAQ3G0IDtpKBGoKHIfjUQ7lZ9ypl3B+zHs3aQ+SysFjHO9HB7XZBQF7Yfd+H8tzJBWGrS1Ge5gUBuwL28KhSZdUIma4uoCzDeVy4q7fBVYofyJhq5LKxbvT6IYhYbN+rOP8uA6u19rZtSSVj3a8DzzaRQQlNmPvy6B8F1Chta9NW9CVK/8Dprxw+rO3yFQAAAAASUVORK5CYII=',\n",
+ " 'url': 'https://static.arcgis.com/images/Symbols/Government/Warrant.png',\n",
+ " 'height': 15,\n",
+ " 'width': 15},\n",
+ " 'values': [['Text model']]},\n",
+ " {'label': 'Figure model',\n",
+ " 'symbol': {'type': 'esriPMS',\n",
+ " 'angle': 0,\n",
+ " 'xoffset': 0,\n",
+ " 'yoffset': 0,\n",
+ " 'contentType': 'image/png',\n",
+ " 'imageData': 'iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAANaElEQVR4Xu2dz+ocSxXH5xHyCFncB3DhA+QRcsGFMYhXXIgIchERcZUr4kZuQlAQFMniigsRIiiCoAQMuhAuP0TuwoWKIOJCjKBwFy7G+aSm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hnn+eg6n308pL/0+zU2yx6kV1scvsPkuEj/Kl/hcIGOtMKVBC69UG5JpusnwZ7EQsKpIj07TRpGwDbarNM+1+F6Fz+7GpIfv7MXBH4RobRG7Pkczk8CvfjXC04Dm83/AZ9peMb+hNWWAAAAAElFTkSuQmCC',\n",
+ " 'url': 'https://static.arcgis.com/images/Symbols/Government/Water-Teatment-Plant-Permit.png',\n",
+ " 'height': 18.75,\n",
+ " 'width': 18.75},\n",
+ " 'values': [['Figure model']]}]}],\n",
+ " 'uniqueValueInfos': [{'label': 'Text model',\n",
+ " 'symbol': {'type': 'esriPMS',\n",
+ " 'angle': 0,\n",
+ " 'xoffset': 0,\n",
+ " 'yoffset': 0,\n",
+ " 'contentType': 'image/png',\n",
+ " 'imageData': 'iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAmoSURBVHhe7Z1Lbt82EMZzhBwhixyhB8g+geG8H02RtEGbNk3TBEX3WXSfI2TRA+QIXmTVduFFD+JFD/DvfAIV29I3FClxKIriB/xg2BalGQ4kDh+irjQ1bUL37j+6JtwQ3gsfhRPHIYK+zAcB58H5rrlLNOWWCwACgaCcCSxoqcD5cZ0u8M6EptSSyr0qPBc+3b338D/5yYKRBXf9TwLsuepMbJorV5GoUFrhhdAF3JncFCKpMLSvaBetH8Opgb2wu7XjmqRybty5++BPV2GzePT46eHrp88Oz7/9/vDdi5eHH16+Ovz06s0kL3983R2PciiP87Dzh+L8aO13r6Oj219JhSCxoRXmAwFBcBCoN7/+dnj77vdk4Hw4L86P67DrB3AC/5yr+5NUAB7L6O6wyqHgDsPdhspngbEG18X1Z9zp8HNfj3FxGN2RoDb3wcMnh2fPXxx+fv2WVvxawB7YBfuY3QT4+95VQb3Co0vaq38HzlMeP/mma1NTP4ZTA/tgJ+xlfgyB/9U+wm/fuf8Hc3oI2r+1HsdLgd2h7T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2pAAuoV//Ky1yCIc4gZmjrRxN8/WBHOQHuBYOcYczgziGLeegtgnrYXIB7wTBfGw2QYOz18Q2/JxKsrg2Wn2UG+KLESDXrBphVsVorVirw1zOb1LNuFh0rMVjtR/dgIrz2uxr+eSb8L7JOP3ipxHCMjNEh0J6a2+qAthegfvKOZKWWG+tWE7IerEKs5REOPya6Rj2n2caic0ibphyy5WDDbs+S2UuYTxeuJUx0Y0UDc3oIkhQ87kpvs2Ef7AxIqjrgv9mEf0kSZ5GUedvqHrRp6HaUNpgCe2BXQJvbA3+3mVzNlTiMVaDertYQ3C3IVNd6nOO6uH7oXXsB+JlmVeUW5daO0Tc1pkD7h43KUPmpH+s4H86L84e2s4STXTyaQyUVckPaK/qSXSi4wxAQ3G0IDtpKBGoKHIfjUQ7lZ9ypl3B+zHs3aQ+SysFjHO9HB7XZBQF7Yfd+H8tzJBWGrS1Ge5gUBuwL28KhSZdUIma4uoCzDeVy4q7fBVYofyJhq5LKxbvT6IYhYbN+rOP8uA6u19rZtSSVj3a8DzzaRQQlNmPvy6B8F1Chta9NW9CVK/8Dprxw+rO3yFQAAAAASUVORK5CYII=',\n",
+ " 'url': 'https://static.arcgis.com/images/Symbols/Government/Warrant.png',\n",
+ " 'height': 15,\n",
+ " 'width': 15},\n",
+ " 'value': 'Text model'},\n",
+ " {'label': 'Figure model',\n",
+ " 'symbol': {'type': 'esriPMS',\n",
+ " 'angle': 0,\n",
+ " 'xoffset': 0,\n",
+ " 'yoffset': 0,\n",
+ " 'contentType': 'image/png',\n",
+ " 'imageData': 'iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAANaElEQVR4Xu2dz+ocSxXH5xHyCFncB3DhA+QRcsGFMYhXXIgIchERcZUr4kZuQlAQFMniigsRIiiCoAQMuhAuP0TuwoWKIOJCjKB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DuezSa8Dkhnn+eg6n308pL/0+zU2yx6kV1scvsPkuEj/Kl/hcIGOtMKVBC69UG5JpusnwZ7EQsKpIj07TRpGwDbarNM+1+F6Fz+7GpIfv7MXBH4RobRG7Pkczk8CvfjXC04Dm83/AZ9peMb+hNWWAAAAAElFTkSuQmCC',\n",
+ " 'url': 'https://static.arcgis.com/images/Symbols/Government/Water-Teatment-Plant-Permit.png',\n",
+ " 'height': 18.75,\n",
+ " 'width': 18.75},\n",
+ " 'value': 'Figure model'}]}\n",
+ "\n",
+ "webmap_data['operationalLayers'][0]['layerDefinition']['drawingInfo']['renderer'] = render\n",
+ "# feature_layer_data['layers'][0]['layerDefinition']['drawingInfo']['renderer']['uniqueValueInfos']\n",
+ "# feature_layer_data['layers'][0]['layerDefinition']['drawingInfo']['renderer']['field1'] == 'model_type' #['uniqueValueGroups'] #['uniqueValueGroups'] #['drawingInfo'] #['renderer']['symbol']['imageData']\n",
+ "\n",
+ "# Update the icon to prettier one\n",
+ "# webmap_data['operationalLayers'][0]['layerDefinition']['drawingInfo']['renderer']['symbol']['url'] = \"https://static.arcgis.com/images/Symbols/Government/Water-Teatment-Plant-Permit.png\"\n",
+ "# webmap_data['operationalLayers'][0]['layerDefinition']['drawingInfo']['renderer']['symbol']['imageData'] = \"iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAANaElEQVR4Xu2dz+ocSxXH5xHyCFncB3DhA+QRcsGFMYhXXIgIchERcZUr4kZuQlAQFMniigsRIiiCoAQMuhAuP0TuwoWKIOJCjKBwFy7G+aSmfulfzzmnqk6d6p6ZzBe+/Eimu7qqTp+/Vd29ueCC08D9x7d3vLPjgx2f7Phsz20D8zmPdqSdOzve3l/hgsXxSqAI5cWOktCiSPtcJwn+gkG4//jWjm/t+HTziUf/2f2VhLEM0/Wf7k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AAAAAElFTkSuQmCC\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "eed843dc",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Change the pop-up\n",
+ "webmap_data['operationalLayers'][0]['popupInfo']['popupElements'] = [\n",
+ " {\n",
+ " \"text\": \"Perceptual model of {watershed_name}
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"mediaInfos\": [\n",
+ " {\n",
+ " \"altText\": \"\",\n",
+ " \"caption\": \"{citation}; {attribution};  From Figure {figure_num};  Caption: {figure_caption}; Section {textmodel_section_number} “{textmodel_section_name}” of pp.{textmodel_page_number}\",\n",
+ " \"refreshInterval\": 0,\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"image\",\n",
+ " \"value\": {\n",
+ " \"linkURL\": \"{url}\",\n",
+ " \"sourceURL\": \"{figure_url}\"\n",
+ " }\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"media\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"Text model{textmodel_snipped}
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Process information in the model
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"num_store\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Number of stores\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_list\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"List of stores\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_id_list\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Hashtags of stores\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_flux\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Number of fluxes\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_list\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"List of fluxes\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_id_list\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Hashtags of fluxes\",\n",
+ " \"visible\": True\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Spatio-temporal heterogeneity in the model
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"num_spatial_zones\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Number of spatial zones\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"spatial_property\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Spatial property\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_temporal_zones\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Number of temporal zones\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"temporal_property\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Temporal property\",\n",
+ " \"visible\": True\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Ancillary information in the model
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"vegetation_info\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Vegetation\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"soil_info\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Soil\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"geol_info\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Geology\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"topo_info\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Topography\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"uncertainty_info\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Uncertainty range\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"three_d_info\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"3-dimensional description\",\n",
+ " \"visible\": True\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Watershed information
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"area_km2\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Watershed area (km2)\",\n",
+ " \"visible\": True\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " }\n",
+ " ]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "01251618",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "True"
+ ]
+ },
+ "execution_count": 180,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# # Update the map\n",
+ "# feature_layer_update = update_map(feature_layer_id, feature_layer_data)\n",
+ "# feature_layer_update\n",
+ "\n",
+ "# Update the map\n",
+ "webmap_update = update_map(webmap_item_id, webmap_data)\n",
+ "webmap_update"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "4f8a2737",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "True"
+ ]
+ },
+ "execution_count": 181,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Verify changes updated\n",
+ "webbrowser.open('https://sdsugeo.maps.arcgis.com/apps/mapviewer/index.html?webmap={}'.format(webmap_item_id), new=2)\n",
+ "\n",
+ "# https://sdsugeo.maps.arcgis.com/apps/mapviewer/index.html?webmap=e535103892fd41cd915d60ca4d1d9d44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "68607e8b",
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "markdown",
+ "id": "71111d63",
+ "metadata": {},
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "814a091a",
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "d173d565",
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "arcgis",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.9.0"
+ },
+ "vscode": {
+ "interpreter": {
+ "hash": "3140ae756112501f18b23ec79a6bbbb54e715b030c96600dfefb60d12a8f240f"
+ }
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/src/old_codes/building_database_onlyFigModels.py b/src/old_codes/building_database_onlyFigModels.py
new file mode 100644
index 0000000..0230a51
--- /dev/null
+++ b/src/old_codes/building_database_onlyFigModels.py
@@ -0,0 +1,548 @@
+
+#######################################################
+## Script to join all Excel files and build a database
+#######################################################
+
+import os
+print(os.environ['PATH'])
+import pandas as pd
+import numpy as np
+import configparser
+from sqlalchemy import create_engine
+from sqlalchemy import text
+
+###################################
+## 0. Read data
+###################################
+os.chdir(r'G:\Shared drives\Perceptual model review\ForRyoko\perceptual-model-arcgis\dev\scripts')
+
+df_loc = pd.read_excel('../data/Location_formatted.xlsx') # The lat/lon should be pre-formatted in decimal units
+# df_model = pd.read_csv('../data/ModelAnalysis.csv', encoding='utf-8')
+df_model = pd.read_excel('../data/ModelAnalysis.xlsx')
+df_taxonomy = pd.read_excel('../data/ProcessHierarchyNetwork.xlsx')
+df_FunctionType = pd.read_excel('../data/FunctionType.xlsx')
+
+## Parse dataframe into table
+
+# Location table
+# Sanity check if data can be joined
+# df.set_index('key').join(other.set_index('key'))
+df_loc["id"] = df_loc.index + 1
+df_loc = df_loc.drop(columns='Unnamed: 0')
+df_loc["huc_watershed_id"] = np.nan
+
+# FunctionType table
+df_FunctionType["id"] = df_FunctionType.index + 1
+
+# Citation table
+df_model["attribution_url"].fillna(df_model["url"], inplace=True)
+df_citation = df_model[["citation", "url"]].copy()
+df_citation["attribution"] = df_model["attribution"].copy()
+df_citation["attribution_url"] = df_model["attribution_url"].copy()
+df_citation["id"] = df_citation.index + 1
+
+# Spatial and temporal zone tables
+df_spatialZoneType = df_model["spatial_property"].copy().drop_duplicates()
+df_spatialZoneType = df_spatialZoneType.to_frame()
+df_spatialZoneType.reset_index(inplace=True)
+df_spatialZoneType = df_spatialZoneType.drop(columns='index')
+df_spatialZoneType['id'] = df_spatialZoneType.index + 1
+df_temporalZoneType = df_model["temporal_property"].copy().drop_duplicates()
+df_temporalZoneType = df_temporalZoneType.to_frame()
+df_temporalZoneType.reset_index(inplace=True)
+df_temporalZoneType = df_temporalZoneType.drop(columns='index')
+df_temporalZoneType['id'] = df_temporalZoneType.index + 1
+
+# Alternative name table
+df_altNames0 = df_taxonomy.set_index(['process', 'function', 'identifier', 'process_level']).apply(
+ lambda x: x.str.split(',').explode()).reset_index()
+df_altNames = df_altNames0[['alternative_names', 'process']].copy()
+df_altNames['alternative_names'] = df_altNames['alternative_names'].str.strip()
+df_altNames['alternative_names'] = df_altNames['alternative_names'].str.capitalize()
+df_altNames.dropna(axis=0, inplace=True)
+df_altNames["id"] = df_altNames.index + 1
+
+# Model table
+df_model["id"] = df_model.index + 1
+df_modelmain = df_model[['id', 'citation', 'watershed_name',
+ 'figure_num', 'figure_url', 'figure_caption',
+ 'spatial_property', 'num_spatial_zones', 'temporal_property',
+ 'num_temporal_zones', 'vegetation_info', 'soil_info', 'geol_info',
+ 'topo_info', 'three_d_info', 'uncertainty_info', 'other_info'
+ ]].copy()
+
+# corgi_fig = "https://i.ibb.co/stdkk6P/corgi-with-notes.png"
+corgi_fig = "https://sdsugeo.maps.arcgis.com/sharing/rest/content/items/df499e37a2ef40d7885966952c627e01/data"
+df_modelmain['figure_url'] = df_modelmain['figure_url'].fillna(corgi_fig)
+df_modelmain.rename(columns={"figure_num": "model_ref"})
+
+# LinkProcessPerceptual table
+# Get all the process original text and taxonomy name from model
+frames = [df_model[['id', 'flux1', 'flux1_taxonomy']].copy().rename(
+ columns={"id": "entry_id", "flux1": "original_text", "flux1_taxonomy": "process"}),
+ df_model[['id', 'flux2', 'flux2_taxonomy']].copy().rename(
+ columns={"id": "entry_id", "flux2": "original_text", "flux2_taxonomy": "process"}),
+ df_model[['id', 'flux3', 'flux3_taxonomy']].copy().rename(
+ columns={"id": "entry_id", "flux3": "original_text", "flux3_taxonomy": "process"}),
+ df_model[['id', 'flux4', 'flux4_taxonomy']].copy().rename(
+ columns={"id": "entry_id", "flux4": "original_text", "flux4_taxonomy": "process"}),
+ df_model[['id', 'flux5', 'flux5_taxonomy']].copy().rename(
+ columns={"id": "entry_id", "flux5": "original_text", "flux5_taxonomy": "process"}),
+ df_model[['id', 'flux6', 'flux6_taxonomy']].copy().rename(
+ columns={"id": "entry_id", "flux6": "original_text", "flux6_taxonomy": "process"}),
+ df_model[['id', 'flux7', 'flux7_taxonomy']].copy().rename(
+ columns={"id": "entry_id", "flux7": "original_text", "flux7_taxonomy": "process"}),
+ df_model[['id', 'flux8', 'flux8_taxonomy']].copy().rename(
+ columns={"id": "entry_id", "flux8": "original_text", "flux8_taxonomy": "process"}),
+ df_model[['id', 'flux9', 'flux9_taxonomy']].copy().rename(
+ columns={"id": "entry_id", "flux9": "original_text", "flux9_taxonomy": "process"}),
+ df_model[['id', 'store1', 'store1_taxonomy']].copy().rename(
+ columns={"id": "entry_id", "store1": "original_text", "store1_taxonomy": "process"}),
+ df_model[['id', 'store2', 'store2_taxonomy']].copy().rename(
+ columns={"id": "entry_id", "store2": "original_text", "store2_taxonomy": "process"}),
+ df_model[['id', 'store3', 'store3_taxonomy']].copy().rename(
+ columns={"id": "entry_id", "store3": "original_text", "store3_taxonomy": "process"}),
+ df_model[['id', 'store4', 'store4_taxonomy']].copy().rename(
+ columns={"id": "entry_id", "store4": "original_text", "store4_taxonomy": "process"}),
+ df_model[['id', 'store5', 'store5_taxonomy']].copy().rename(
+ columns={"id": "entry_id", "store5": "original_text", "store5_taxonomy": "process"}),
+ df_model[['id', 'store6', 'store6_taxonomy']].copy().rename(
+ columns={"id": "entry_id", "store6": "original_text", "store6_taxonomy": "process"}),
+ df_model[['id', 'store7', 'store7_taxonomy']].copy().rename(
+ columns={"id": "entry_id", "store7": "original_text", "store7_taxonomy": "process"}),
+ df_model[['id', 'store8', 'store8_taxonomy']].copy().rename(
+ columns={"id": "entry_id", "store8": "original_text", "store8_taxonomy": "process"}),
+ ]
+
+df_linkProcessPerceptual0 = pd.concat(frames, axis=0, ignore_index=True)
+df_linkProcessPerceptual0["id"] = df_linkProcessPerceptual0.index + 1
+
+# Create taxonomy table
+df_process0 = df_taxonomy.drop(columns='alternative_names')
+
+# join process taxonomy and model table
+df_linkProcessPerceptual0["process_lower"] = df_linkProcessPerceptual0['process'].str.lower()
+df_linkProcessPerceptual0["process_lower"] = df_linkProcessPerceptual0['process_lower'].str.strip()
+df_process0["process_lower"] = df_process0['process'].str.lower()
+df_process0["process_lower"] = df_process0['process_lower'].str.strip()
+
+# find and add some new process from model table to taxonomy table
+df_linkProcessPerceptual1 = df_linkProcessPerceptual0.merge(df_process0, on='process_lower', how='left')
+new_process = df_linkProcessPerceptual1.loc[(df_linkProcessPerceptual1['process_x'].isnull() == False) & (
+ df_linkProcessPerceptual1['process_y'].isnull() == True)]
+new_process.drop_duplicates(subset='process_lower', inplace=True)
+
+add_new_process = pd.DataFrame(
+ {'process': new_process['process_x'], 'process_lower': new_process['process_x'].str.lower(),
+ 'identifier': ['NewProcess'] * len(new_process['process_x'])})
+df_process1 = pd.concat([df_process0, add_new_process])
+df_process1["id"] = df_process1.reset_index().index + 1
+
+
+# re-join process taxonomy and model table with new process
+df_linkProcessPerceptual2 = df_linkProcessPerceptual0.merge(df_process1, on='process_lower', how='left')
+df_linkProcessPerceptual2.rename(columns={"id_y": "process_id"}, inplace=True)
+df_linkProcessPerceptual = df_linkProcessPerceptual2.drop(
+ columns={'process_x', 'id_x', 'process_lower', 'process_y', 'function', 'identifier', 'process_level'})
+df_linkProcessPerceptual.dropna(subset=['original_text'], axis=0, inplace=True)
+df_linkProcessPerceptual["id"] = df_linkProcessPerceptual.reset_index().index + 1
+df_linkProcessPerceptual["process_id"] = df_linkProcessPerceptual["process_id"].astype('int')
+# df_linkProcessPerceptual[df_linkProcessPerceptual['process_id'].isnull()]
+df_process = df_process1.drop(columns='process_lower')
+
+###################################
+## 1. Connect to SQL database
+###################################
+
+# Read config
+config = configparser.ConfigParser()
+config.read('config.ini')
+
+DB_NAME = config['postgresql']['DB_NAME']
+HOST = config['postgresql']['HOST']
+PORT = config['postgresql']['PORT']
+USER_NAME = config['postgresql']['USER_NAME']
+PASSWD = config['postgresql']['PASSWD']
+
+# Connect to database
+conn_string = f'postgresql://{USER_NAME}:{PASSWD}@{HOST}:{PORT}/{DB_NAME}'
+db = create_engine(conn_string, client_encoding='utf8')
+try:
+ conn = db.connect()
+ print("connection to '%s'@'%s' success!" % (DB_NAME, HOST))
+except Exception as e:
+ print("connection to '%s'@'%s' failed." % (DB_NAME, HOST))
+ print(e)
+
+###################################
+## 2. Create database
+###################################
+
+tables = ['locations', 'citations', 'spatial_zone_type', 'temporal_zone_type', 'process_alt_names',
+ 'function_type', 'perceptual_model', 'link_process_perceptual', 'process_taxonomy']
+conn.execute(text("set search_path to public, perceptual_model"))
+conn.execute(text("SET CLIENT_ENCODING TO 'UTF8';"))
+for table in tables:
+ try:
+ conn.execute(text(f"DROP TABLE {table} CASCADE;"))
+ print('drop old tables')
+ except Exception as e:
+ print(e)
+
+schema = 'perceptual_model'
+connarg = {'con': conn, 'schema': 'perceptual_model', 'if_exists': 'replace', 'index': False}
+
+# set table names in lower case https://github.com/pandas-dev/pandas/issues/13206
+df_loc.to_sql('locations', **connarg)
+df_citation.to_sql('citations', **connarg)
+df_spatialZoneType.to_sql('spatial_zone_type', **connarg)
+df_temporalZoneType.to_sql('temporal_zone_type', **connarg)
+df_altNames.to_sql('process_alt_names', **connarg)
+df_FunctionType.to_sql('function_type', **connarg)
+df_modelmain.to_sql('perceptual_model', **connarg)
+df_linkProcessPerceptual.to_sql('link_process_perceptual', **connarg)
+df_process.to_sql('process_taxonomy', **connarg)
+
+# Relate the location table to HUC8 watershed table
+query = "ALTER TABLE perceptual_model.locations \
+ADD COLUMN pt geometry(point, 4326); \
+WITH pt_geom AS ( \
+ SELECT id, ST_SetSRID(ST_MakePoint(lon, lat), 4326) AS pt \
+ from perceptual_model.locations \
+ ) \
+UPDATE perceptual_model.locations \
+SET pt = pt_geom.pt \
+FROM pt_geom \
+WHERE pt_geom.id = locations.id; \
+ALTER TABLE locations \
+ALTER COLUMN huc_watershed_id TYPE INTEGER USING huc_watershed_id::integer; \
+WITH joined_huc8_pt AS ( \
+SELECT locations.id AS pt_id, huc_watersheds.id as huc8_id, huc_watersheds.huc8 AS huc8_code \
+FROM locations \
+JOIN huc_watersheds \
+ON ST_contains(ST_Transform(huc_watersheds.geom, 4326), locations.pt) \
+) \
+UPDATE locations \
+SET huc_watershed_id = joined_huc8_pt.huc8_id \
+FROM joined_huc8_pt \
+WHERE locations.id = joined_huc8_pt.pt_id;"
+
+try:
+ conn.execute(text(query))
+ print("success")
+except Exception as e:
+ print(e)
+
+# add primary keys
+for table in tables:
+ try:
+ conn.execute(text(f"ALTER TABLE {table} ADD PRIMARY KEY (id);"))
+ print(f"successfully created table {table}")
+ except Exception as e:
+ print(e)
+
+# add foreign keys
+# model & location
+query = "ALTER TABLE perceptual_model ADD COLUMN location_id int; \
+UPDATE perceptual_model \
+SET location_id = locations.id \
+FROM locations \
+WHERE perceptual_model.watershed_name = locations.name; \
+ALTER TABLE perceptual_model \
+ADD FOREIGN KEY (location_id) REFERENCES locations(id); \
+ALTER TABLE perceptual_model DROP COLUMN watershed_name;"
+
+try:
+ conn.execute(text(query))
+ print("success")
+except Exception as e:
+ print(e)
+
+# model & citation
+query = "ALTER TABLE perceptual_model ADD COLUMN citation_id int; \
+UPDATE perceptual_model \
+SET citation_id = citations.id \
+FROM citations \
+WHERE perceptual_model.citation = citations.citation; \
+ALTER TABLE perceptual_model \
+ADD FOREIGN KEY (citation_id) REFERENCES citations(id); \
+ALTER TABLE perceptual_model DROP COLUMN citation;"
+
+try:
+ conn.execute(text(query))
+ print("success")
+except Exception as e:
+ print(e)
+
+# model & spatial zone
+query = "ALTER TABLE perceptual_model ADD COLUMN spatialzone_id int; \
+UPDATE perceptual_model \
+SET spatialzone_id = spatial_zone_type.id \
+FROM spatial_zone_type \
+WHERE perceptual_model.spatial_property = spatial_zone_type.spatial_property; \
+ALTER TABLE perceptual_model \
+ADD FOREIGN KEY (spatialzone_id) REFERENCES spatial_zone_type(id); \
+ALTER TABLE perceptual_model DROP COLUMN spatial_property;"
+
+try:
+ conn.execute(text(query))
+ print("success")
+except Exception as e:
+ print(e)
+
+# model & temporal zone
+query = "ALTER TABLE perceptual_model ADD COLUMN temporalzone_id int; \
+UPDATE perceptual_model \
+SET temporalzone_id = temporal_zone_type.id \
+FROM temporal_zone_type \
+WHERE perceptual_model.temporal_property = temporal_zone_type.temporal_property; \
+ALTER TABLE perceptual_model \
+ADD FOREIGN KEY (temporalzone_id) REFERENCES temporal_zone_type(id); \
+ALTER TABLE perceptual_model DROP COLUMN temporal_property;"
+
+try:
+ conn.execute(text(query))
+ print("success")
+except Exception as e:
+ print(e)
+
+# model & linktable
+query = "ALTER TABLE link_process_perceptual \
+ADD FOREIGN KEY (entry_id) REFERENCES perceptual_model(id);"
+
+try:
+ conn.execute(text(query))
+ print("success")
+except Exception as e:
+ print(e)
+
+# process taxonomy & alternative names
+query = "ALTER TABLE process_alt_names ADD COLUMN process_id int; \
+UPDATE process_alt_names \
+SET process_id = process_taxonomy.id \
+FROM process_taxonomy \
+WHERE process_alt_names.process = process_taxonomy.process; \
+ALTER TABLE process_alt_names \
+ADD FOREIGN KEY (process_id) REFERENCES process_taxonomy(id); \
+ALTER TABLE process_alt_names DROP COLUMN process;"
+
+try:
+ conn.execute(text(query))
+ print("success")
+except Exception as e:
+ print(e)
+
+# process taxonomy & function type
+query = "ALTER TABLE process_taxonomy ADD COLUMN function_id int; \
+UPDATE process_taxonomy \
+SET function_id = function_type.id \
+FROM function_type \
+WHERE process_taxonomy.function = function_type.name; \
+ALTER TABLE process_taxonomy \
+ADD FOREIGN KEY (function_id) REFERENCES function_type(id); \
+ALTER TABLE process_taxonomy DROP COLUMN function;"
+
+try:
+ conn.execute(text(query))
+ print("success")
+except Exception as e:
+ print(e)
+
+# huc_watersheds & locations
+query = "ALTER TABLE locations \
+ADD FOREIGN KEY (huc_watershed_id) \
+REFERENCES huc_watersheds(id);"
+
+try:
+ conn.execute(text(query))
+ print("success")
+except Exception as e:
+ print(e)
+
+
+# linktable & process taxonomy
+
+# somehow this does not work ...
+"""
+# try joining on pandas ...
+query = "ALTER TABLE link_process_perceptual ADD COLUMN process_id int; \
+UPDATE link_process_perceptual \
+SET process_id = process_taxonomy.id \
+FROM process_taxonomy \
+WHERE link_process_perceptual.process::text ILIKE process_taxonomy.process::text; \
+ALTER TABLE link_process_perceptual \
+ADD FOREIGN KEY (process_id) REFERENCES process_taxonomy(id);" # \
+# ALTER TABLE link_process_perceptual DROP COLUMN process_name;"
+"""
+
+# try joining on pandas ...
+query = "ALTER TABLE link_process_perceptual \
+ADD FOREIGN KEY (process_id) REFERENCES process_taxonomy(id);"
+# \
+# ALTER TABLE link_process_perceptual DROP COLUMN process_name;"
+
+try:
+ conn.execute(text(query))
+ print("success")
+except Exception as e:
+ print(e)
+
+drop_tables = "DROP TABLE giant_table, giant_table_flux, giant_table_store, giant_table_update;"
+try:
+ conn.execute(text(drop_tables))
+ print("success")
+except Exception as e:
+ print(e)
+
+## Join tables and dump everything into csv file
+# https://hevodata.com/learn/postgres-export-to-csv/
+join_desired_tables = "\
+CREATE TEMP TABLE giant_table AS (\
+SELECT perceptual_model.id, \
+ citations.citation, \
+ citations.url, \
+ citations.attribution, \
+ citations.attribution_url, \
+ perceptual_model.figure_num, \
+ perceptual_model.figure_caption, \
+ perceptual_model.figure_url, \
+ locations.name AS watershed_name, \
+ locations.lat, \
+ locations.lon, \
+ locations.area_km2, \
+ huc_watersheds.huc8::text AS huc8_id, \
+ process_taxonomy.process, \
+ process_taxonomy.identifier,\
+ function_type.name AS function_name,\
+ perceptual_model.num_spatial_zones,\
+ spatial_zone_type.spatial_property,\
+ perceptual_model.num_temporal_zones,\
+ temporal_zone_type.temporal_property,\
+ perceptual_model.vegetation_info,\
+ perceptual_model.soil_info,\
+ perceptual_model.geol_info,\
+ perceptual_model.topo_info,\
+ perceptual_model.three_d_info,\
+ perceptual_model.uncertainty_info,\
+ perceptual_model.other_info\
+ FROM perceptual_model \
+ INNER JOIN citations \
+ ON citations.id = perceptual_model.citation_id \
+ INNER JOIN locations \
+ ON locations.id = perceptual_model.location_id \
+ INNER JOIN spatial_zone_type \
+ ON spatial_zone_type.id = perceptual_model.spatialzone_id \
+ INNER JOIN temporal_zone_type \
+ ON temporal_zone_type.id = perceptual_model.temporalzone_id \
+ INNER JOIN link_process_perceptual \
+ ON perceptual_model.id = link_process_perceptual.entry_id \
+ INNER JOIN process_taxonomy \
+ ON link_process_perceptual.process_id = process_taxonomy.id \
+ INNER JOIN function_type \
+ ON process_taxonomy.function_id = function_type.id \
+ LEFT JOIN huc_watersheds \
+ ON locations.huc_watershed_id = huc_watersheds.id \
+ORDER BY perceptual_model.id \
+);"
+
+join_desired_tables2 = "\
+CREATE TEMP TABLE giant_table_base AS ( \
+ SELECT DISTINCT \
+ id, \
+ citation, \
+ url, \
+ attribution, \
+ attribution_url, \
+ figure_num, \
+ figure_caption, \
+ figure_url, \
+ watershed_name, \
+ lat, \
+ lon, \
+ area_km2, \
+ huc8_id AS huc_watershed_id, \
+ num_spatial_zones, \
+ spatial_property, \
+ num_temporal_zones, \
+ temporal_property, \
+ vegetation_info, \
+ soil_info, \
+ geol_info, \
+ topo_info, \
+ three_d_info, \
+ uncertainty_info, \
+ other_info \
+ FROM giant_table \
+); \
+CREATE TEMP TABLE giant_table_flux AS ( \
+SELECT DISTINCT \
+ id AS temp_id1, \
+ COUNT(process) OVER(PARTITION BY id) AS num_flux, \
+ STRING_AGG(process, ', ') OVER(PARTITION BY id) AS flux_list, \
+ STRING_AGG(identifier, ', ') OVER(PARTITION BY id) AS flux_id_list \
+FROM giant_table \
+ WHERE function_name ILIKE 'Filling of store' \
+ OR function_name ILIKE 'Release from store' \
+ OR function_name ILIKE 'In-catchment flux' \
+ OR function_name ILIKE 'In-store flux' \
+ OR function_name ILIKE 'Release' \
+ ); \
+CREATE TEMP TABLE giant_table_store AS ( \
+SELECT DISTINCT id AS temp_id2, \
+COUNT(process) OVER(PARTITION BY id) AS num_store, \
+ STRING_AGG(process, ', ') OVER(PARTITION BY id) AS store_list, \
+ STRING_AGG(identifier, ', ') OVER(PARTITION BY id) AS store_id_list \
+FROM giant_table \
+ WHERE function_name ILIKE 'Store' \
+ OR function_name ILIKE 'Store, temporary' \
+ OR function_name ILIKE 'Store characteristics, temporary' \
+ OR function_name ILIKE 'Store characteristics, permanent' \
+ ); \
+CREATE TEMP TABLE giant_table_update AS ( \
+SELECT * FROM giant_table_base \
+LEFT JOIN giant_table_store \
+ON giant_table_base.id = giant_table_store.temp_id2 \
+LEFT JOIN giant_table_flux \
+ON giant_table_base.id = giant_table_flux.temp_id1 \
+ORDER BY id \
+ ); \
+ALTER TABLE giant_table_update \
+DROP COLUMN temp_id1, \
+DROP COLUMN temp_id2, \
+ADD COLUMN dummy_column NUMERIC DEFAULT 1; \
+"
+try:
+ conn.execute(text(join_desired_tables))
+ print("success")
+except Exception as e:
+ print(e)
+
+try:
+ conn.execute(text(join_desired_tables2))
+ print("success")
+except Exception as e:
+ print(e)
+
+
+# save_table = "\copy giant_table_update TO 'G://Shared drives/Perceptual model review/ForRyoko/perceptual-model-arcgis/db_dev/data/giant_table_update.csv' WITH DELIMITER ',' CSV HEADER;"
+# conn.execute(save_table)
+
+query = "SELECT * FROM giant_table_update"
+try:
+ df_results = pd.read_sql(text(query), conn)
+ # results = conn.execute(query).fetchall()
+ print("success")
+ print(df_results.columns)
+except Exception as e:
+ print(e)
+
+df_results['huc_watershed_id'].fillna('N/A', inplace=True)
+df_results['num_store'].fillna(0, inplace=True)
+df_results['num_flux'].fillna(0, inplace=True)
+df_results['area_km2'].fillna(-9999, inplace=True)
+df_results.fillna('N/A', inplace=True)
+df_results.to_csv('../data/giant_table_v4.csv', sep=',', header=True, index=False, encoding='utf-8')
+
+conn.close()
+db.dispose()
+print('closed connections')
diff --git a/src/old_codes/building_database_onlyFigModels_wo_hucwatersheds.py b/src/old_codes/building_database_onlyFigModels_wo_hucwatersheds.py
new file mode 100644
index 0000000..7d93b81
--- /dev/null
+++ b/src/old_codes/building_database_onlyFigModels_wo_hucwatersheds.py
@@ -0,0 +1,534 @@
+
+#######################################################
+## Script to join all Excel files and build a database
+#######################################################
+
+import os
+import numpy as np
+import pandas as pd
+import configparser
+from sqlalchemy import create_engine
+from sqlalchemy import text
+
+###################################
+## 0. Read data
+###################################
+os.chdir(r'G:\Shared drives\Perceptual model review\ForRyoko\perceptual-model-arcgis\dev\scripts')
+
+df_loc = pd.read_excel('../data/Location_formatted.xlsx') # The lat/lon should be pre-formatted in decimal units
+# df_model = pd.read_csv('../data/ModelAnalysis.csv', encoding='utf-8')
+df_model = pd.read_excel('../data/ModelAnalysis.xlsx')
+df_taxonomy = pd.read_excel('../data/ProcessHierarchyNetwork.xlsx')
+df_FunctionType = pd.read_excel('../data/FunctionType.xlsx')
+
+## Parse dataframe into table
+
+# Location table
+# Sanity check if data can be joined
+# df.set_index('key').join(other.set_index('key'))
+df_loc["id"] = df_loc.index + 1
+df_loc = df_loc.drop(columns='Unnamed: 0')
+df_loc["huc_watershed_id"] = np.nan
+
+# FunctionType table
+df_FunctionType["id"] = df_FunctionType.index + 1
+
+# Citation table
+df_model["attribution_url"].fillna(df_model["url"], inplace=True)
+df_citation = df_model[["citation", "url"]].copy()
+df_citation["attribution"] = df_model["attribution"].copy()
+df_citation["attribution_url"] = df_model["attribution_url"].copy()
+df_citation["id"] = df_citation.index + 1
+
+# Spatial and temporal zone tables
+df_spatialZoneType = df_model["spatial_property"].copy().drop_duplicates()
+df_spatialZoneType = df_spatialZoneType.to_frame()
+df_spatialZoneType.reset_index(inplace=True)
+df_spatialZoneType = df_spatialZoneType.drop(columns='index')
+df_spatialZoneType['id'] = df_spatialZoneType.index + 1
+df_temporalZoneType = df_model["temporal_property"].copy().drop_duplicates()
+df_temporalZoneType = df_temporalZoneType.to_frame()
+df_temporalZoneType.reset_index(inplace=True)
+df_temporalZoneType = df_temporalZoneType.drop(columns='index')
+df_temporalZoneType['id'] = df_temporalZoneType.index + 1
+
+# Alternative name table
+df_altNames0 = df_taxonomy.set_index(['process', 'function', 'identifier', 'process_level']).apply(
+ lambda x: x.str.split(',').explode()).reset_index()
+df_altNames = df_altNames0[['alternative_names', 'process']].copy()
+df_altNames['alternative_names'] = df_altNames['alternative_names'].str.strip()
+df_altNames['alternative_names'] = df_altNames['alternative_names'].str.capitalize()
+df_altNames.dropna(axis=0, inplace=True)
+df_altNames["id"] = df_altNames.index + 1
+
+# Model table
+df_model["id"] = df_model.index + 1
+df_modelmain = df_model[['id', 'citation', 'watershed_name',
+ 'figure_num', 'figure_url', 'figure_caption',
+ 'spatial_property', 'num_spatial_zones', 'temporal_property',
+ 'num_temporal_zones', 'vegetation_info', 'soil_info', 'geol_info',
+ 'topo_info', 'three_d_info', 'uncertainty_info', 'other_info'
+ ]].copy()
+
+# corgi_fig = "https://i.ibb.co/stdkk6P/corgi-with-notes.png"
+corgi_fig = "https://sdsugeo.maps.arcgis.com/sharing/rest/content/items/df499e37a2ef40d7885966952c627e01/data"
+df_modelmain['figure_url'] = df_modelmain['figure_url'].fillna(corgi_fig)
+df_modelmain['figure_url'][df_citation['attribution']=="Not open-access"] = corgi_fig
+df_citation['YN'] = df_citation['attribution']=="Not open-access"
+df_modelmain.rename(columns={"figure_num": "model_ref"})
+
+# LinkProcessPerceptual table
+# Get all the process original text and taxonomy name from model
+frames = [df_model[['id', 'flux1', 'flux1_taxonomy']].copy().rename(
+ columns={"id": "entry_id", "flux1": "original_text", "flux1_taxonomy": "process"}),
+ df_model[['id', 'flux2', 'flux2_taxonomy']].copy().rename(columns={"id": "entry_id", "flux2": "original_text", "flux2_taxonomy": "process"}),
+ df_model[['id', 'flux3', 'flux3_taxonomy']].copy().rename(columns={"id": "entry_id", "flux3": "original_text", "flux3_taxonomy": "process"}),
+ df_model[['id', 'flux4', 'flux4_taxonomy']].copy().rename(columns={"id": "entry_id", "flux4": "original_text", "flux4_taxonomy": "process"}),
+ df_model[['id', 'flux5', 'flux5_taxonomy']].copy().rename(columns={"id": "entry_id", "flux5": "original_text", "flux5_taxonomy": "process"}),
+ df_model[['id', 'flux6', 'flux6_taxonomy']].copy().rename(columns={"id": "entry_id", "flux6": "original_text", "flux6_taxonomy": "process"}),
+ df_model[['id', 'flux7', 'flux7_taxonomy']].copy().rename(columns={"id": "entry_id", "flux7": "original_text", "flux7_taxonomy": "process"}),
+ df_model[['id', 'flux8', 'flux8_taxonomy']].copy().rename(columns={"id": "entry_id", "flux8": "original_text", "flux8_taxonomy": "process"}),
+ df_model[['id', 'flux9', 'flux9_taxonomy']].copy().rename(columns={"id": "entry_id", "flux9": "original_text", "flux9_taxonomy": "process"}),
+ df_model[['id', 'flux10', 'flux10_taxonomy']].copy().rename(columns={"id": "entry_id", "flux10": "original_text", "flux10_taxonomy": "process"}),
+ df_model[['id', 'flux11', 'flux11_taxonomy']].copy().rename(columns={"id": "entry_id", "flux11": "original_text", "flux11_taxonomy": "process"}),
+ df_model[['id', 'flux12', 'flux12_taxonomy']].copy().rename(columns={"id": "entry_id", "flux12": "original_text", "flux12_taxonomy": "process"}),
+ df_model[['id', 'store1', 'store1_taxonomy']].copy().rename(columns={"id": "entry_id", "store1": "original_text", "store1_taxonomy": "process"}),
+ df_model[['id', 'store2', 'store2_taxonomy']].copy().rename(columns={"id": "entry_id", "store2": "original_text", "store2_taxonomy": "process"}),
+ df_model[['id', 'store3', 'store3_taxonomy']].copy().rename(columns={"id": "entry_id", "store3": "original_text", "store3_taxonomy": "process"}),
+ df_model[['id', 'store4', 'store4_taxonomy']].copy().rename( columns={"id": "entry_id", "store4": "original_text", "store4_taxonomy": "process"}),
+ df_model[['id', 'store5', 'store5_taxonomy']].copy().rename(columns={"id": "entry_id", "store5": "original_text", "store5_taxonomy": "process"}),
+ df_model[['id', 'store6', 'store6_taxonomy']].copy().rename(columns={"id": "entry_id", "store6": "original_text", "store6_taxonomy": "process"}),
+ df_model[['id', 'store7', 'store7_taxonomy']].copy().rename(columns={"id": "entry_id", "store7": "original_text", "store7_taxonomy": "process"}),
+ df_model[['id', 'store8', 'store8_taxonomy']].copy().rename(columns={"id": "entry_id", "store8": "original_text", "store8_taxonomy": "process"}),
+ ]
+
+df_linkProcessPerceptual0 = pd.concat(frames, axis=0, ignore_index=True)
+df_linkProcessPerceptual0["id"] = df_linkProcessPerceptual0.index + 1
+
+# Create taxonomy table
+df_process0 = df_taxonomy.drop(columns='alternative_names')
+
+# join process taxonomy and model table
+df_linkProcessPerceptual0["process_lower"] = df_linkProcessPerceptual0['process'].str.lower()
+df_linkProcessPerceptual0["process_lower"] = df_linkProcessPerceptual0['process_lower'].str.strip()
+df_process0["process_lower"] = df_process0['process'].str.lower()
+df_process0["process_lower"] = df_process0['process_lower'].str.strip()
+
+# find and add some new process from model table to taxonomy table (# Check here if you want to check process miscategorization)
+df_linkProcessPerceptual1 = df_linkProcessPerceptual0.merge(df_process0, on='process_lower', how='left')
+new_process = df_linkProcessPerceptual1.loc[(df_linkProcessPerceptual1['process_x'].isnull() == False) & (
+ df_linkProcessPerceptual1['process_y'].isnull() == True)]
+new_process.drop_duplicates(subset='process_lower', inplace=True)
+
+add_new_process = pd.DataFrame(
+ {'process': new_process['process_x'], 'process_lower': new_process['process_x'].str.lower(),
+ 'identifier': ['NewProcess'] * len(new_process['process_x'])})
+df_process1 = pd.concat([df_process0, add_new_process])
+df_process1["id"] = df_process1.reset_index().index + 1
+
+
+# re-join process taxonomy and model table with new process
+df_linkProcessPerceptual2 = df_linkProcessPerceptual0.merge(df_process1, on='process_lower', how='left')
+df_linkProcessPerceptual2.rename(columns={"id_y": "process_id"}, inplace=True)
+df_linkProcessPerceptual = df_linkProcessPerceptual2.drop(
+ columns={'process_x', 'id_x', 'process_lower', 'process_y', 'function', 'identifier', 'process_level'})
+df_linkProcessPerceptual.dropna(subset=['original_text'], axis=0, inplace=True)
+df_linkProcessPerceptual["id"] = df_linkProcessPerceptual.reset_index().index + 1
+df_linkProcessPerceptual["process_id"] = df_linkProcessPerceptual["process_id"].astype('int')
+# df_linkProcessPerceptual[df_linkProcessPerceptual['process_id'].isnull()]
+df_process = df_process1.drop(columns='process_lower')
+
+###################################
+## 1. Connect to SQL database
+###################################
+
+# Read config
+config = configparser.ConfigParser()
+config.read('config.ini')
+
+DB_NAME = config['postgresql']['DB_NAME']
+HOST = config['postgresql']['HOST']
+PORT = config['postgresql']['PORT']
+USER_NAME = config['postgresql']['USER_NAME']
+PASSWD = config['postgresql']['PASSWD']
+
+# Connect to database
+conn_string = f'postgresql://{USER_NAME}:{PASSWD}@{HOST}:{PORT}/{DB_NAME}'
+db = create_engine(conn_string, client_encoding='utf8')
+try:
+ conn = db.connect()
+ print("connection to '%s'@'%s' success!" % (DB_NAME, HOST))
+except Exception as e:
+ print("connection to '%s'@'%s' failed." % (DB_NAME, HOST))
+ print(e)
+
+###################################
+## 2. Create database
+###################################
+
+tables = ['locations', 'citations', 'spatial_zone_type', 'temporal_zone_type', 'process_alt_names',
+ 'function_type', 'perceptual_model', 'link_process_perceptual', 'process_taxonomy']
+conn.execute(text("set search_path to public, perceptual_model"))
+conn.execute(text("SET CLIENT_ENCODING TO 'UTF8';"))
+for table in tables:
+ try:
+ conn.execute(text(f"DROP TABLE {table} CASCADE;"))
+ print('drop old tables')
+ except Exception as e:
+ print(e)
+
+schema = 'perceptual_model'
+connarg = {'con': conn, 'schema': 'perceptual_model', 'if_exists': 'replace', 'index': False}
+
+# set table names in lower case https://github.com/pandas-dev/pandas/issues/13206
+df_loc.to_sql('locations', **connarg)
+df_citation.to_sql('citations', **connarg)
+df_spatialZoneType.to_sql('spatial_zone_type', **connarg)
+df_temporalZoneType.to_sql('temporal_zone_type', **connarg)
+df_altNames.to_sql('process_alt_names', **connarg)
+df_FunctionType.to_sql('function_type', **connarg)
+df_modelmain.to_sql('perceptual_model', **connarg)
+df_linkProcessPerceptual.to_sql('link_process_perceptual', **connarg)
+df_process.to_sql('process_taxonomy', **connarg)
+
+# Relate the location table to HUC8 watershed table
+query = "ALTER TABLE perceptual_model.locations \
+ADD COLUMN pt geometry(point, 4326); \
+WITH pt_geom AS ( \
+ SELECT id, ST_SetSRID(ST_MakePoint(lon, lat), 4326) AS pt \
+ from perceptual_model.locations \
+ ) \
+UPDATE perceptual_model.locations \
+SET pt = pt_geom.pt \
+FROM pt_geom \
+WHERE pt_geom.id = locations.id; \
+ "
+# ALTER TABLE locations \
+# ALTER COLUMN huc_watershed_id TYPE INTEGER USING huc_watershed_id::integer; \
+# WITH joined_huc8_pt AS ( \
+# SELECT locations.id AS pt_id, huc_watersheds.id as huc8_id, huc_watersheds.huc8 AS huc8_code \
+# FROM locations \
+# JOIN huc_watersheds \
+# ON ST_contains(ST_Transform(huc_watersheds.geom, 4326), locations.pt) \
+# ) \
+# UPDATE locations \
+# SET huc_watershed_id = joined_huc8_pt.huc8_id \
+# FROM joined_huc8_pt \
+# WHERE locations.id = joined_huc8_pt.pt_id;"
+
+try:
+ conn.execute(text(query))
+ print("success")
+except Exception as e:
+ print(e)
+
+# add primary keys
+for table in tables:
+ try:
+ conn.execute(text(f"ALTER TABLE {table} ADD PRIMARY KEY (id);"))
+ print(f"successfully created table {table}")
+ except Exception as e:
+ print(e)
+
+# add foreign keys
+# model & location
+query = "ALTER TABLE perceptual_model ADD COLUMN location_id int; \
+UPDATE perceptual_model \
+SET location_id = locations.id \
+FROM locations \
+WHERE perceptual_model.watershed_name = locations.name; \
+ALTER TABLE perceptual_model \
+ADD FOREIGN KEY (location_id) REFERENCES locations(id); \
+ALTER TABLE perceptual_model DROP COLUMN watershed_name;"
+
+try:
+ conn.execute(text(query))
+ print("success")
+except Exception as e:
+ print(e)
+
+# model & citation
+query = "ALTER TABLE perceptual_model ADD COLUMN citation_id int; \
+UPDATE perceptual_model \
+SET citation_id = citations.id \
+FROM citations \
+WHERE perceptual_model.citation = citations.citation; \
+ALTER TABLE perceptual_model \
+ADD FOREIGN KEY (citation_id) REFERENCES citations(id); \
+ALTER TABLE perceptual_model DROP COLUMN citation;"
+
+try:
+ conn.execute(text(query))
+ print("success")
+except Exception as e:
+ print(e)
+
+# model & spatial zone
+query = "ALTER TABLE perceptual_model ADD COLUMN spatialzone_id int; \
+UPDATE perceptual_model \
+SET spatialzone_id = spatial_zone_type.id \
+FROM spatial_zone_type \
+WHERE perceptual_model.spatial_property = spatial_zone_type.spatial_property; \
+ALTER TABLE perceptual_model \
+ADD FOREIGN KEY (spatialzone_id) REFERENCES spatial_zone_type(id); \
+ALTER TABLE perceptual_model DROP COLUMN spatial_property;"
+
+try:
+ conn.execute(text(query))
+ print("success")
+except Exception as e:
+ print(e)
+
+# model & temporal zone
+query = "ALTER TABLE perceptual_model ADD COLUMN temporalzone_id int; \
+UPDATE perceptual_model \
+SET temporalzone_id = temporal_zone_type.id \
+FROM temporal_zone_type \
+WHERE perceptual_model.temporal_property = temporal_zone_type.temporal_property; \
+ALTER TABLE perceptual_model \
+ADD FOREIGN KEY (temporalzone_id) REFERENCES temporal_zone_type(id); \
+ALTER TABLE perceptual_model DROP COLUMN temporal_property;"
+
+try:
+ conn.execute(text(query))
+ print("success")
+except Exception as e:
+ print(e)
+
+# model & linktable
+query = "ALTER TABLE link_process_perceptual \
+ADD FOREIGN KEY (entry_id) REFERENCES perceptual_model(id);"
+
+try:
+ conn.execute(text(query))
+ print("success")
+except Exception as e:
+ print(e)
+
+# process taxonomy & alternative names
+query = "ALTER TABLE process_alt_names ADD COLUMN process_id int; \
+UPDATE process_alt_names \
+SET process_id = process_taxonomy.id \
+FROM process_taxonomy \
+WHERE process_alt_names.process = process_taxonomy.process; \
+ALTER TABLE process_alt_names \
+ADD FOREIGN KEY (process_id) REFERENCES process_taxonomy(id); \
+ALTER TABLE process_alt_names DROP COLUMN process;"
+
+try:
+ conn.execute(text(query))
+ print("success")
+except Exception as e:
+ print(e)
+
+# process taxonomy & function type
+query = "ALTER TABLE process_taxonomy ADD COLUMN function_id int; \
+UPDATE process_taxonomy \
+SET function_id = function_type.id \
+FROM function_type \
+WHERE process_taxonomy.function = function_type.name; \
+ALTER TABLE process_taxonomy \
+ADD FOREIGN KEY (function_id) REFERENCES function_type(id); \
+ALTER TABLE process_taxonomy DROP COLUMN function;"
+
+try:
+ conn.execute(text(query))
+ print("success")
+except Exception as e:
+ print(e)
+
+# # huc_watersheds & locations
+# query = "ALTER TABLE locations \
+# ADD FOREIGN KEY (huc_watershed_id) \
+# REFERENCES huc_watersheds(id);"
+
+# try:
+# conn.execute(text(query))
+# print("success")
+# except Exception as e:
+# print(e)
+
+
+# linktable & process taxonomy
+
+# somehow this does not work ...
+"""
+# try joining on pandas ...
+query = "ALTER TABLE link_process_perceptual ADD COLUMN process_id int; \
+UPDATE link_process_perceptual \
+SET process_id = process_taxonomy.id \
+FROM process_taxonomy \
+WHERE link_process_perceptual.process::text ILIKE process_taxonomy.process::text; \
+ALTER TABLE link_process_perceptual \
+ADD FOREIGN KEY (process_id) REFERENCES process_taxonomy(id);" # \
+# ALTER TABLE link_process_perceptual DROP COLUMN process_name;"
+"""
+
+# try joining on pandas ...
+query = "ALTER TABLE link_process_perceptual \
+ADD FOREIGN KEY (process_id) REFERENCES process_taxonomy(id);"
+# \
+# ALTER TABLE link_process_perceptual DROP COLUMN process_name;"
+
+try:
+ conn.execute(text(query))
+ print("Link taxonomy & perceptual model -- success")
+except Exception as e:
+ print(e)
+
+# drop_tables = "DROP TABLE giant_table, giant_table_flux, giant_table_store, giant_table_update;"
+# try:
+# conn.execute(text(drop_tables))
+# print("Drop old temp tables -- success")
+# except Exception as e:
+# print(e)
+
+## Join tables and dump everything into csv file
+# https://hevodata.com/learn/postgres-export-to-csv/
+join_desired_tables = "\
+CREATE TEMP TABLE giant_table AS (\
+SELECT perceptual_model.id, \
+ citations.citation, \
+ citations.url, \
+ citations.attribution, \
+ citations.attribution_url, \
+ perceptual_model.figure_num, \
+ perceptual_model.figure_caption, \
+ perceptual_model.figure_url, \
+ locations.name AS watershed_name, \
+ locations.lat, \
+ locations.lon, \
+ locations.area_km2, \
+ process_taxonomy.process, \
+ process_taxonomy.identifier,\
+ function_type.name AS function_name,\
+ perceptual_model.num_spatial_zones,\
+ spatial_zone_type.spatial_property,\
+ perceptual_model.num_temporal_zones,\
+ temporal_zone_type.temporal_property,\
+ perceptual_model.vegetation_info,\
+ perceptual_model.soil_info,\
+ perceptual_model.geol_info,\
+ perceptual_model.topo_info,\
+ perceptual_model.three_d_info,\
+ perceptual_model.uncertainty_info,\
+ perceptual_model.other_info\
+ FROM perceptual_model \
+ INNER JOIN citations \
+ ON citations.id = perceptual_model.citation_id \
+ INNER JOIN locations \
+ ON locations.id = perceptual_model.location_id \
+ INNER JOIN spatial_zone_type \
+ ON spatial_zone_type.id = perceptual_model.spatialzone_id \
+ INNER JOIN temporal_zone_type \
+ ON temporal_zone_type.id = perceptual_model.temporalzone_id \
+ INNER JOIN link_process_perceptual \
+ ON perceptual_model.id = link_process_perceptual.entry_id \
+ INNER JOIN process_taxonomy \
+ ON link_process_perceptual.process_id = process_taxonomy.id \
+ INNER JOIN function_type \
+ ON process_taxonomy.function_id = function_type.id \
+ORDER BY perceptual_model.id \
+);"
+
+join_desired_tables2 = "\
+CREATE TEMP TABLE giant_table_base AS ( \
+SELECT DISTINCT \
+ id, \
+ citation, \
+ url, \
+ attribution, \
+ attribution_url, \
+ figure_num, \
+ figure_caption, \
+ figure_url, \
+ watershed_name, \
+ lat, \
+ lon, \
+ area_km2, \
+ num_spatial_zones, \
+ spatial_property, \
+ num_temporal_zones, \
+ temporal_property, \
+ vegetation_info, \
+ soil_info, \
+ geol_info, \
+ topo_info, \
+ three_d_info, \
+ uncertainty_info, \
+ other_info \
+FROM giant_table \
+); \
+CREATE TEMP TABLE giant_table_flux AS ( \
+SELECT DISTINCT \
+id AS temp_id1, \
+COUNT(process) OVER(PARTITION BY id) AS num_flux, \
+STRING_AGG(process, ', ') OVER(PARTITION BY id) AS flux_list, \
+STRING_AGG(identifier, ', ') OVER(PARTITION BY id) AS flux_id_list \
+FROM giant_table \
+ WHERE function_name ILIKE 'Filling of store' \
+ OR function_name ILIKE 'Release from store' \
+ OR function_name ILIKE 'In-catchment flux' \
+ OR function_name ILIKE 'In-store flux' \
+ OR function_name ILIKE 'Release' \
+ ); \
+CREATE TEMP TABLE giant_table_store AS ( \
+SELECT DISTINCT id AS temp_id2, \
+COUNT(process) OVER(PARTITION BY id) AS num_store, \
+STRING_AGG(process, ', ') OVER(PARTITION BY id) AS store_list, \
+STRING_AGG(identifier, ', ') OVER(PARTITION BY id) AS store_id_list \
+FROM giant_table \
+ WHERE function_name ILIKE 'Store' \
+ OR function_name ILIKE 'Store, temporary' \
+ OR function_name ILIKE 'Store characteristics, temporary' \
+ OR function_name ILIKE 'Store characteristics, permanent' \
+ ); \
+CREATE TEMP TABLE giant_table_update AS ( \
+SELECT * FROM giant_table_base \
+LEFT JOIN giant_table_store \
+ON giant_table_base.id = giant_table_store.temp_id2 \
+LEFT JOIN giant_table_flux \
+ON giant_table_base.id = giant_table_flux.temp_id1 \
+ORDER BY id \
+ ); \
+ALTER TABLE giant_table_update \
+DROP COLUMN temp_id1, \
+DROP COLUMN temp_id2, \
+ADD COLUMN dummy_column NUMERIC DEFAULT 1; \
+"
+
+try:
+ conn.execute(text(join_desired_tables))
+ print("success")
+except Exception as e:
+ print(e)
+
+try:
+ conn.execute(text(join_desired_tables2))
+ print("success")
+except Exception as e:
+ print(e)
+
+
+# save_table = "\copy giant_table_update TO 'G://Shared drives/Perceptual model review/ForRyoko/perceptual-model-arcgis/db_dev/data/giant_table_update.csv' WITH DELIMITER ',' CSV HEADER;"
+# conn.execute(save_table)
+
+query = "SELECT * FROM giant_table_update"
+try:
+ df_results = pd.read_sql(text(query), conn)
+ # results = conn.execute(query).fetchall()
+ print("success")
+ print(df_results.columns)
+except Exception as e:
+ print(e)
+
+df_results['huc_watershed_id'] = 'N/A'
+df_results['num_store'].fillna(0, inplace=True)
+df_results['num_flux'].fillna(0, inplace=True)
+df_results['area_km2'].fillna(-9999, inplace=True)
+df_results.fillna('N/A', inplace=True)
+df_results.to_csv('../data/giant_table_v4.csv', sep=',', header=True, index=False, encoding='utf-8')
+
+conn.close()
+db.dispose()
+print('closed connections')
diff --git a/src/old_codes/building_database_read_huc8.sql b/src/old_codes/building_database_read_huc8.sql
new file mode 100644
index 0000000..3661f37
--- /dev/null
+++ b/src/old_codes/building_database_read_huc8.sql
@@ -0,0 +1,114 @@
+-- This script reads HUC8 watershed shapefile and relate it with perceptual model locations using PostGIS
+-- Ryoko Araki
+
+-- 0. Build database using "building_database.py"
+
+-- 1. Read HUC8 shapefiles into PostgreSQL
+-- Run the following command in the command prompt.
+-- Only need to read once when creating a new database
+-- "C:\OSGeo4W64\bin\ogr2ogr.exe" -f "PostgreSQL" PG:"host=[HOST_NAME] port=[PORT_NUM] dbname=[DB_NAME] user=[USER_NAME] password=[PASSWROD]" -nln "perceptual_model.huc_watersheds" -nlt POLYGON -lco GEOMETRY_NAME=geom -lco FID=id -lco PRECISION=NO [PATH_TO_THE_SHAPEFILE]
+
+-- c.f.
+-- https://gdal.org/programs/ogr2ogr.html
+-- "-f": output format name
+-- "-nln " Asign an alternate name to the new layer
+-- "-nlt " Degine the geometry type
+-- "-lco" Layer creation option (format specific)
+
+-- 2. Relate it with point geometry in the perceptual model
+
+-- Log-in to PostgreSQL
+-- "C:\Program Files\PostgreSQL\14\bin\psql.exe" -h [HOST_NAME] -U [USER_NAME] -d [DATABASE_NAME]
+SET search_path TO public, perceptual_model;
+SET CLIENT_ENCODING TO 'UTF8';
+
+SELECT ST_SetSRID((SELECT geom FROM huc_watersheds LIMIT 1),4326) AS geom_4326;
+UPDATE huc_watersheds SET geom = ST_Force_2D(geom);
+UPDATE huc_watersheds SET geom = ST_SetSRID(geom, 4326);
+
+UPDATE huc_watersheds SET geom = ST_Transform(geom, 4326) WHERE ST_SRID(geom) = 900914;;
+
+ST_Transform(huc_watersheds.geom,4326);
+ST_SRID(huc_watersheds.geom);
+-- Create a column for the point geometry (perceptual model locations)
+ALTER TABLE perceptual_model.locations
+ADD COLUMN pt geometry(point, 4326);
+
+SELECT ST_SRID((SELECT geom FROM huc_watersheds LIMIT 1));
+
+WITH pt_geom AS (
+ SELECT id, ST_SetSRID(ST_MakePoint(lon, lat), 4326) AS pt
+ from perceptual_model.locations
+ )
+UPDATE perceptual_model.locations
+SET pt = pt_geom.pt
+FROM pt_geom
+WHERE pt_geom.id = locations.id;
+
+-- Find the HUC8 polygon that a point is contained (PostGIS 'contains'?)
+-- This takes a few minutes.
+-- TODO: convert original shapefile and delete ST_Transform to save execution time
+ALTER TABLE locations
+ALTER COLUMN huc_watershed_id TYPE INTEGER USING huc_watershed_id::integer;
+
+WITH joined_huc8_pt AS (
+SELECT locations.id AS pt_id, huc_watersheds.id as huc8_id, huc_watersheds.huc8 AS huc8_code
+FROM locations
+JOIN huc_watersheds
+ON ST_contains(ST_Transform(huc_watersheds.geom, 4326), locations.pt)
+)
+UPDATE locations
+SET huc_watershed_id = joined_huc8_pt.huc8_id
+FROM joined_huc8_pt
+WHERE locations.id = joined_huc8_pt.pt_id;
+
+-- Set up primary & foregin keys
+ALTER TABLE locations
+ADD FOREIGN KEY (huc_watershed_id)
+REFERENCES huc_watersheds(id);
+
+-- Just keep all original sources for now
+-- ALTER TABLE huc_watersheds DROP COLUMN lat, DROP COLUMN lon;
+
+-- Check
+
+SELECT locations.name, huc_watersheds.huc8
+FROM locations
+LEFT JOIN huc_watersheds
+ON locations.huc_watershed_id = huc_watersheds.id;
+
+-- 3. Check with QGIS
+-- done
+
+
+
+CREATE TEMP TABLE giant_table AS (
+SELECT perceptual_model.id,
+ locations.name AS watershed_name,
+ huc_watersheds.huc8::text AS huc8_id
+ FROM perceptual_model
+ INNER JOIN citations
+ ON citations.id = perceptual_model.citation_id
+ INNER JOIN locations
+ ON locations.id = perceptual_model.location_id
+ INNER JOIN spatial_zone_type
+ ON spatial_zone_type.id = perceptual_model.spatialzone_id
+ INNER JOIN temporal_zone_type
+ ON temporal_zone_type.id = perceptual_model.temporalzone_id
+ INNER JOIN link_process_perceptual
+ ON perceptual_model.id = link_process_perceptual.entry_id
+ INNER JOIN process_taxonomy
+ ON link_process_perceptual.process_id = process_taxonomy.id
+ INNER JOIN function_type
+ ON process_taxonomy.function_id = function_type.id
+ LEFT JOIN huc_watersheds
+ ON locations.huc_watershed_id = huc_watersheds.id
+ORDER BY perceptual_model.id
+);
+
+CREATE TEMP TABLE giant_table_base AS (
+ SELECT DISTINCT
+ id,
+ huc8_id AS huc_watershed_id
+ FROM giant_table
+);
\ No newline at end of file
diff --git a/src/old_codes/create_webmap_onlyFigModels.ipynb b/src/old_codes/create_webmap_onlyFigModels.ipynb
new file mode 100644
index 0000000..8e1b099
--- /dev/null
+++ b/src/old_codes/create_webmap_onlyFigModels.ipynb
@@ -0,0 +1,1466 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "17ab89f6",
+ "metadata": {},
+ "source": [
+ "# Create ArcGIS webmap on perceptual-model database\n",
+ "\n",
+ "I referred to Jessica's instruction to create this notebook https://github.com/jlembury/GEOG594-Embury/blob/master/DEMO_ArcGIS_API_Python.ipynb"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "4d8e4271",
+ "metadata": {},
+ "source": [
+ "## Import modules"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "22ba798c-c407-427b-9f94-de4752a43cd2",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import os\n",
+ "import webbrowser\n",
+ "import pandas as pd\n",
+ "pd.options.mode.chained_assignment = None # default='warn'\n",
+ "import requests\n",
+ "import json\n",
+ "\n",
+ "import arcgis\n",
+ "from arcgis.gis import GIS\n",
+ "from arcgis.features import FeatureLayerCollection\n",
+ "from arcgis.mapping import WebMap\n",
+ "from arcgis.geometry import Point, Polyline, Polygon, Geometry"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "463eae66",
+ "metadata": {},
+ "source": [
+ "## Connect with ArcGIS\n",
+ "Reference for authentication schemes: https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9f19dd88",
+ "metadata": {},
+ "source": [
+ "I ended up in using User autentification with OAuth 2.0 in Reference for authentication schemes: https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "5328c70c",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "with open('./auth.json', 'r') as infile:\n",
+ " my_credentials = json.load(infile)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "id": "074777e1-72da-4731-8959-b076f710c596",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "gis = GIS(\"https://sdsugeo.maps.arcgis.com/\", client_id=my_credentials['client_id'])\n",
+ "print(\"Successfully logged in as: \" + gis.properties.user.username)\n",
+ "# Note: log-in expires after an hour or so \n",
+ "\n",
+ "# Clear the output for security \n",
+ "from IPython.display import clear_output\n",
+ "clear_output(wait=False)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "bfa15a0b",
+ "metadata": {},
+ "source": [
+ "open"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0108b7af",
+ "metadata": {},
+ "source": [
+ "If you have ArcGIS pro, this is the most straightforward and easy connection"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "id": "da85ed62",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "ImportError",
+ "evalue": "The login failed because the arcpy library could not be found in your Python environment. Try logging in with a different set of credentials.",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[1;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
+ "File \u001b[1;32mc:\\Users\\flipl\\miniconda3\\envs\\arcgis\\lib\\site-packages\\arcgis\\gis\\_impl\\_portalpy.py:118\u001b[0m, in \u001b[0;36mPortal.__init__\u001b[1;34m(self, url, username, password, key_file, cert_file, expiration, referer, proxy_host, proxy_port, connection, workdir, tokenurl, verify_cert, client_id, custom_auth, token, **kwargs)\u001b[0m\n\u001b[0;32m 117\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[1;32m--> 118\u001b[0m \u001b[39mimport\u001b[39;00m \u001b[39marcpy\u001b[39;00m\n\u001b[0;32m 120\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m arcpy\u001b[39m.\u001b[39mGetSigninToken():\n",
+ "\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'arcpy'",
+ "\nDuring handling of the above exception, another exception occurred:\n",
+ "\u001b[1;31mImportError\u001b[0m Traceback (most recent call last)",
+ "Cell \u001b[1;32mIn[4], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m gis \u001b[39m=\u001b[39m GIS(\u001b[39m'\u001b[39;49m\u001b[39mPro\u001b[39;49m\u001b[39m'\u001b[39;49m)\n\u001b[0;32m 2\u001b[0m \u001b[39mprint\u001b[39m(\u001b[39m\"\u001b[39m\u001b[39mLogged in as \u001b[39m\u001b[39m\"\u001b[39m \u001b[39m+\u001b[39m \u001b[39mstr\u001b[39m(gis\u001b[39m.\u001b[39mproperties\u001b[39m.\u001b[39muser\u001b[39m.\u001b[39musername))\n",
+ "File \u001b[1;32mc:\\Users\\flipl\\miniconda3\\envs\\arcgis\\lib\\site-packages\\arcgis\\gis\\__init__.py:507\u001b[0m, in \u001b[0;36mGIS.__init__\u001b[1;34m(self, url, username, password, key_file, cert_file, verify_cert, set_active, client_id, profile, **kwargs)\u001b[0m\n\u001b[0;32m 501\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mRuntimeError\u001b[39;00m(\n\u001b[0;32m 502\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mAn untrusted SSL error occurred when attempting to connect to the provided GIS.\u001b[39m\u001b[39m\\n\u001b[39;00m\u001b[39m\"\u001b[39m\n\u001b[0;32m 503\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mIf you trust this server and want to proceed, add \u001b[39m\u001b[39m'\u001b[39m\u001b[39mverify_cert=False\u001b[39m\u001b[39m'\u001b[39m\u001b[39m as an \u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m 504\u001b[0m \u001b[39m\"\u001b[39m\u001b[39margument when connecting to the GIS.\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m 505\u001b[0m )\n\u001b[0;32m 506\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m--> 507\u001b[0m \u001b[39mraise\u001b[39;00m e\n\u001b[0;32m 508\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m 509\u001b[0m \u001b[39mif\u001b[39;00m (\n\u001b[0;32m 510\u001b[0m url\u001b[39m.\u001b[39mlower()\u001b[39m.\u001b[39mfind(\u001b[39m\"\u001b[39m\u001b[39marcgis.com\u001b[39m\u001b[39m\"\u001b[39m) \u001b[39m>\u001b[39m \u001b[39m-\u001b[39m\u001b[39m1\u001b[39m\n\u001b[0;32m 511\u001b[0m \u001b[39mand\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_portal\u001b[39m.\u001b[39mis_logged_in\n\u001b[0;32m 512\u001b[0m \u001b[39mand\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_portal\u001b[39m.\u001b[39mcon\u001b[39m.\u001b[39m_auth\u001b[39m.\u001b[39mlower() \u001b[39m==\u001b[39m \u001b[39m\"\u001b[39m\u001b[39moauth\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m 513\u001b[0m ):\n",
+ "File \u001b[1;32mc:\\Users\\flipl\\miniconda3\\envs\\arcgis\\lib\\site-packages\\arcgis\\gis\\__init__.py:448\u001b[0m, in \u001b[0;36mGIS.__init__\u001b[1;34m(self, url, username, password, key_file, cert_file, verify_cert, set_active, client_id, profile, **kwargs)\u001b[0m\n\u001b[0;32m 446\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_expiration \u001b[39m=\u001b[39m \u001b[39m60\u001b[39m\n\u001b[0;32m 447\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[1;32m--> 448\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_portal \u001b[39m=\u001b[39m _portalpy\u001b[39m.\u001b[39;49mPortal(\n\u001b[0;32m 449\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_url,\n\u001b[0;32m 450\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_username,\n\u001b[0;32m 451\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_password,\n\u001b[0;32m 452\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_key_file,\n\u001b[0;32m 453\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_cert_file,\n\u001b[0;32m 454\u001b[0m proxy_host\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_proxy_host,\n\u001b[0;32m 455\u001b[0m proxy_port\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_proxy_port,\n\u001b[0;32m 456\u001b[0m verify_cert\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_verify_cert,\n\u001b[0;32m 457\u001b[0m client_id\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_client_id,\n\u001b[0;32m 458\u001b[0m expiration\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_expiration,\n\u001b[0;32m 459\u001b[0m referer\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_referer,\n\u001b[0;32m 460\u001b[0m custom_auth\u001b[39m=\u001b[39;49mcustom_auth, \u001b[39m# token=self._utoken,\u001b[39;49;00m\n\u001b[0;32m 461\u001b[0m client_secret\u001b[39m=\u001b[39;49mclient_secret,\n\u001b[0;32m 462\u001b[0m trust_env\u001b[39m=\u001b[39;49mkwargs\u001b[39m.\u001b[39;49mget(\u001b[39m\"\u001b[39;49m\u001b[39mtrust_env\u001b[39;49m\u001b[39m\"\u001b[39;49m, \u001b[39mNone\u001b[39;49;00m),\n\u001b[0;32m 463\u001b[0m timeout\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_timeout,\n\u001b[0;32m 464\u001b[0m proxy\u001b[39m=\u001b[39;49mkwargs\u001b[39m.\u001b[39;49mget(\u001b[39m\"\u001b[39;49m\u001b[39mproxy\u001b[39;49m\u001b[39m\"\u001b[39;49m, \u001b[39mNone\u001b[39;49;00m),\n\u001b[0;32m 465\u001b[0m custom_adapter\u001b[39m=\u001b[39;49mcustom_adapter,\n\u001b[0;32m 466\u001b[0m token\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_utoken,\n\u001b[0;32m 467\u001b[0m api_key\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_api_key,\n\u001b[0;32m 468\u001b[0m is_hosted_nb_home\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_is_hosted_nb_home,\n\u001b[0;32m 469\u001b[0m use_gen_token\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_use_gen_token,\n\u001b[0;32m 470\u001b[0m )\n\u001b[0;32m 471\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_portal\u001b[39m.\u001b[39mis_kubernetes:\n\u001b[0;32m 472\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39m.\u001b[39;00m\u001b[39mkubernetes\u001b[39;00m\u001b[39m.\u001b[39;00m\u001b[39m_sharing\u001b[39;00m \u001b[39mimport\u001b[39;00m KbertnetesPy\n",
+ "File \u001b[1;32mc:\\Users\\flipl\\miniconda3\\envs\\arcgis\\lib\\site-packages\\arcgis\\gis\\_impl\\_portalpy.py:125\u001b[0m, in \u001b[0;36mPortal.__init__\u001b[1;34m(self, url, username, password, key_file, cert_file, expiration, referer, proxy_host, proxy_port, connection, workdir, tokenurl, verify_cert, client_id, custom_auth, token, **kwargs)\u001b[0m\n\u001b[0;32m 123\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39murl \u001b[39m=\u001b[39m url\n\u001b[0;32m 124\u001b[0m \u001b[39mexcept\u001b[39;00m \u001b[39mImportError\u001b[39;00m:\n\u001b[1;32m--> 125\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mImportError\u001b[39;00m(\n\u001b[0;32m 126\u001b[0m (\n\u001b[0;32m 127\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mThe login failed because the arcpy library could not be found in your Python environment. \u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m 128\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mTry logging in with a different set of credentials.\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m 129\u001b[0m )\n\u001b[0;32m 130\u001b[0m )\n\u001b[0;32m 131\u001b[0m \u001b[39mexcept\u001b[39;00m:\n\u001b[0;32m 132\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\u001b[39m\"\u001b[39m\u001b[39mCould not use Pro authentication.\u001b[39m\u001b[39m\"\u001b[39m)\n",
+ "\u001b[1;31mImportError\u001b[0m: The login failed because the arcpy library could not be found in your Python environment. Try logging in with a different set of credentials."
+ ]
+ }
+ ],
+ "source": [
+ "# gis = GIS('Pro')\n",
+ "# print(\"Logged in as \" + str(gis.properties.user.username))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f70e7222",
+ "metadata": {},
+ "source": [
+ "## Newly create a webmap (skip these blocks if you are updating)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "id": "c6a60883-733c-4690-8f2f-42a9d6759406",
+ "metadata": {
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "ename": "RuntimeError",
+ "evalue": "File(G:\\Shared drives\\Perceptual model review\\ForRyoko\\perceptual-model-arcgis\\db_dev\\data\\giant_table_v4.csv) not found.",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[1;31mRuntimeError\u001b[0m Traceback (most recent call last)",
+ "Cell \u001b[1;32mIn[7], line 9\u001b[0m\n\u001b[0;32m 5\u001b[0m csv_path \u001b[39m=\u001b[39m \u001b[39m\"\u001b[39m\u001b[39mG:\u001b[39m\u001b[39m\\\\\u001b[39;00m\u001b[39mShared drives\u001b[39m\u001b[39m\\\u001b[39m\u001b[39mPerceptual model review\u001b[39m\u001b[39m\\\\\u001b[39;00m\u001b[39mForRyoko\u001b[39m\u001b[39m\\\\\u001b[39;00m\u001b[39mperceptual-model-arcgis\u001b[39m\u001b[39m\\\\\u001b[39;00m\u001b[39mdb_dev\u001b[39m\u001b[39m\\\\\u001b[39;00m\u001b[39mdata\u001b[39m\u001b[39m\\\\\u001b[39;00m\u001b[39mgiant_table_v4.csv\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m 6\u001b[0m csv_properties\u001b[39m=\u001b[39m{\u001b[39m'\u001b[39m\u001b[39mtitle\u001b[39m\u001b[39m'\u001b[39m:\u001b[39m'\u001b[39m\u001b[39mfigure_models_v4\u001b[39m\u001b[39m'\u001b[39m,\n\u001b[0;32m 7\u001b[0m \u001b[39m'\u001b[39m\u001b[39mdescription\u001b[39m\u001b[39m'\u001b[39m:\u001b[39m'\u001b[39m\u001b[39mResults of perceptual model analysis. Only for figure models\u001b[39m\u001b[39m'\u001b[39m,\n\u001b[0;32m 8\u001b[0m \u001b[39m'\u001b[39m\u001b[39mtags\u001b[39m\u001b[39m'\u001b[39m:\u001b[39m'\u001b[39m\u001b[39mperceptual_model\u001b[39m\u001b[39m'\u001b[39m} \u001b[39m# Use different title for the new data \u001b[39;00m\n\u001b[1;32m----> 9\u001b[0m csv_item \u001b[39m=\u001b[39m gis\u001b[39m.\u001b[39;49mcontent\u001b[39m.\u001b[39;49madd(item_properties\u001b[39m=\u001b[39;49mcsv_properties, data\u001b[39m=\u001b[39;49mcsv_path)\n\u001b[0;32m 11\u001b[0m \u001b[39mprint\u001b[39m(csv_item)\n",
+ "File \u001b[1;32mc:\\Users\\flipl\\miniconda3\\envs\\arcgis\\lib\\site-packages\\arcgis\\gis\\__init__.py:5304\u001b[0m, in \u001b[0;36mContentManager.add\u001b[1;34m(self, item_properties, data, thumbnail, metadata, owner, folder, item_id, **kwargs)\u001b[0m\n\u001b[0;32m 5301\u001b[0m \u001b[39mif\u001b[39;00m filetype:\n\u001b[0;32m 5302\u001b[0m item_properties[\u001b[39m\"\u001b[39m\u001b[39mfileName\u001b[39m\u001b[39m\"\u001b[39m] \u001b[39m=\u001b[39m os\u001b[39m.\u001b[39mpath\u001b[39m.\u001b[39mbasename(data)\n\u001b[1;32m-> 5304\u001b[0m itemid \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_portal\u001b[39m.\u001b[39;49madd_item(\n\u001b[0;32m 5305\u001b[0m item_properties, data, thumbnail, metadata, owner_name, folder\n\u001b[0;32m 5306\u001b[0m )\n\u001b[0;32m 5308\u001b[0m \u001b[39mif\u001b[39;00m itemid \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[0;32m 5309\u001b[0m item \u001b[39m=\u001b[39m Item(\u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_gis, itemid)\n",
+ "File \u001b[1;32mc:\\Users\\flipl\\miniconda3\\envs\\arcgis\\lib\\site-packages\\arcgis\\gis\\_impl\\_portalpy.py:379\u001b[0m, in \u001b[0;36mPortal.add_item\u001b[1;34m(self, item_properties, data, thumbnail, metadata, owner, folder)\u001b[0m\n\u001b[0;32m 377\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39misinstance\u001b[39m(data, (io\u001b[39m.\u001b[39mBytesIO, io\u001b[39m.\u001b[39mStringIO)) \u001b[39m==\u001b[39m \u001b[39mFalse\u001b[39;00m:\n\u001b[0;32m 378\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m os\u001b[39m.\u001b[39mpath\u001b[39m.\u001b[39misfile(os\u001b[39m.\u001b[39mpath\u001b[39m.\u001b[39mabspath(data)):\n\u001b[1;32m--> 379\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mRuntimeError\u001b[39;00m(\u001b[39m\"\u001b[39m\u001b[39mFile(\u001b[39m\u001b[39m\"\u001b[39m \u001b[39m+\u001b[39m data \u001b[39m+\u001b[39m \u001b[39m\"\u001b[39m\u001b[39m) not found.\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[0;32m 380\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39misinstance\u001b[39m(data, (io\u001b[39m.\u001b[39mBytesIO, io\u001b[39m.\u001b[39mStringIO)):\n\u001b[0;32m 382\u001b[0m fn \u001b[39m=\u001b[39m item_properties\u001b[39m.\u001b[39mget(\u001b[39m\"\u001b[39m\u001b[39mfileName\u001b[39m\u001b[39m\"\u001b[39m, \u001b[39mNone\u001b[39;00m)\n",
+ "\u001b[1;31mRuntimeError\u001b[0m: File(G:\\Shared drives\\Perceptual model review\\ForRyoko\\perceptual-model-arcgis\\db_dev\\data\\giant_table_v4.csv) not found."
+ ]
+ }
+ ],
+ "source": [
+ "# This section is to create a new webmap only\n",
+ "# Note: if this module says 'data already exist', skip to the section called 'Update to new data'\n",
+ "\n",
+ "# Publish the CSV data to ArcGIS online\n",
+ "csv_path = \"G:\\\\Shared drives\\Perceptual model review\\\\ForRyoko\\\\perceptual-model-arcgis\\\\db_dev\\\\data\\\\giant_table_v4.csv\"\n",
+ "csv_properties={'title':'figure_models_v4',\n",
+ " 'description':'Results of perceptual model analysis. Only for figure models',\n",
+ " 'tags':'perceptual_model'} # Use different title for the new data \n",
+ "csv_item = gis.content.add(item_properties=csv_properties, data=csv_path)\n",
+ "\n",
+ "print(csv_item)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 35,
+ "id": "f4ebb706",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "- \n"
+ ]
+ }
+ ],
+ "source": [
+ "# Create and publich a feature layer from the CSV item\n",
+ "# Note: this automatically converts latitude and longitude to point geometry\n",
+ "feature_layer_item = csv_item.publish()\n",
+ "print(feature_layer_item)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 36,
+ "id": "c7c7f93f",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "31d8645bf557479085b53a5f473c6c8f\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Get feature layer id\n",
+ "feature_layer_id = feature_layer_item.id\n",
+ "print(feature_layer_id)\n",
+ "webbrowser.open('https://sdsugeo.maps.arcgis.com/apps/mapviewer/index.html?layers={}'.format(feature_layer_id), new=2)\n",
+ "\n",
+ "added_item = gis.content.get(feature_layer_id)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "id": "ec77a45a",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "b1d0582ade934e81930bed22eb685504\n"
+ ]
+ },
+ {
+ "data": {
+ "text/html": [
+ "
\n",
+ "
\n",
+ "\n",
+ "
\n",
+ "
\n",
+ " "
+ ],
+ "text/plain": [
+ "- "
+ ]
+ },
+ "execution_count": 37,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Create a webmap from the feature layers \n",
+ "\n",
+ "# Initialize map widget\n",
+ "webmap = gis.map()\n",
+ "\n",
+ "# Set an map extent (global)\n",
+ "webmap.extent = {'xmin': -140,\n",
+ " 'ymin':-50,\n",
+ " 'xmax':180,\n",
+ " 'ymax':65,\n",
+ " }\n",
+ "\n",
+ "# Add the created layer\n",
+ "webmap.add_layer(added_item)\n",
+ "\n",
+ "# Save the webmap\n",
+ "webmap_properties = {'title':'Perceptual Models Around the World',\n",
+ " 'snippet': 'description',\n",
+ " 'tags':'perceptual_model'}\n",
+ "\n",
+ "webmap_item = webmap.save(webmap_properties)\n",
+ "\n",
+ "# Display the webmap\n",
+ "webmap_item_id = webmap_item.id\n",
+ "print(webmap_item_id)\n",
+ "webbrowser.open('https://sdsugeo.maps.arcgis.com/apps/mapviewer/index.html?webmap={}'.format(webmap_item_id), new=2)\n",
+ "webmap_item"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ac4e04d5",
+ "metadata": {},
+ "source": [
+ "## Updating the existing webmap with new data"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "id": "2fc6f94a",
+ "metadata": {
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "
\n",
+ "
\n",
+ "\n",
+ "
\n",
+ "
figure_models_v4\n",
+ " \n",
+ "
Feature Layer Collection by raraki8159_SDSUGeo\n",
+ "
Last Modified: February 24, 2023\n",
+ "
0 comments, 326 views\n",
+ "
\n",
+ "
\n",
+ " "
+ ],
+ "text/plain": [
+ "- "
+ ]
+ },
+ "execution_count": 5,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Only for updates in values or new entries, no structural changes allowed\n",
+ "# Get existing layer\n",
+ "feature_layer_id = '31d8645bf557479085b53a5f473c6c8f'\n",
+ "existing_item = gis.content.get(feature_layer_id)\n",
+ "existing_item"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "id": "ebd64867",
+ "metadata": {
+ "scrolled": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "{'success': True}"
+ ]
+ },
+ "execution_count": 6,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Overwrite with new data\n",
+ "new_data = \"G:\\\\Shared drives\\Perceptual model review\\\\ForRyoko\\\\perceptual-model-arcgis\\\\dev\\\\data\\\\giant_table_v4.csv\"\n",
+ "overwrite_layer = FeatureLayerCollection.fromitem(existing_item)\n",
+ "overwrite_layer.manager.overwrite(new_data)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "id": "9a448c82",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "True"
+ ]
+ },
+ "execution_count": 7,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Check the updates \n",
+ "updated_feature = gis.content.get(feature_layer_id)\n",
+ "webbrowser.open('https://sdsugeo.maps.arcgis.com/apps/mapviewer/index.html?layers={}'.format(feature_layer_id), new=2)\n",
+ "\n",
+ "webmap_item_id = \"b1d0582ade934e81930bed22eb685504\"\n",
+ "webbrowser.open('https://sdsugeo.maps.arcgis.com/apps/mapviewer/index.html?webmap={}'.format(webmap_item_id), new=2)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "33a43684",
+ "metadata": {},
+ "source": [
+ "## Adjust display of webmap (need to run only after creating a new map)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 42,
+ "id": "1e66c130",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "def get_map (map_id):\n",
+ " '''\n",
+ " GET MAP DATA FOR CHANGES\n",
+ " '''\n",
+ " \n",
+ " m = gis.content.get(map_id)\n",
+ "\n",
+ " data = m.get_data()\n",
+ " \n",
+ " #Include the below line for prettified JSON\n",
+ " #print(json.dumps(data, indent=4, sort_keys=True))\n",
+ "\n",
+ " print(m)\n",
+ " \n",
+ " return data\n",
+ " \n",
+ "def update_map (map_id, data):\n",
+ " '''\n",
+ " UPDATE MAP TO SAVE CHANGES\n",
+ " '''\n",
+ " m = gis.content.get(map_id)\n",
+ " \n",
+ " # Set the item_properties to include the desired update\n",
+ " properties = {\"text\": json.dumps(data)}\n",
+ "\n",
+ " # 'Commit' the updates to the Item\n",
+ " update = m.update(item_properties=properties)\n",
+ " \n",
+ " return update"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 43,
+ "id": "bf77e240",
+ "metadata": {
+ "scrolled": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "
- \n",
+ "{\n",
+ " \"authoringApp\": \"ArcGISPythonAPI\",\n",
+ " \"authoringAppVersion\": \"2.0.1\",\n",
+ " \"baseMap\": {\n",
+ " \"baseMapLayers\": [\n",
+ " {\n",
+ " \"layerType\": \"ArcGISTiledMapServiceLayer\",\n",
+ " \"resourceInfo\": {\n",
+ " \"capabilities\": \"Map,Tilemap,Query,Data\",\n",
+ " \"currentVersion\": 10.3,\n",
+ " \"exportTilesAllowed\": false,\n",
+ " \"fullExtent\": {\n",
+ " \"spatialReference\": {\n",
+ " \"latestWkid\": 3857,\n",
+ " \"wkid\": 102100\n",
+ " },\n",
+ " \"xmax\": 20037507.067161843,\n",
+ " \"xmin\": -20037507.067161843,\n",
+ " \"ymax\": 19971868.88040863,\n",
+ " \"ymin\": -19971868.880408604\n",
+ " },\n",
+ " \"initialExtent\": {\n",
+ " \"spatialReference\": {\n",
+ " \"latestWkid\": 3857,\n",
+ " \"wkid\": 102100\n",
+ " },\n",
+ " \"xmax\": 28848255.049479112,\n",
+ " \"xmin\": -28848255.049479112,\n",
+ " \"ymax\": 16430757.376790084,\n",
+ " \"ymin\": -2077452.082122866\n",
+ " },\n",
+ " \"layers\": [\n",
+ " {\n",
+ " \"defaultVisibility\": false,\n",
+ " \"id\": 0,\n",
+ " \"maxScale\": 0,\n",
+ " \"minScale\": 0,\n",
+ " \"name\": \"Citations\",\n",
+ " \"parentLayerId\": -1,\n",
+ " \"subLayerIds\": null\n",
+ " }\n",
+ " ],\n",
+ " \"mapName\": \"Layers\",\n",
+ " \"maxImageHeight\": 4096,\n",
+ " \"maxImageWidth\": 4096,\n",
+ " \"maxRecordCount\": 100,\n",
+ " \"maxScale\": 70.5310735,\n",
+ " \"minScale\": 591657527.591555,\n",
+ " \"singleFusedMapCache\": true,\n",
+ " \"spatialReference\": {\n",
+ " \"latestWkid\": 3857,\n",
+ " \"wkid\": 102100\n",
+ " },\n",
+ " \"supportedExtensions\": \"KmlServer\",\n",
+ " \"supportedImageFormatTypes\": \"PNG32,PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,BMP\",\n",
+ " \"supportedQueryFormats\": \"JSON, AMF\",\n",
+ " \"supportsDynamicLayers\": false,\n",
+ " \"tables\": [],\n",
+ " \"tileInfo\": {\n",
+ " \"cols\": 256,\n",
+ " \"compressionQuality\": 90,\n",
+ " \"dpi\": 96,\n",
+ " \"format\": \"JPEG\",\n",
+ " \"lods\": [\n",
+ " {\n",
+ " \"level\": 0,\n",
+ " \"resolution\": 156543.03392800014,\n",
+ " \"scale\": 591657527.591555\n",
+ " },\n",
+ " {\n",
+ " \"level\": 1,\n",
+ " \"resolution\": 78271.51696399994,\n",
+ " \"scale\": 295828763.795777\n",
+ " },\n",
+ " {\n",
+ " \"level\": 2,\n",
+ " \"resolution\": 39135.75848200009,\n",
+ " \"scale\": 147914381.897889\n",
+ " },\n",
+ " {\n",
+ " \"level\": 3,\n",
+ " \"resolution\": 19567.87924099992,\n",
+ " \"scale\": 73957190.948944\n",
+ " },\n",
+ " {\n",
+ " \"level\": 4,\n",
+ " \"resolution\": 9783.93962049996,\n",
+ " \"scale\": 36978595.474472\n",
+ " },\n",
+ " {\n",
+ " \"level\": 5,\n",
+ " \"resolution\": 4891.96981024998,\n",
+ " \"scale\": 18489297.737236\n",
+ " },\n",
+ " {\n",
+ " \"level\": 6,\n",
+ " \"resolution\": 2445.98490512499,\n",
+ " \"scale\": 9244648.868618\n",
+ " },\n",
+ " {\n",
+ " \"level\": 7,\n",
+ " \"resolution\": 1222.992452562495,\n",
+ " \"scale\": 4622324.434309\n",
+ " },\n",
+ " {\n",
+ " \"level\": 8,\n",
+ " \"resolution\": 611.4962262813797,\n",
+ " \"scale\": 2311162.217155\n",
+ " },\n",
+ " {\n",
+ " \"level\": 9,\n",
+ " \"resolution\": 305.74811314055756,\n",
+ " \"scale\": 1155581.108577\n",
+ " },\n",
+ " {\n",
+ " \"level\": 10,\n",
+ " \"resolution\": 152.87405657041106,\n",
+ " \"scale\": 577790.554289\n",
+ " },\n",
+ " {\n",
+ " \"level\": 11,\n",
+ " \"resolution\": 76.43702828507324,\n",
+ " \"scale\": 288895.277144\n",
+ " },\n",
+ " {\n",
+ " \"level\": 12,\n",
+ " \"resolution\": 38.21851414253662,\n",
+ " \"scale\": 144447.638572\n",
+ " },\n",
+ " {\n",
+ " \"level\": 13,\n",
+ " \"resolution\": 19.10925707126831,\n",
+ " \"scale\": 72223.819286\n",
+ " },\n",
+ " {\n",
+ " \"level\": 14,\n",
+ " \"resolution\": 9.554628535634155,\n",
+ " \"scale\": 36111.909643\n",
+ " },\n",
+ " {\n",
+ " \"level\": 15,\n",
+ " \"resolution\": 4.77731426794937,\n",
+ " \"scale\": 18055.954822\n",
+ " },\n",
+ " {\n",
+ " \"level\": 16,\n",
+ " \"resolution\": 2.388657133974685,\n",
+ " \"scale\": 9027.977411\n",
+ " },\n",
+ " {\n",
+ " \"level\": 17,\n",
+ " \"resolution\": 1.1943285668550503,\n",
+ " \"scale\": 4513.988705\n",
+ " },\n",
+ " {\n",
+ " \"level\": 18,\n",
+ " \"resolution\": 0.5971642835598172,\n",
+ " \"scale\": 2256.994353\n",
+ " },\n",
+ " {\n",
+ " \"level\": 19,\n",
+ " \"resolution\": 0.29858214164761665,\n",
+ " \"scale\": 1128.497176\n",
+ " },\n",
+ " {\n",
+ " \"level\": 20,\n",
+ " \"resolution\": 0.14929107082380833,\n",
+ " \"scale\": 564.248588\n",
+ " },\n",
+ " {\n",
+ " \"level\": 21,\n",
+ " \"resolution\": 0.07464553541190416,\n",
+ " \"scale\": 282.124294\n",
+ " },\n",
+ " {\n",
+ " \"level\": 22,\n",
+ " \"resolution\": 0.03732276770595208,\n",
+ " \"scale\": 141.062147\n",
+ " },\n",
+ " {\n",
+ " \"level\": 23,\n",
+ " \"resolution\": 0.01866138385297604,\n",
+ " \"scale\": 70.5310735\n",
+ " }\n",
+ " ],\n",
+ " \"origin\": {\n",
+ " \"x\": -20037508.342787,\n",
+ " \"y\": 20037508.342787\n",
+ " },\n",
+ " \"rows\": 256,\n",
+ " \"spatialReference\": {\n",
+ " \"latestWkid\": 3857,\n",
+ " \"wkid\": 102100\n",
+ " }\n",
+ " },\n",
+ " \"units\": \"esriMeters\"\n",
+ " },\n",
+ " \"url\": \"https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer\"\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"Topographic\"\n",
+ " },\n",
+ " \"operationalLayers\": [\n",
+ " {\n",
+ " \"id\": \"137636252799\",\n",
+ " \"itemId\": \"31d8645bf557479085b53a5f473c6c8f\",\n",
+ " \"layerDefinition\": {\n",
+ " \"definitionExpression\": null,\n",
+ " \"drawingInfo\": {\n",
+ " \"renderer\": {\n",
+ " \"symbol\": {\n",
+ " \"contentType\": \"image/png\",\n",
+ " \"height\": 15,\n",
+ " \"imageData\": \"iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQBQYWludC5ORVQgdjMuNS4xTuc4+QAAB3VJREFUeF7tmPlTlEcexnve94U5mANQbgQSbgiHXHINlxpRIBpRI6wHorLERUmIisKCQWM8cqigESVQS1Kx1piNi4mW2YpbcZONrilE140RCTcy3DDAcL/zbJP8CYPDL+9Ufau7uqb7eZ7P+/a8PS8hwkcgIBAQCAgEBAICAYGAQEAgIBAQCAgEBAICAYGAQEAgIBAQCDx/AoowKXFMUhD3lQrioZaQRVRS+fxl51eBTZUTdZ41U1Rox13/0JF9csGJ05Qv4jSz/YPWohtv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SXyn0kXccclVqv3MS6at9JU/Ox+ouns+SF6Z4cSupz7l8+z1ucs7LF1AQjOdxfGZzmx8Iu1TRcfnrioICAQEAgIBgYBAQCAgEBAICAQEAgIBgYBAQCAgEBAICAQEAv8H44b/6ZiGvGAAAAAASUVORK5CYII=\",\n",
+ " \"type\": \"esriPMS\",\n",
+ " \"url\": \"RedSphere.png\",\n",
+ " \"width\": 15\n",
+ " },\n",
+ " \"type\": \"simple\"\n",
+ " }\n",
+ " }\n",
+ " },\n",
+ " \"layerType\": \"ArcGISFeatureLayer\",\n",
+ " \"opacity\": 1,\n",
+ " \"popupInfo\": {\n",
+ " \"description\": null,\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"id\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"id\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"citation\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"citation\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"url\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"url\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"attribution\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"attribution\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"attribution_url\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"attribution_url\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"figure_num\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"figure_num\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"figure_caption\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"figure_caption\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"figure_url\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"figure_url\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"watershed_name\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"watershed_name\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"lat\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"lat\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"lon\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"lon\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"area_km2\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"area_km2\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"huc_watershed_id\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"huc_watershed_id\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_spatial_zones\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"num_spatial_zones\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"spatial_property\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"spatial_property\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_temporal_zones\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"num_temporal_zones\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"temporal_property\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"temporal_property\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"vegetation_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"vegetation_info\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"soil_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"soil_info\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"geol_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"geol_info\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"topo_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"topo_info\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"three_d_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"three_d_info\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"uncertainty_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"uncertainty_info\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"other_info\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"other_info\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_store\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"num_store\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"store_list\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_id_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"store_id_list\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_flux\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"num_flux\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"flux_list\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_id_list\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"flux_id_list\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"dummy_column\",\n",
+ " \"isEditable\": true,\n",
+ " \"label\": \"dummy_column\",\n",
+ " \"visible\": true\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"ObjectId\",\n",
+ " \"isEditable\": false,\n",
+ " \"label\": \"ObjectId\",\n",
+ " \"visible\": true\n",
+ " }\n",
+ " ],\n",
+ " \"mediaInfos\": [],\n",
+ " \"showAttachments\": true,\n",
+ " \"title\": \"figure_models_v4\"\n",
+ " },\n",
+ " \"title\": \"figure_models_v4\",\n",
+ " \"url\": \"https://services1.arcgis.com/SIYkiqjmENweC50g/arcgis/rest/services/figure_models_v4/FeatureServer/0\",\n",
+ " \"visibility\": true\n",
+ " }\n",
+ " ],\n",
+ " \"spatialReference\": {\n",
+ " \"latestWkid\": 3857,\n",
+ " \"wkid\": 102100\n",
+ " },\n",
+ " \"version\": \"2.10\"\n",
+ "}\n"
+ ]
+ }
+ ],
+ "source": [
+ "webmap_item_id = 'b1d0582ade934e81930bed22eb685504'\n",
+ "webmap_data = get_map(webmap_item_id)\n",
+ "print(json.dumps(webmap_data, indent=4, sort_keys=True))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 44,
+ "id": "66219435",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The dictionary is in correct order\n",
+ "id\n",
+ "Model ID\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "citation\n",
+ "Citation\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "url\n",
+ "URL\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "attribution\n",
+ "Attribution\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "attribution_url\n",
+ "Attribution link\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "figure_num\n",
+ "Figure number\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "figure_caption\n",
+ "Figure caption\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "figure_url\n",
+ "Figure URL\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "watershed_name\n",
+ "Watershed name\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "lat\n",
+ "latitude\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "lon\n",
+ "longitude\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "area_km2\n",
+ "longitude\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "huc_watershed_id\n",
+ "US HUC8\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "num_spatial_zones\n",
+ "Number of spatial zones\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "spatial_property\n",
+ "Spatial property\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "num_temporal_zones\n",
+ "Number of temporal zones\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "temporal_property\n",
+ "Temporal property\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "vegetation_info\n",
+ "Vegetation\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "soil_info\n",
+ "Soil\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "geol_info\n",
+ "Geology\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "topo_info\n",
+ "Topography\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "three_d_info\n",
+ "3-dimensional description\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "uncertainty_info\n",
+ "Uncertainty range\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "other_info\n",
+ "Information: other\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "num_store\n",
+ "Number of stores\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "store_list\n",
+ "List of stores\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "store_id_list\n",
+ "Hashtags of stores\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "num_flux\n",
+ "Number of fluxes\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "flux_list\n",
+ "List of fluxes\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "flux_id_list\n",
+ "Hashtags of fluxes\n",
+ "True\n",
+ "True\n",
+ "The dictionary is in correct order\n",
+ "dummy_column\n",
+ "dummy_column\n",
+ "True\n",
+ "False\n",
+ "The dictionary is in correct order\n",
+ "ObjectId\n",
+ "ObjectID\n",
+ "True\n",
+ "False\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Make some changes\n",
+ "\n",
+ "# Change the display names \n",
+ "mylabel_dict = {0:{\"fieldName\":\"id\",\"label\":\"Model ID\",\"visible\":False},\n",
+ " 1:{\"fieldName\":\"citation\",\"label\":\"Citation\",\"visible\":False},\n",
+ " 2:{\"fieldName\":\"url\",\"label\":\"URL\",\"visible\":False},\n",
+ " 3:{\"fieldName\":\"attribution\",\"label\":\"Attribution\",\"visible\":False},\n",
+ " 4:{\"fieldName\":\"attribution_url\",\"label\":\"Attribution link\",\"visible\":False},\n",
+ " 5:{\"fieldName\":\"figure_num\",\"label\":\"Figure number\",\"visible\":False},\n",
+ " 6:{\"fieldName\":\"figure_caption\",\"label\":\"Figure caption\",\"visible\":False},\n",
+ " 7:{\"fieldName\":\"figure_url\",\"label\":\"Figure URL\",\"visible\":False},\n",
+ " 8:{\"fieldName\":\"watershed_name\",\"label\":\"Watershed name\",\"visible\":True},\n",
+ " 9:{\"fieldName\":\"lat\",\"label\":\"latitude\",\"visible\":False},\n",
+ " 10:{\"fieldName\":\"lon\",\"label\":\"longitude\",\"visible\":False},\n",
+ " 11:{\"fieldName\":\"area_km2\",\"label\":\"longitude\",\"visible\":False},\n",
+ " 12:{\"fieldName\":\"huc_watershed_id\",\"label\":\"US HUC8\",\"visible\":False},\n",
+ " 13:{\"fieldName\":\"num_spatial_zones\",\"label\":\"Number of spatial zones\",\"visible\":True},\n",
+ " 14:{\"fieldName\":\"spatial_property\",\"label\":\"Spatial property\",\"visible\":True},\n",
+ " 15:{\"fieldName\":\"num_temporal_zones\",\"label\":\"Number of temporal zones\",\"visible\":True},\n",
+ " 16:{\"fieldName\":\"temporal_property\",\"label\":\"Temporal property\",\"visible\":True},\n",
+ " 17:{\"fieldName\":\"vegetation_info\",\"label\":\"Vegetation\",\"visible\":True},\n",
+ " 18:{\"fieldName\":\"soil_info\",\"label\":\"Soil\",\"visible\":True},\n",
+ " 19:{\"fieldName\":\"geol_info\",\"label\":\"Geology\",\"visible\":True},\n",
+ " 20:{\"fieldName\":\"topo_info\",\"label\":\"Topography\",\"visible\":True},\n",
+ " 21:{\"fieldName\":\"three_d_info\",\"label\":\"3-dimensional description\",\"visible\":True},\n",
+ " 22:{\"fieldName\":\"uncertainty_info\",\"label\":\"Uncertainty range\",\"visible\":True},\n",
+ " 23:{\"fieldName\":\"other_info\",\"label\":\"Information: other\",\"visible\":True},\n",
+ " 24:{\"fieldName\":\"num_store\",\"label\":\"Number of stores\",\"visible\":True},\n",
+ " 25:{\"fieldName\":\"store_list\",\"label\":\"List of stores\",\"visible\":True},\n",
+ " 26:{\"fieldName\":\"store_id_list\",\"label\":\"Hashtags of stores\",\"visible\":True},\n",
+ " 27:{\"fieldName\":\"num_flux\",\"label\":\"Number of fluxes\",\"visible\":True},\n",
+ " 28:{\"fieldName\":\"flux_list\",\"label\":\"List of fluxes\",\"visible\":True},\n",
+ " 29:{\"fieldName\":\"flux_id_list\",\"label\":\"Hashtags of fluxes\",\"visible\":True},\n",
+ " 30:{\"fieldName\":\"dummy_column\",\"label\":\"dummy_column\",\"visible\":False},\n",
+ " 31:{\"fieldName\":\"ObjectId\",\"label\":\"ObjectID\",\"visible\":False}\n",
+ " }\n",
+ "\n",
+ "for i in range(len(mylabel_dict)): \n",
+ " if webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['fieldName'] == mylabel_dict[i]['fieldName']:\n",
+ " print('The dictionary is in correct order')\n",
+ " \n",
+ " print(webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['label'])\n",
+ " webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['label'] = mylabel_dict[i]['label']\n",
+ " print(webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['label'])\n",
+ "\n",
+ " print(webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['visible'])\n",
+ " webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['visible'] = mylabel_dict[i]['visible']\n",
+ " print(webmap_data['operationalLayers'][0]['popupInfo']['fieldInfos'][i]['visible'])\n",
+ " else:\n",
+ " print('The dictionary is in wrong order')"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 45,
+ "id": "f0a95dcb",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Update the icon to prettier one\n",
+ "webmap_data['operationalLayers'][0]['layerDefinition']['drawingInfo']['renderer']['symbol']['url'] = \"https://static.arcgis.com/images/Symbols/Government/Water-Teatment-Plant-Permit.png\"\n",
+ "webmap_data['operationalLayers'][0]['layerDefinition']['drawingInfo']['renderer']['symbol']['imageData'] = \"iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAANaElEQVR4Xu2dz+ocSxXH5xHyCFncB3DhA+QRcsGFMYhXXIgIchERcZUr4kZuQlAQFMniigsRIiiCoAQMuhAuP0TuwoWKIOJCjKBwFy7G+aSmfulfzzmnqk6d6p6ZzBe+/Eimu7q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kuEj/Kl/hcIGOtMKVBC69UG5JpusnwZ7EQsKpIj07TRpGwDbarNM+1+F6Fz+7GpIfv7MXBH4RobRG7Pkczk8CvfjXC04Dm83/AZ9peMb+hNWWAAAAAElFTkSuQmCC\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 46,
+ "id": "de383f64",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Turn off the layer name\n",
+ "webmap_data['operationalLayers'][0]['popupInfo']['title'] = \"\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 51,
+ "id": "1136af3d",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Update the basemaps\n",
+ "\n",
+ "# US HUC8 layer \n",
+ "HUC8_dict = {\n",
+ " \"id\": \"183343475b2-layer-50\",\n",
+ " \"itemId\": \"988c850f4c944d53bd29bd934dd6ac22\",\n",
+ " \"layerType\": \"ArcGISMapServiceLayer\",\n",
+ " \"opacity\": 0.25,\n",
+ " \"title\": \"Watershed Boundary Dataset (WBD) from NHDPlus Version 2.1 (Simplified/Nested), EPA OW\",\n",
+ " \"url\": \"https://watersgeo.epa.gov/arcgis/rest/services/NHDPlus_NP21/WBD_NP21_Simplified/MapServer\"\n",
+ " }\n",
+ "\n",
+ "# World waterbody maps\n",
+ "river_dict = {\n",
+ " \"id\": \"1830ae1b2b9-layer-53\",\n",
+ " \"itemId\": \"9f86716d941c4410b0b406d911754b2c\",\n",
+ " \"layerType\": \"ArcGISTiledMapServiceLayer\",\n",
+ " \"title\": \"Esri Hydro Reference Overlay\",\n",
+ " \"url\": \"https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Esri_Hydro_Reference_Overlay/MapServer\",\n",
+ " \"visibility\": True\n",
+ " }\n",
+ "\n",
+ "webmap_data['baseMap']['baseMapLayers'].append(HUC8_dict)\n",
+ "webmap_data['baseMap']['baseMapLayers'].append(river_dict)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 48,
+ "id": "2f117143",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Change the pop-ups\n",
+ "webmap_data['operationalLayers'][0]['popupInfo']['popupElements'] = [\n",
+ " {\n",
+ " \"text\": \"
A perceptual model of {watershed_name}
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"mediaInfos\": [\n",
+ " {\n",
+ " \"altText\": \"\",\n",
+ " \"caption\": \"Caption: {figure_caption}; From Figure {figure_num} in {citation}; {attribution}\",\n",
+ " \"refreshInterval\": 0,\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"image\",\n",
+ " \"value\": {\n",
+ " \"linkURL\": \"{url}\",\n",
+ " \"sourceURL\": \"{figure_url}\"\n",
+ " }\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"media\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Process information in the model
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"num_store\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Number of stores\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_list\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"List of stores\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"store_id_list\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Hashtags of stores\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_flux\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Number of fluxes\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_list\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"List of fluxes\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"flux_id_list\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Hashtags of fluxes\",\n",
+ " \"visible\": True\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Spatio-temporal heterogeneity in the model
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"num_spatial_zones\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Number of spatial zones\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"spatial_property\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Spatial property\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"num_temporal_zones\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Number of temporal zones\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"temporal_property\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Temporal property\",\n",
+ " \"visible\": True\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Ancillary information in the model
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"vegetation_info\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Vegetation\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"soil_info\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Soil\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"geol_info\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Geology\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"topo_info\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Topography\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"uncertainty_info\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Uncertainty range\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"three_d_info\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"3-dimensional description\",\n",
+ " \"visible\": True\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " },\n",
+ " {\n",
+ " \"text\": \"\\u25bc Watershed information
\",\n",
+ " \"type\": \"text\"\n",
+ " },\n",
+ " {\n",
+ " \"description\": \"\",\n",
+ " \"fieldInfos\": [\n",
+ " {\n",
+ " \"fieldName\": \"area_km2\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"Watershed area (km2)\",\n",
+ " \"visible\": True\n",
+ " },\n",
+ " {\n",
+ " \"fieldName\": \"huc_watershed_id\",\n",
+ " \"isEditable\": True,\n",
+ " \"label\": \"US HUC8 watershed ID\",\n",
+ " \"visible\": True\n",
+ " }\n",
+ " ],\n",
+ " \"title\": \"\",\n",
+ " \"type\": \"fields\"\n",
+ " }\n",
+ " ]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 52,
+ "id": "8f454aaa",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "True"
+ ]
+ },
+ "execution_count": 52,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Update the map\n",
+ "webmap_update = update_map(webmap_item_id, webmap_data)\n",
+ "webmap_update"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 53,
+ "id": "4f8a2737",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "True"
+ ]
+ },
+ "execution_count": 53,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Verify changes updated\n",
+ "webbrowser.open('https://sdsugeo.maps.arcgis.com/apps/mapviewer/index.html?webmap={}'.format(webmap_item_id), new=2)\n",
+ "\n",
+ "# https://sdsugeo.maps.arcgis.com/apps/mapviewer/index.html?webmap=e535103892fd41cd915d60ca4d1d9d44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "68607e8b",
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "814a091a",
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "d173d565",
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "arcgis",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.9.0"
+ },
+ "vscode": {
+ "interpreter": {
+ "hash": "3140ae756112501f18b23ec79a6bbbb54e715b030c96600dfefb60d12a8f240f"
+ }
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/src/utils/parse_location.py b/src/utils/parse_location.py
new file mode 100644
index 0000000..56fc2d8
--- /dev/null
+++ b/src/utils/parse_location.py
@@ -0,0 +1,66 @@
+from hashlib import new
+import pandas as pd
+import numpy as np
+import os
+import folium
+
+df = pd.read_excel('Location.xlsx', sheet_name='WatershedLocations')
+
+strValue = 'N'
+replacementStr = '-'
+
+column_name = df.columns
+for col in column_name[1:7]:
+ """
+ # Drop direction char and add sign
+ if 'lat' in col:
+ directions = ['S', 'N']
+ coord = 'lat'
+ elif 'lon' in col:
+ directions = ['W', 'E']
+ coord = 'lon'
+ """
+
+ df2 = df[col].copy()
+ """
+ for d in range(len(directions)):
+ if directions[d] == 'S' or directions[d] == 'W':
+ idx_negative = df2.str.endswith(directions[d], na=False)
+ df2[idx_negative] = df2[idx_negative].str[:-1]
+ elif directions[d] == 'N' or directions[d] == 'E':
+ idx_positive = df2.str.endswith(directions[d], na=False)
+ df2[idx_positive] = df2[idx_positive].str[:-1]
+ """
+ df_degree = df2.str.split('d', expand=True)
+ df_second = df_degree[1].str.split('s', expand=True)
+ df_miute = df_second[0].str.split('m', expand=True)
+
+ df3 = pd.concat([df_degree[0].str.strip(), df_miute[0].str.strip(), df_miute[1].str.strip()], axis=1, ignore_index=True)
+ df3 = df3.replace(r'^\s*$', np.nan, regex=True)
+ df3.fillna(value=np.nan, inplace=True)
+ df3.fillna(value=0, inplace=True)
+ new_value = df3[0].astype(float) + df3[1].astype(float)/60 + df3[2].astype(float)/3600
+
+ if col == 'lat':
+ lat = new_value.to_numpy()
+ if col == 'lon':
+ lon = new_value.to_numpy()
+ if col == 'max_lat':
+ max_lat = new_value.to_numpy()
+ if col == 'min_lat':
+ min_lat = new_value.to_numpy()
+ if col == 'max_lon':
+ max_lon = new_value.to_numpy()
+ if col == 'min_lon':
+ min_lon = new_value.to_numpy()
+
+avg_lat = (max_lat + min_lat) / 2
+avg_lon = (max_lon + min_lon) / 2
+lat[lat==0] = avg_lat[lat==0]
+lon[lon==0]= avg_lon[lon==0]
+
+list_of_tuples = list(zip(lat, lon))
+df_calc_coord = pd.DataFrame(list_of_tuples, columns=['lat','lon'])
+df_calc_coord = pd.concat([df.Name, df_calc_coord],axis=1)
+df_calc_coord.to_json('./location.json')
+df_calc_coord.to_excel('./Location_formatted.xlsx', sheet_name='Formatted_coordinates')