Skip to content

wip: image cutline/clamp UV bounds during mesh creation#351

Draft
kylebarron wants to merge 1 commit intomainfrom
kyle/clamp-uv-mesh-render
Draft

wip: image cutline/clamp UV bounds during mesh creation#351
kylebarron wants to merge 1 commit intomainfrom
kyle/clamp-uv-mesh-render

Conversation

@kylebarron
Copy link
Member

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.

image

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 uvBounds which 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant