AndrewAnnex / planetcantile

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

hilbert curve for tilematrixsets #13

Open AndrewAnnex opened 1 year ago

AndrewAnnex commented 1 year ago

I was reading https://protomaps.com/blog/pmtiles-v3-hilbert-tile-ids#tileid and having some experience with space filling curves I am glad to see their use for tiled datasets. In that particular blogpost and in the corresponding github repository, a hilbert curve tile index can be converted 1:1 to a TileMatrixSet with a matrix scale of 1,1.

However, equirectangular projections seem to always use matrix scales of 2,1 (twice as many columns as rows). How then can we apply these hilbert curves to all TMSs?

Well, one could treat the 1st zoom level of the equirectangular space as the 2nd zoom level in the hilbert curve, but then the curve is sort of broken right? Unless you pick the lower half of the curve? And would clients have to be aware of this or would servers have to convert index lookups based on the tms spec?

Finally, from my time on GeoMesa, there are other space filling curves including z curves...