From f7110e9c5d61f868829e4f71e8ad0de0199015bf Mon Sep 17 00:00:00 2001 From: augustlindemer <118665588+augustlindemer@users.noreply.github.com> Date: Mon, 8 Jan 2024 18:46:17 +0000 Subject: [PATCH] feat: Hook up granular A4 GIS API variables for Barnet (#2639) * Create barnet.ts * Update digitalLand.ts * feat: Hook up granular A4 GIS API variables for Barnet --- .../modules/gis/service/digitalLand.ts | 2 + .../local_authorities/metadata/barnet.ts | 38 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 api.planx.uk/modules/gis/service/local_authorities/metadata/barnet.ts diff --git a/api.planx.uk/modules/gis/service/digitalLand.ts b/api.planx.uk/modules/gis/service/digitalLand.ts index 04387799f2..ea1f9cf8aa 100644 --- a/api.planx.uk/modules/gis/service/digitalLand.ts +++ b/api.planx.uk/modules/gis/service/digitalLand.ts @@ -18,6 +18,7 @@ export interface LocalAuthorityMetadata { } const localAuthorityMetadata: Record = { + barnet: require("./local_authorities/metadata/barnet"), birmingham: require("./local_authorities/metadata/birmingham"), buckinghamshire: require("./local_authorities/metadata/buckinghamshire"), camden: require("./local_authorities/metadata/camden"), @@ -203,6 +204,7 @@ async function go( // these are various ways we link source data to granular planx values (see local_authorities/metadata for specifics) entity.name.replace(/\r?\n|\r/g, " ") === a4s[key] || entity.reference === a4s[key] || + entity?.["article-4-direction"] === a4s[key] || entity?.notes === a4s[key] || entity?.description?.startsWith(a4s[key]) || formattedResult[key]?.value // if this granular var is already true, make sure it remains true diff --git a/api.planx.uk/modules/gis/service/local_authorities/metadata/barnet.ts b/api.planx.uk/modules/gis/service/local_authorities/metadata/barnet.ts new file mode 100644 index 0000000000..521e591ac8 --- /dev/null +++ b/api.planx.uk/modules/gis/service/local_authorities/metadata/barnet.ts @@ -0,0 +1,38 @@ +/* +LAD20CD: E09000003 +LAD20NM: Barnet +LAD20NMW: +FID: + +https://www.planning.data.gov.uk/entity/?dataset=article-4-direction-area&geometry_curie=statistical-geography%3AE09000003&entry_date_day=&entry_date_month=&entry_date_year= +https://docs.google.com/spreadsheets/d/1ZjqYdC7upA8YS9rBoyRIQPT1sqCXJBaxQDrvUh1todU/edit#gid=0 +*/ + +import { LocalAuthorityMetadata } from "../../digitalLand"; + +const planningConstraints: LocalAuthorityMetadata["planningConstraints"] = { + article4: { + // Planx granular values link to Digital Land article-4-direction and entity.reference + records: { + "article4.barnet.finchleyChurchEnd": "A4D1", + "article4.barnet.finchleyGardenVillage": "A4D2A1", + "article4.barnet.glenhillClose": "A4D3A1", + "article4.barnet.hendonBurroughs.1": "A4D5A1", + "article4.barnet.hendonBurroughs.2": "A4D5A2", + "article4.barnet.hampsteadGardenSuburb": "A4D4A1", + "article4.barnet.spaniardsEnd": " A4D4A2", + "article4.barnet.millHillA": "A4D6", + "article4.barnet.millHillB": "A4D7", + "article4.barnet.monkenHadleyA": "A4D8", + "article4.barnet.monkenHadleyB": "A4D9", + "article4.barnet.mossHall": "A4D10", + "article4.barnet.totteridgeA": "A4D11", + "article4.barnet.totteridgeB": "A4D12", + "article4.barnet.woodStreet": "A4D13", + "article4.barnet.hmo": "A4D14", + "article4.barnet.agriculturalLand": "A4D15", + }, + }, +}; + +export { planningConstraints };