AndrewAnnex / planetcantile

tile matrix sets for other planets
BSD 3-Clause "New" or "Revised" License
9 stars 1 forks source link

partially sort-of working titiler app using planetcantile #9

Closed AndrewAnnex closed 1 year ago

AndrewAnnex commented 1 year ago

for local testing and development mostly, hope for a good demo out of this soon...

AndrewAnnex commented 1 year ago

Thanks Vincent, that’s high praise, was actually wanting to contribute one or two parts back as a change to titiler. It’s really not all that different than what you have but for changing the parameter(s) to floats. The quantizer bit would be left out of course as it would mostly be up to the client to make that decision.- Dr. Andrew AnnexOn Feb 13, 2023, at 1:06 PM, Vincent Sarago @.***> wrote: @vincentsarago commented on this pull request.

In planetcantile/topoalgo.py:

  • z /= quantizer["resolution"]
  • d_z = z / 256
  • dd_z = z // 256
  • ddd_z = dd_z // 256
  • b = (d_z - dd_z) * 256
  • g = ((dd_z / 256) - ddd_z) * 256
  • r = ((ddd_z / 256) - (ddd_z // 256)) * 256
  • arr = stack([r, g, b]).astype(uint8)
  • return ImageData(
  • arr,
  • img.mask,
  • assets=img.assets,
  • crs=img.crs,
  • bounds=img.bounds,
  • )

That's so cool 😍

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

AndrewAnnex commented 1 year ago

note, with https://github.com/developmentseed/titiler/pull/587 being merged the algorithm I added in this pr could be removed/simplified, I think. but merged it for now