JuliaGeo / TileProviders.jl

Shared collection of map tile providers
MIT License
14 stars 5 forks source link

Add NASA Mars, Moon and Vesta tile providers #9

Open asinghvi17 opened 1 year ago

asinghvi17 commented 1 year ago

https://api.nasa.gov/#:~:text=Vesta/Moon/Mars%20Trek%20WMTS are web map tile services which let you get this stuff. We should add them to TileProviders! It should be simple to implement as an example for the docs as well.

rafaqz commented 1 year ago

Yeah would be cool! But what is the projection even??

It would be fun to plot onto a mesh in Tyler.jl so we can make them globes, for earth too really...

That should be doable?

rafaqz commented 1 year ago

And also they are not XYZ tiles? maybe we need a way to distinguish that from the provider type. I don't think they would work in Leaflet.jl or Tyler.jl without a bunch of work.

http://{WMTS endpoint}/1.0.0/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png

asinghvi17 commented 1 year ago

So I think Tyler already plots onto meshes - we would just have to densely sample them and define some kind of mapping.

Is there a particular reason that Tyler needs to have scene data? If so we could make it at least backed by an ordinary plot recipe, and then it could even have a transformation from e.g 2d to 3d (sphere).

also: isn't this almost exactly the XYZ tile definition? Z is tile matrix, x and y are tilecol and tilerow (or so it seemed to me at least).

rafaqz commented 1 year ago

Ahh yeah I just misunderstood the two matrix variables. It works fine:

using TileProviders, Tyler
mars = Provider("https://api.nasa.gov/mars-wmts/catalog/Mars_Viking_MDIM21_ClrMosaic_global_232m/1.0.0//default/default028mm/{z}/{y}/{x}.jpg")
Tyler.Map(Extent(; X=(0, 10), Y=(0, 10)); provider=mars)

We can add a keyword for the default028mm replacement (TileMatrixSet in their terminology)

With the mesh I just mean a 3d mesh with a mapping to the globe - but I have no idea how that stuff works in Makie. Also no idea if/why it needs scene data. I'm pretty new to Makie internals and 3d plots in general.

asinghvi17 commented 1 year ago

Currently, Tyler is plotting images directly onto a mesh using UV coordinates

https://github.com/MakieOrg/Tyler.jl/blob/346b2c78234374c7493c94c229804570fe65844f/src/Tyler.jl#L175-L185

if we just subdivide this, for which the code is actually already there, and apply a transformation from latlong to an ECEF cartesian coordinate system (see Geodesy.jl), then it should "just work"!

When you consider Makie, everything is actually 3d - 2d plots are simply a special camera setting.

I have to finish up some slides for a talk this evening but can give this a look after that.