Open geospatialmapmashup opened 6 years ago
The encoding and decoding of Terrarium PNGs is documented here: https://mapzen.com/documentation/terrain-tiles/formats/#terrarium
I am well aware of the formula. I am talking about getting RGB Pixel Values from Leaflet or Tangram in Javascript. Not the calculation once you have those RGB Values. Thanks!
Ah, I misunderstood! @meetar might know whether that's possible.
@geospatialmapmashup So you're just trying to read pixels? You've mentioned "decode" a few times in this thread including in its title, so I'm a bit confused as well...
The technique you need will vary depending on what exactly you're trying to accomplish and at what step in the process – for instance, whether in a Tangram shader, or when loading the tiles as a plain Leaflet tilesource, or after rendering them in a Tangram map, or after getting them through an xhttp request, etc. Could you tell us more about your use case?
I am looking to just show SPOT elevation in Leafletjs - eventually use Tilelayer-GL to do some shading/coloring. But it needs to be just in browser because it's an offline need. I downloaded some of the AWS S3 Hosted Terrarium PNG's and made MBTILES. I am also looking to build a terrain profile view of a route defined.
Is there any reference code for decoding the MapZen Terrarium PNG Code in the browser