Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: GIS API returns granular A4 variables for St Albans #3120

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api.planx.uk/modules/gis/service/digitalLand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
medway: require("./local_authorities/metadata/medway"),
newcastle: require("./local_authorities/metadata/newcastle"),
southwark: require("./local_authorities/metadata/southwark"),
"st-albans": require("./local_authorities/metadata/stAlbans"),
tewkesbury: require("./local_authorities/metadata/tewkesbury"),
};

Expand Down Expand Up @@ -74,8 +75,8 @@
options,
)}${datasets}`;
const res = await fetch(url)
.then((response: { json: () => any }) => response.json())

Check warning on line 78 in api.planx.uk/modules/gis/service/digitalLand.ts

View workflow job for this annotation

GitHub Actions / Run API Tests

Unexpected any. Specify a different type
.catch((error: any) => console.log(error));

Check warning on line 79 in api.planx.uk/modules/gis/service/digitalLand.ts

View workflow job for this annotation

GitHub Actions / Run API Tests

Unexpected any. Specify a different type

// if analytics are "on", store an audit record of the raw response
if (extras?.analytics !== "false") {
Expand Down Expand Up @@ -109,7 +110,7 @@
// check for & add any 'positive' constraints to the formattedResult
let formattedResult: Record<string, Constraint> = {};
if (res && res.count > 0 && res.entities) {
res.entities.forEach((entity: { dataset: any }) => {

Check warning on line 113 in api.planx.uk/modules/gis/service/digitalLand.ts

View workflow job for this annotation

GitHub Actions / Run API Tests

Unexpected any. Specify a different type
// get the planx variable that corresponds to this entity's 'dataset', should never be null because our initial request is filtered on 'dataset'
const key = Object.keys(baseSchema).find((key) =>
baseSchema[key]["digital-land-datasets"]?.includes(entity.dataset),
Expand Down Expand Up @@ -157,7 +158,7 @@
formattedResult["designated.nationalPark"] &&
formattedResult["designated.nationalPark"].value
) {
formattedResult["designated.nationalPark"]?.data?.forEach((entity: any) => {

Check warning on line 161 in api.planx.uk/modules/gis/service/digitalLand.ts

View workflow job for this annotation

GitHub Actions / Run API Tests

Unexpected any. Specify a different type
if (
baseSchema[broads]["digital-land-entities"]?.includes(entity.entity)
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
LAD20CD: E07000240
LAD20NM: St Albans
LAD20NMW:
FID:

https://www.planning.data.gov.uk/entity/?dataset=article-4-direction-area&geometry_curie=statistical-geography%3AE07000240&entry_date_day=&entry_date_month=&entry_date_year=
https://docs.google.com/spreadsheets/d/17qaNhd7M-F90KZ34kVjyetTxfxECf1QUU8UI-aUiknU/edit#gid=0
*/

import { LocalAuthorityMetadata } from "../../digitalLand";

const planningConstraints: LocalAuthorityMetadata["planningConstraints"] = {
article4: {
// Planx granular values link to entity.reference on Planning Data
records: {
"article4.stAlbans.beesonend": "Ar4.8",
"article4.stAlbans.beesonendChildwickbury": "Ar4.8",
"article4.stAlbans.bylandsMeadow": "Ar4.15",
"article4.stAlbans.childwickburyStudBlue": "Ar4.7d",
"article4.stAlbans.childwickburyStudGreen": "Ar4.7c",
"article4.stAlbans.childwickburyStudOrange": "Ar4.7b",
"article4.stAlbans.childwickburyStudRed": "Ar4.7a",
"article4.stAlbans.childwickburyStudYellow": "Ar4.7e",
"article4.stAlbans.childwickGreen": "Ar4.1",
"article4.stAlbans.colneyHeath": "Ar4.9",
"article4.stAlbans.cunningham": "Ar4.20",
"article4.stAlbans.formerRadlettAirfield": "Ar4.5",
"article4.stAlbans.harpenden1": "Ar4.18",
"article4.stAlbans.harpenden2": "Ar4.17",
"article4.stAlbans.kimptonBottom.1": "Ar4.12",
"article4.stAlbans.kimptonBottom.2": "Ar4.13",
"article4.stAlbans.landBetweenRaggedHallAndM10": "Ar4.11",
"article4.stAlbans.lowerLutonNorth": "Ar4.30",
"article4.stAlbans.lowerLutonSouth": "Ar4.19",
"article4.stAlbans.manorRoad": "Ar4.14",
"article4.stAlbans.raggedHall": "Ar4.10",
"article4.stAlbans.sandridgebury": "Ar4.16",
"article4.stAlbans.sopwellAndAlbert": "Ar4.6",
"article4.stAlbans.theHawthornes": "Ar4.2",
"article4.stAlbans.verulamAndFishpool": "Ar4.3",
"article4.stAlbans.whitecroftEstate": "Ar4.4",
},
},
};

export { planningConstraints };
Loading