-
Notifications
You must be signed in to change notification settings - Fork 3
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: rename tiff file if not aligned with its tile name TDE-497 #209
Conversation
self.check_band_count(gdalinfo_result) | ||
self.check_color_interpretation(gdalinfo_result) | ||
def check_tile_and_rename(self, gdalinfo: Dict[Any, Any]) -> None: | ||
origin = Point(gdalinfo["cornerCoordinates"]["upperLeft"][0], gdalinfo["cornerCoordinates"]["upperLeft"][1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if the origin is valid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two examples of files with origin "drift":
s3://linz-imagery-upload/Tasman Nelson Floods 2022 LiDAR & Orthos/renamed/top-of-the-south-flood/tifs/BP27_1000_4817.tif
s3://linz-imagery-upload/Invercargill2022_Pgrm3016/renamed/InvercargillUrban2022/tifs-RGB/CH10_500_001052.tif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to work on the feature to correct the origin drift sooner rather than later otherwise files with origin drift will be renamed e.g. file name "BP27_1000_4817.tiff"
with origin = Point(1643679.999967818148434, 5444159.999954843893647)
will be renamed to BP27_1000_4816.tiff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could create an extra check using a regex to check if the file name match the correct pattern ({tile_name}_{scale}_{originID}
- like what is done in argo-task
https://github.com/linz/argo-tasks/blob/master/src/commands/tileset-validate/tileset.validate.ts) AND <> than generated name, and logging or raising a specific issue for those cases?
@dwsilk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If an origin coordinate is between coordinate - 0.01 < coordinate < coordinate + 0.01
, e.g. less than 1cm difference from the origin coordinate we expect, then rename. Otherwise error due to an invalid origin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one note inline about origin drift.
Description
Some tiff files does not respect the naming convention. This functionality check the correct name against the tile name link to the tiff and rename the tiff file if the name is not correct.
The associated workflow in Argo has to be updated once this is merged.
non_visual_qa.py
has been deleted so associated workflow has to be deleted when this PR is merged.