wip: image cutline/clamp UV bounds during mesh creation#351
Draft
kylebarron wants to merge 1 commit intomainfrom
Draft
wip: image cutline/clamp UV bounds during mesh creation#351kylebarron wants to merge 1 commit intomainfrom
kylebarron wants to merge 1 commit intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Right now, our RasterReprojector always renders the entire input image. That is, the two initial triangles drawn span the entire bounds of the input image.
But sometimes this is not actually desired.
rendering images near the poles in Web Mercator
For example, this branch started during exploration of #182. When rendering data from EPSG:4326 which, say it spans from (-180, -90, 180, 90). Well, -90 and +90 are outside of Web Mercator latitude bounds, which are ~ +-85.11.
When we try to render such an image, we get very tall triangles near the poles, because essentially we never have enough triangles to accurately approximate the reprojection near the poles. The only reason why this renders at all is because we stop the delatin refinement after 10,000 iterations.
Instead of using the full height of the image, we should probably just discard the image outside of 85.11, and not even try to render data there.
Excluding parts of images that aren't intended to be rendered
I've considered this before but haven't written it down... I'd like to render usgs-topo-tiler directly from the client. But those images have a "collar" that overlaps other adjacent images and isn't intended to be rendered.
We can use this "cutline" to cut that out and not render it.
What should the API be?
I want to think a bit more about this API before merging and making it public.
I think perhaps the RasterReprojector should support
uvBoundswhich are allowed to be between 0 and 1. Not less than 0 and not greater than 1.This assumes always a square cutline, but I think that's ok for now.