From f8eae14778aac974c36597a8d2313c1fa094ef0f Mon Sep 17 00:00:00 2001 From: John Clary Date: Tue, 12 Nov 2024 12:41:37 -0500 Subject: [PATCH 1/3] add equity action zones layer --- toolbox/load_agol_layer/src/settings.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/toolbox/load_agol_layer/src/settings.js b/toolbox/load_agol_layer/src/settings.js index 248d6cc91..6a00591b6 100644 --- a/toolbox/load_agol_layer/src/settings.js +++ b/toolbox/load_agol_layer/src/settings.js @@ -74,6 +74,13 @@ const LAYERS = { fields: ["ZIPCODE"], tableName: "zip_codes", }, + equity_action_zones: { + service_name: "Equity_Analysis_Zones_2021", + layer_id: 0, + query_params: { ...DEFAULT_ESRI_QUERY_PARAMS }, + fields: ["GEOID", "indxd_v", "EAZ_Type"], + tableName: "equity_action_zones", + }, }; module.exports = { From 47f8851a09eb417a63da9e8176c206c385b9415f Mon Sep 17 00:00:00 2001 From: John Clary Date: Tue, 12 Nov 2024 12:41:52 -0500 Subject: [PATCH 2/3] add note about geometry column name --- toolbox/load_agol_layer/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolbox/load_agol_layer/README.md b/toolbox/load_agol_layer/README.md index 5662346da..83cdd86d2 100644 --- a/toolbox/load_agol_layer/README.md +++ b/toolbox/load_agol_layer/README.md @@ -31,7 +31,7 @@ node --env-file=local.env src/load_agol_layer.js --layer signal_engineer_areas Each layer must be configured in the `LAYERS` object in [`settings.js`](/toolbox/load_agol_layer/src/settings.js). See the docstring in the settings file for specifics. -When creating a new database table to hold feature data, polygon geometries should always be stored in a `Multipolygon` column type to avoid future issues. As well, any columns that will be populated with AGOL feature attribute data should exactly match the column names used in AGOL, except they should be lowercase. +When creating a new database table to hold feature data, polygon geometries should always be stored in a `Multipolygon` column type called `geometry` to avoid future issues. As well, any columns that will be populated with AGOL feature attribute data should exactly match the column names used in AGOL, except they should be lowercase. See the [database documentation](/database#geospatial-layers) about geospatial layers for additional details. From 46b97508055068ba646db07828d52e00b1328847 Mon Sep 17 00:00:00 2001 From: John Clary Date: Tue, 12 Nov 2024 12:42:32 -0500 Subject: [PATCH 3/3] create migrations and metadata for equity action zones layer --- .../default/tables/geo_equity_action_zones.yaml | 3 +++ .../metadata/databases/default/tables/tables.yaml | 1 + .../down.sql | 1 + .../up.sql | 13 +++++++++++++ 4 files changed, 18 insertions(+) create mode 100644 database/metadata/databases/default/tables/geo_equity_action_zones.yaml create mode 100644 database/migrations/default/1731432466891_create_equity_action_zones_layer/down.sql create mode 100644 database/migrations/default/1731432466891_create_equity_action_zones_layer/up.sql diff --git a/database/metadata/databases/default/tables/geo_equity_action_zones.yaml b/database/metadata/databases/default/tables/geo_equity_action_zones.yaml new file mode 100644 index 000000000..0412a7e4c --- /dev/null +++ b/database/metadata/databases/default/tables/geo_equity_action_zones.yaml @@ -0,0 +1,3 @@ +table: + name: equity_action_zones + schema: geo diff --git a/database/metadata/databases/default/tables/tables.yaml b/database/metadata/databases/default/tables/tables.yaml index 10b466812..9f56d70f5 100644 --- a/database/metadata/databases/default/tables/tables.yaml +++ b/database/metadata/databases/default/tables/tables.yaml @@ -2,6 +2,7 @@ - "!include geo_atd_jurisdictions.yaml" - "!include geo_council_districts.yaml" - "!include geo_engineering_areas.yaml" +- "!include geo_equity_action_zones.yaml" - "!include geo_non_coa_roadways.yaml" - "!include geo_signal_engineer_areas.yaml" - "!include geo_zip_codes.yaml" diff --git a/database/migrations/default/1731432466891_create_equity_action_zones_layer/down.sql b/database/migrations/default/1731432466891_create_equity_action_zones_layer/down.sql new file mode 100644 index 000000000..a17b650ea --- /dev/null +++ b/database/migrations/default/1731432466891_create_equity_action_zones_layer/down.sql @@ -0,0 +1 @@ +drop table "geo"."equity_action_zones"; diff --git a/database/migrations/default/1731432466891_create_equity_action_zones_layer/up.sql b/database/migrations/default/1731432466891_create_equity_action_zones_layer/up.sql new file mode 100644 index 000000000..87c97d491 --- /dev/null +++ b/database/migrations/default/1731432466891_create_equity_action_zones_layer/up.sql @@ -0,0 +1,13 @@ +create table "geo"."equity_action_zones" ( + geoid text primary key, + indxd_v numeric, + eaz_type text, + geometry public.geometry (multipolygon, 4326) not null, + created_at timestamptz default now() not null +); + +create index on "geo"."equity_action_zones" using gist (geometry); + +comment on column geo.equity_action_zones.geoid is 'The US census geoid of the census tract that matches this feature'; +comment on column geo.equity_action_zones.indxd_v is 'Vulnerability index on a scale of 0-100'; +comment on column geo.equity_action_zones.eaz_type is 'Description of the level of vulnerability';