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

fix: add 1:50k to valid grid sizes TDE-1010 TDE-1014 TDE-1015 #810

Closed
wants to merge 6 commits into from

Conversation

amfage
Copy link
Contributor

@amfage amfage commented Dec 21, 2023

Will revisit in the New Year - should probably revisit the validation approach

Motivation

Allow the use of 50k scale imagery.

Note: it would be good to improve the tests and also take a look at how tileset-validation logs errors. I think these should be in a separate PR.

Modification

This is a simple fix to allow the use of 50k imagery. It also fixes a bug where the bottom row of map sheets were not considered valid.

Checklist

If not applicable, provide explanation of why.

  • Tests updated
  • Docs updated
  • Issue linked in Title

@amfage amfage changed the title fix: add 50k scale to valid grid sizes TDE-1010 fix: add 50k scale to valid grid sizes TDE-1010 TDE-1015 Dec 21, 2023
@amfage amfage marked this pull request as ready for review December 21, 2023 19:22
@amfage amfage requested review from a team as code owners December 21, 2023 19:22
@@ -14,7 +14,7 @@ import { CommandListArgs } from '../list/list.js';

const SHEET_MIN_X = MapSheet.origin.x + 4 * MapSheet.width; // The minimum x coordinate of a valid sheet / tile
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure why we even have these, there is a MapSheet object with more precise min and max values, which also have included unit tests.

We should remove what ever is referencing these.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could consult with the Land team and see what their requirements are? Perhaps we need to step back and look at the whole of tileset validation as we have another ticket regarding logging https://toitutewhenua.atlassian.net/browse/TDE-1013

@@ -89,7 +89,7 @@ export const MapSheet = {
gridSizeMax: 50000,
roundCorrection: 0.01,
/** Allowed grid sizes, these should exist in the LINZ Data service (meters) */
gridSizes: [10_000, 5_000, 2_000, 1_000, 500],
Copy link
Member

Choose a reason for hiding this comment

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

When fixing bugs it would be nice to add a unit test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It wasn't clear what the best way to do this was, I think the tests might need to be reviewed.

Copy link
Member

Choose a reason for hiding this comment

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

while this might hide the error, I don't think this fixes the bug, the tiles will not be named correctly when using 1:50k.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -14,7 +14,7 @@ import { CommandListArgs } from '../list/list.js';

const SHEET_MIN_X = MapSheet.origin.x + 4 * MapSheet.width; // The minimum x coordinate of a valid sheet / tile
const SHEET_MAX_X = MapSheet.origin.x + 46 * MapSheet.width; // The maximum x coordinate of a valid sheet / tile
const SHEET_MIN_Y = MapSheet.origin.y - 41 * MapSheet.height; // The minimum y coordinate of a valid sheet / tile
const SHEET_MIN_Y = MapSheet.origin.y - 42 * MapSheet.height; // The minimum y coordinate of a valid sheet / tile
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that's a magic number if ever I saw one. Did a test failure necessitate this? This should probably be explained in more detail, or be refactored out.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That was my mistake counting tiles I guess. This is my original draft when I worked on this:
image

@amfage amfage marked this pull request as draft December 21, 2023 23:06
l0b0 and others added 4 commits January 18, 2024 16:25
#### Motivation

Cleans up miscellaneous issues found by JetBrains IDEA.

#### Modification

- Remove unreferenced example code
- Remove unused variables, types, classes
- Import type rather than relying on UMD global variable
- Wait for writes to finish

#### Checklist

None of these are applicable. This is just a cleanup.

- [ ] Tests updated
- [ ] Docs updated
- [ ] Issue linked in Title
@amfage amfage changed the title fix: add 50k scale to valid grid sizes TDE-1010 TDE-1015 fix: add 50k scale to valid grid sizes TDE-1010 TDE-1014 TDE-1015 Jan 18, 2024
@amfage amfage changed the title fix: add 50k scale to valid grid sizes TDE-1010 TDE-1014 TDE-1015 fix: add 1:50k to valid grid sizes TDE-1010 TDE-1014 TDE-1015 Jan 18, 2024
@amfage amfage closed this Jan 19, 2024
@amfage
Copy link
Contributor Author

amfage commented Jan 19, 2024

Superseded.

@l0b0 l0b0 deleted the fix/50k-grid-tde-1010 branch February 9, 2024 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants