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 Gloucester #3411

Merged
merged 6 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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 @@ -28,6 +28,7 @@
doncaster: require("./local_authorities/metadata/doncaster"),
"epsom-and-ewell": require("./local_authorities/metadata/epsomAndEwell"),
gateshead: require("./local_authorities/metadata/gateshead"),
gloucester: require("./local_authorities/metadata/gloucester"),
lambeth: require("./local_authorities/metadata/lambeth"),
medway: require("./local_authorities/metadata/medway"),
newcastle: require("./local_authorities/metadata/newcastle"),
Expand Down Expand Up @@ -77,8 +78,8 @@
options,
)}${datasets}`;
const res = await fetch(url)
.then((response: { json: () => any }) => response.json())

Check warning on line 81 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 82 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 @@ -112,7 +113,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 116 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
LAD20CD: E07000081
LAD20NM: Gloucester
LAD20NMW:
FID:

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

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

const planningConstraints: LocalAuthorityMetadata["planningConstraints"] = {
article4: {
// Planx granular values link to Digital Land entity.reference
records: {
"article4.gloucester.SouthgateStreetConservationArea":
"Southgate Street Conservation Area",
"article4.gloucester.StMichaelsSquare":
"St Michael’s Square Article 4 direction",
augustlindemer marked this conversation as resolved.
Show resolved Hide resolved
},
},
};

export { planningConstraints };
Loading