ElevationRamp inside the polygon

Hi, Atul!
Thanks for your link.
I’m digging in this direction - if we cannot get height inside shader, let’s set it outside and use via uniforms.
a). As mentioned here, it is possible to generate texture using undocumented API and set it to the material uniforms.
b). Texture data should be rectangle, so we need to get bounding box for our polygon.
c). To get height data we can use sampleTerrainMostDetailed.
d). But, as we need to know height values not in the vertexes only, but inside the polygon too, we need to generate a set of points with small step between each other. We may do it using pointGrid for the polygon bbox via Turf library.

I still didn’t get final results, but this direction seems promising to me.

1 Like