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: Hook up granular A4 GIS API variables for Epsom and Ewell #3142

Merged
merged 4 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -26,6 +26,7 @@
camden: require("./local_authorities/metadata/camden"),
canterbury: require("./local_authorities/metadata/canterbury"),
doncaster: require("./local_authorities/metadata/doncaster"),
"epsom-and-ewell": require("./local_authorities/metadata/epsomAndEwell"),
gateshead: require("./local_authorities/metadata/gateshead"),
lambeth: require("./local_authorities/metadata/lambeth"),
medway: require("./local_authorities/metadata/medway"),
Expand Down Expand Up @@ -75,8 +76,8 @@
options,
)}${datasets}`;
const res = await fetch(url)
.then((response: { json: () => any }) => response.json())

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
.catch((error: any) => console.log(error));

Check warning on line 80 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 @@ -110,7 +111,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 114 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 @@ -158,7 +159,7 @@
formattedResult["designated.nationalPark"] &&
formattedResult["designated.nationalPark"].value
) {
formattedResult["designated.nationalPark"]?.data?.forEach((entity: any) => {

Check warning on line 162 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,49 @@
/*
LAD20CD: E07000208
LAD20NM: Epsom and Ewell
LAD20NMW:
FID:

https://www.planning.data.gov.uk/entity/?dataset=article-4-direction-area&geometry_curie=statistical-geography%3AE07000208&entry_date_day=&entry_date_month=&entry_date_year=
https://docs.google.com/spreadsheets/d/1BzYZ_YvJjOrY2afxPGWbPvV2g_FLBr0H/edit#gid=125611981
*/

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

const planningConstraints: LocalAuthorityMetadata["planningConstraints"] = {
article4: {
// Planx granular values link to Digital Land article-4-direction and entity.reference
records: {
"article4.epsomAndEwell.burghheath": "11/00003/ART4",
"article4.epsomAndEwell.churchstreet": "11/00004/ART4",
"article4.epsomAndEwell.college": "11/00005/ART4",
"article4.epsomAndEwell.downs": "11/00006/ART4",
"article4.epsomAndEwell.ewellvillage": "11/00002/ART4",
"article4.epsomAndEwell.highergreenlongdown": "05/00002/ART4",
"article4.epsomAndEwell.lintons": " 11/00007/ART4",
Copy link
Member

@jessicamcinchak jessicamcinchak May 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: looks like this one has a few leading spaces ?

"article4.epsomAndEwell.pikes": "12/00002/ART4",
"article4.epsomAndEwell.pikesPart": "11/00008/ART4",
"article4.epsomAndEwell.stamfordgreen": "05/00001/ART4",
"article4.epsomAndEwell.greenewelldowns": "05/00004/ART4",
"article4.epsomAndEwell.worple": "11/00009/ART4",
"article4.epsomAndEwell.adelphi": "16/00008/ART4",
"article4.epsomAndEwell.aplanhouse": "16/00013/ART4",
"article4.epsomAndEwell.bradfordhouse": "16/00013/ART4",
"article4.epsomAndEwell.eastleighhouse": "16/00005/ART4",
"article4.epsomAndEwell.emeraldhouse": "16/00009/ART4",
"article4.epsomAndEwell.epsomchase": "16/00004/ART4",
"article4.epsomAndEwell.epsomgateway": "16/00015/ART4",
"article4.epsomAndEwell.globalhouse": "16/00016/ART4",
"article4.epsomAndEwell.horizonhouse": "16/00012/ART4",
"article4.epsomAndEwell.newplanhouse": "16/00006/ART4",
"article4.epsomAndEwell.nightingalehouse": "16/00007/ART4",
"article4.epsomAndEwell.oakshouse": "16/00014/ART4",
"article4.epsomAndEwell.parksidehouse": "16/00017/ART4",
"article4.epsomAndEwell.sollishouse": "16/00011/ART4",
"article4.epsomAndEwell.thekirkgate": "16/00019/ART4",
"article4.epsomAndEwell.thewells": "16/00018/ART4",
},
},
};

export { planningConstraints };
Loading