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

[WIP] Adds many more missing bounding boxes #5596

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

madsnedergaard
Copy link
Member

Issue

Follow up to #1328

Description

Turns out there were a lot of zones that also didn't have bounding boxes 😅
Guess it's less important when we don't have data for the zones, but we might as well just add the bounding boxes now so that they are ready for when we have parsers!

I also fixed a few odd ones and made the script able to detect missing boxes.

Impact: Since we exclude bounding boxes in frontend, it doesn't change anything. It might make the need to switch yaml parser library more urgent though :)

Preview

use https://geojson.io and open this geojson file with all the lines:

https://www.dropbox.com/s/arfylzh165nxje0/lines.geojson?dl=0

Copy link
Member

@VIKTORVAV99 VIKTORVAV99 left a comment

Choose a reason for hiding this comment

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

For the most part this looks good, I have some general suggestions and thoughts though.

PS: Why is US-NW-AVRN not in the world file?

);
const zoneKey = inputArguments[0];

const zonesToCover = zoneKey === 'ALL' ? findZonesWithMissingBoundingBoxes() : [zoneKey];
Copy link
Member

@VIKTORVAV99 VIKTORVAV99 Jul 12, 2023

Choose a reason for hiding this comment

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

Suggested change
const zonesToCover = zoneKey === 'ALL' ? findZonesWithMissingBoundingBoxes() : [zoneKey];
const zonesToCover = zoneKey === '--all' ? findZonesWithMissingBoundingBoxes() : [zoneKey];

I also think running ALL or --all should run on all zones, not just those with missing bounding boxes, for example to update modified zones. Goes hand in hand with a comment further down.

if (zoneConfig.bounding_box) {
continue;
function findZonesWithMissingBoundingBoxes(): string[] {
const zoneConfig = mergeZones();
Copy link
Member

Choose a reason for hiding this comment

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

You had to sneak in this before I we merged the other one didn't you? 😅

Comment on lines +26 to +30
// do not modifiy current bounding boxes
if (zoneConfig.bounding_box) {
console.error(`Ignoring ${zoneKey} as it already have a bounding box`);
return;
}
Copy link
Member

Choose a reason for hiding this comment

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

Why do we want to ignore existing zones? If they have changed the bouding box should also be updated (like with the texas change).

Comment on lines +86 to +89
const averageBoundingBox: number[][] = [
[200, 200],
[-200, -200],
];
Copy link
Member

Choose a reason for hiding this comment

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

Do we need a average bouding box or could we use a initial state of Number.NaN istead?
I think it would make more sense to start from zero so to speak.

Maybe call it temp bounding box insteade of average as well.

@madsnedergaard madsnedergaard changed the title Adds many more missing bounding boxes [WIP] Adds many more missing bounding boxes Oct 12, 2023
@madsnedergaard madsnedergaard added the change requested A change was requested from the contributor label Oct 12, 2023
@madsnedergaard madsnedergaard self-assigned this Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change requested A change was requested from the contributor frontend 🎨 zone config Pull request or issue for zone configurations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants