-
Notifications
You must be signed in to change notification settings - Fork 19
Add Tiled .TIFF Support #60
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
Conversation
… code some more, including separating out the sample function so that the readTileData now supports all data formats as well. Added some comments for clarity.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #60 +/- ##
==========================================
- Coverage 79.89% 74.66% -5.23%
==========================================
Files 12 12
Lines 562 604 +42
Branches 110 120 +10
==========================================
+ Hits 449 451 +2
- Misses 106 144 +38
- Partials 7 9 +2 ☔ View full report in Codecov by Sentry. |
|
Attached are two sample images which have different tiled layouts for testing, from different sources (one from Upper Austria DGM and one from SwissALTI3D). |
… code some more, including separating out the sample function so that the readTileData now supports all data formats as well. Added some comments for clarity.
|
For some reason, github is not correctly updating the diff after I rebased the branch. The files changed are clearly incorrect (at time of writing). |
|
The main branch in your repo is out of sync with this one so rebasing with your main branch adds changes unrelated to this PR on this branch. |
|
I realized this. The PR was closed, I synced my main branch, branched and readded the changes. A new PR #62 has been opened. |
This PR adds support for tiled .TIFF files. This is related to issue #58. If merged, the API remains unchanged but the feature is then supported.
This has been tested and works for a number of datasets from SwissALTI3D and DGM Data from the Upper Austrian government.
The implementation mimics the implementation of
readStripDataasreadTileData. To reduce duplicate code, the decompression switch was isolated into a separate function.Additionally, the
fillXfunctions were removed, as they only work with linearized data / the assumption of a linear index. Instead, they were replaced with a singlesampleValuefunction, which can be called directly inreadStripDataorreadTileDatawith the specific indexing procedure while still being extensible to support more formats.There is a minor consideration that the "check" which is the stored format is now performed once per iteration, instead of calling a specialized function once (per strip) which is iterated inside. These checks could be removed by selecting a callback once at the beginning of the function and using that to sample the value. I am not sure what is more performant in transpiled typescript though, de-referencing an additional callback or 3 if statements. I didn't want to introduce more / opinionated code than necessary, so this is the "minimum viable" change.
The tile reading implementation can be compared to libtiff in C/C++ here and here.