-
Notifications
You must be signed in to change notification settings - Fork 303
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(parser): add a TIFF parser using utif #1131
Conversation
src/Parser/TIFFParser.js
Outdated
for (let j = 0; j < rowSize; j += alpha) { | ||
resizedData[rowOffset + j] = it.next().value; | ||
resizedData[rowOffset + j + 1] = it.next().value; | ||
resizedData[rowOffset + j + 2] = it.next().value; |
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.
the alpha isn't take in account?
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.
It is set to 255
before this loop, I didn't add it here because it needs a if
.
examples/tiff.html
Outdated
itowns.Fetcher.arrayBuffer('https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/tiff/FLAG_T24.TIF') | ||
.then(itowns.TIFFParser.parse) | ||
.then(function _(texture) { | ||
texture.coords = new itowns.Coordinates('EPSG:4326', 1.4116667, 43.6074422); |
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.
The texture.coords
have bad name, because it's actually a Extent
.
this Extent allows you to place the texture on the tiles. In particular with initialization from parent texture.
There are little changes to enhance the image display.
- Use
Extent
insteaf ofCoordinates
, and add it azoom
property to set image scale. - Add a layer property : use
imageParent
after zoom max to always display the ColorLayer after the Source.zoom.max.
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.
This needs another change in MaterialLayer
as well.
Add a layer property : use imageParent after zoom max to always display the ColorLayer after the Source.zoom.max.
I don't understand what you mean here
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.
A ColorLayer isn't displayed when Source.zoom.max is exceeded, it isn't the expected behaviour because the ColorLayer displaying shouldn't be controlled by the source.
Updated, with a tiled example (the same as https://www.itowns-project.org/demo-geoid/) but needs #1126 and #1142 to be merged first. |
Now that all others things have been merged, this PR is now ready ! |
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.
It should be interesting to create a itowns plugin to support Tiff.
Added a method to check the maximum texture size in the same time.
It automatically rejects TIFFs that are bigger than 4096x4096, because it is the minimum that is supported on 99.99% of the devices. https://github.com/photopea/UTIF.js https://www.npmjs.com/package/utif
Updated and rebased, I moved the parser to be a plugin. I also exposed the |
It automatically rejects TIFFs that are bigger than 4096x4096, because
it is the minimum that is supported on 99.99% of the devices.