Conversation
|
requires JuliaGeo/TileProviders.jl#5 |
|
@gaelforget it looks like you didn't add Interpolations to the Docs Project.toml, hence the failure. The environment is independent to the one for base Tyler. Also, for every new Line 108 in 9831ee3 As for the right place and style for https://github.com/MakieOrg/Tyler.jl/pull/16/files#diff-3b196dbeff13910024b55eb38dbb48b8bd8d51d698d330ab200031de29ac4e90 @SimonDanisch might have some opinion about it. |
Import were changed in JuliaGeo/MapTiles.jl#23
Sounds good. Thanks for the feedback and pointers. |
Thanks. Should be done now. See ci and documenter workflows. |
|
Just merged master into branch and reran actions. ci and documenter workflows seem aok. Could this be merged? further reviewed? |
src/Tyler.jl
Outdated
|
|
||
| function fetch_tile(tyler::Map, tile::Tile) | ||
| return get!(tyler.fetched_tiles, tile) do | ||
| if isa(tyler.provider,Interpolator) |
There was a problem hiding this comment.
This could use a function and dispatch instead? It's the only thing hard coding the Interpolations dep.
| col(i)=RGBAf(Makie.interpolated_getindex(cols,i)) | ||
| col(i::RGBAf)=i | ||
|
|
||
| function fetch_tile(provider::Interpolator, tile::Tile) |
There was a problem hiding this comment.
This could go in the interpolator module
| (lons,lats) | ||
| end | ||
|
|
||
| struct Interpolator <: AbstractProvider |
There was a problem hiding this comment.
This could do with some docs? I know the rest of the package is pretty short on docs, but it would be good to know what url and options are
| array=(array.-minimum(array))./(maximum(array)-minimum(array)) | ||
| itp = interpolate(nodes, array, Gridded(Linear())) | ||
| cols=Makie.to_colormap(:viridis) | ||
| col(i)=RGBAf(Makie.interpolated_getindex(cols,i)) |
There was a problem hiding this comment.
Couldn't these be part of Interpolator? It seems like some unnecessary work to set it up.
They could be keywords if people did need to customise?
This lets you override the fetching of tiles (from local or remote file) to use an interpolator to fill up the tiles on the fly.
Side benefits : this lets you try/test things out offline / without access to files or urls; or project any array or image onto the tile space.
Some notes
That's pretty much what I used in https://youtu.be/6pvKW1hcghg using output from a climate model via such an interpolator.
Several things can be improved. I may have gotten confused wrt North/South direction, maybe? Also should mention that I wasn't immediately able to make docs. The example could be used for test but I did not do it.
Others are question marks. I could imagine
AbstractProviderdefinition moving toTyler, ormodule ForInterpolationsmoving to TileProviders alternatively, or maybe all is fine as done here; maybe I could have PR'ed thelng2tileetc functions to MapTiles.jl.