Skip to content

Begin the work of adding a new type, with more modular form - #661

Open
Pete-Y-CS wants to merge 7 commits into
infrastructure-taxonomyfrom
infrastructure-taxonomy-crossings
Open

Begin the work of adding a new type, with more modular form#661
Pete-Y-CS wants to merge 7 commits into
infrastructure-taxonomyfrom
infrastructure-taxonomy-crossings

Conversation

@Pete-Y-CS

Copy link
Copy Markdown
Collaborator

No description provided.

@Pete-Y-CS
Pete-Y-CS changed the base branch from main to infrastructure-taxonomy July 20, 2026 11:55
@Pete-Y-CS
Pete-Y-CS requested a review from Sparrow0hawk July 21, 2026 08:24

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Perhaps this wants a different name, it is awkward that we have 'features' of a geojson file and 'features' of a piece of infrastructure. This means our features will have features.....


let nameId = uuidv4();

function formatForDisplay(original: string): string {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This might want to be brought out to be shared with other bits of codebase, but I'm not sure

return filteredTypeOptions[0];
}

function formatForRadio(original: string): [string, string] {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Like here's a very similar but slightly different version of the same function, probably best to split it out elsewhere and settle on which way of it working is nicer

})
: [];

$: {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is Svelte syntax for 'run this code if the inputs to it change' so it means that when you change the subtype or context change prune any unneeded features and measures from the properties, and add any newly needed features and measures

Comment thread src/lib/sketch/config.ts
}
}

if (schema == "v3" && copy.v3) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This where we are checking if there are any properties on a given feature that aren't expected for the schema we are currently using

@Pete-Y-CS

Copy link
Copy Markdown
Collaborator Author

@Sparrow0hawk I've added some explanatory comments throughout the code, hopefully a decent amount of it is self explanatory but if you have any questions we can definitely go through em

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant