Git Product home page Git Product logo

tyler.jl's People

Contributors

alex-s-gardner avatar asinghvi17 avatar dependabot[bot] avatar felixcremer avatar gaelforget avatar github-actions[bot] avatar lazarusa avatar rafaqz avatar ranocha avatar simondanisch avatar visr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tyler.jl's Issues

Use of non global tiles

We have a first proof of concept for the tiling of a large diskarray at PyramidScheme.Jl
Would it be possible to expose these tiles, so that they could be plotted by Tyler?

I can post an example of the pyramids later.

Load tiles under cursor first

It would feel a lot snappier to download whatever is at the center of the zoom first (that's usually where I am looking and I assume others too). We can get axis mouse position and use it to define a square that gets queued first for each zoom level.

Currently the download is random, and after #13 its top to bottom, so the first tiles may even be mostly off screen.

This follows on from #13

TODO Features

  • change default zoom level for first run on Map

  • Rect selection docs, 4 numbers, 2 numbers
    For now what are those 4 numbers? we should be able to do min_lon, max_lon, min_lat, max_lat or min_lon, min_lat, max_lon, max_lat

  • plot tiles in a 3d axis, LScene.

  • expose function to plot new points in lon,lat coordinates to be plotted on top of tile.

  • expose axis?

display needs to be removed from Tyler to support WGLMakie

Conversation from Slack

Tabea
How can you send it via JSServe? I can show the figure, but then it doesn't load further tiles

Simon Danisch
Ah, I suspect you may not have a websocket connection, leading to no interactivity... Can you zoom into a normal scatter(1:4) plot?

Tabea
Yes, I can also zoom into the Tyler map if using App(tyler.figure)

Simon Danisch
Oh.. that sounds like a bug then

Tabea
Well I think Tyler needs the screen to be open. I don't know if that's the case, if I am only showing the figure?

Simon Danisch
Ah there was an issue like that

Simon Danisch
I think we need to remove the display call in Tyler ^^

Tabea
How can we then check whether the Tyler map is open?

Simon Danisch
Good question.... I honestly don't know how this is even working with a display call inside app.. I will need to take a look at it
๐Ÿ˜…

Simon Danisch
But I suspect this needs a fix in Tyler

Simon Danisch
You could try to remove the display call and remove the isopen(screen) with some other condition... Maybe just true for a quick test

Tabea
That's not so trivial ๐Ÿ˜… Screen is all over the place...

Tabea
I will give it a try

Simon Danisch
Ok, feel free to ask me if anything doesn't work ๐Ÿ˜‰ Otherwise, I can take a look later today

Tabea
Ok, so it seems to work ๐Ÿ˜Š leaving the display.... but replacing isopen(screen) with true, then showing it via App(tyler.figure). But this can only be a hack๐Ÿ˜‚

Simon Danisch
Sure... Lets see if we can find a better solution soon!

Anshul Singhvi
Why exactly does Tyler need the screen? It can always call update_state_before_display!(ax) on its axis, if that's what is needed

Simon Danisch
That's not what it's needed for

Simon Danisch
It doesn't really need screen, it was just easier for a first implementation

Tyler.Map fails occasionally in VS Code

Sometimes the call of Tyler.Map fails when I call it from the VS Code julia terminal with the following error. This seems to come from an Any[] in the list of areas. Which fails later on.

julia> t = Tyler.Map(ext)
layer_range = 5:13
areas = Any[Any[], Any[], Extent{(:X, :Y), Tuple{Tuple{Float64, Float64}, Tuple{Float64, Float64}}}((X = (1.2855831266312003e6, 1.2957394671720564e6), Y = (6.600470208423706e6, 6.611200388901798e6))), Extent{(:X, :Y), Tuple{Tuple{Float64, Float64}, Tuple{Float64, Float64}}}((X = (1.2845674925771146e6, 1.2967551012261421e6), Y = (6.599397190375896e6, 6.612273406949608e6)))]
ext = Any[]
ERROR: MethodError: no method matching MapTiles.TileGrid(::Vector{Any}, ::Int64, ::MapTiles.WebMercator)

Closest candidates are:
  MapTiles.TileGrid(::Extent, ::Int64, ::MapTiles.WebMercator)
   @ MapTiles ~/.julia/packages/MapTiles/EEyFP/src/tiles.jl:136
  MapTiles.TileGrid(::Any, ::Any)
   @ MapTiles ~/.julia/packages/MapTiles/EEyFP/src/tiles.jl:111
  MapTiles.TileGrid(::Extent, ::Int64, ::MapTiles.WGS84)
   @ MapTiles ~/.julia/packages/MapTiles/EEyFP/src/tiles.jl:118
  ...

Stacktrace:
  [1] (::Tyler.var"#83#86"{Int64, Tyler.Map})(ext::Vector{Any})
    @ Tyler ~/.julia/dev/Tyler/src/Tyler.jl:345
  [2] iterate
    @ ./generator.jl:47 [inlined]
  [3] _collect(c::Vector{Any}, itr::Base.Generator{Vector{Any}, Tyler.var"#83#86"{Int64, Tyler.Map}}, #unused#::Base.EltypeUnknown, isz::Base.HasShape{1})
    @ Base ./array.jl:802
  [4] collect_similar
    @ ./array.jl:711 [inlined]
  [5] map
    @ ./abstractarray.jl:3263 [inlined]
  [6] #82
    @ ~/.julia/dev/Tyler/src/Tyler.jl:343 [inlined]
  [7] iterate
    @ ./generator.jl:47 [inlined]
  [8] _collect(c::UnitRange{Int64}, itr::Base.Generator{UnitRange{Int64}, Tyler.var"#82#85"{Tyler.Map, Vector{Any}}}, #unused#::Base.EltypeUnknown, isz::Base.HasShape{1})
    @ Base ./array.jl:802
  [9] collect_similar(cont::UnitRange{Int64}, itr::Base.Generator{UnitRange{Int64}, Tyler.var"#82#85"{Tyler.Map, Vector{Any}}})
    @ Base ./array.jl:711
 [10] map(f::Function, A::UnitRange{Int64})
    @ Base ./abstractarray.jl:3263
 [11] update_tiles!(tyler::Tyler.Map, area::Extent{(:X, :Y), Tuple{Tuple{Float64, Float64}, Tuple{Float64, Float64}}})
    @ Tyler ~/.julia/dev/Tyler/src/Tyler.jl:342
 [12] Tyler.Map(extent::Extent{(:X, :Y), Tuple{Tuple{Float32, Float32}, Tuple{Float32, Float32}}}, extent_crs::MapTiles.WGS84; resolution::Tuple{Int64, Int64}, figure::Figure, axis::Axis, provider::Provider, crs::MapTiles.WebMercator, max_parallel_downloads::Int64, cache_size_gb::Int64, depth::Int64, halo::Float64, scale::Float64, max_zoom::Int64)
    @ Tyler ~/.julia/dev/Tyler/src/Tyler.jl:170
 [13] Tyler.Map(extent::Extent{(:X, :Y), Tuple{Tuple{Float32, Float32}, Tuple{Float32, Float32}}}, extent_crs::MapTiles.WGS84)
    @ Tyler ~/.julia/dev/Tyler/src/Tyler.jl:95
 [14] Tyler.Map(extent::Extent{(:X, :Y), Tuple{Tuple{Float32, Float32}, Tuple{Float32, Float32}}})
    @ Tyler ~/.julia/dev/Tyler/src/Tyler.jl:95
 [15] top-level scope
    @ REPL[51]:1

Make it work with GeoAxis

It would be nice if it would be possible to use a GeoAxis from GeoMakie in Tyler.Map.
When I am trying it, I get the following error:

fig = Figure()
julia> ax = GeoAxis(fig[1,1], dest="+proj=webmerc +datum=WGS84")
GeoAxis()
julia> mgeo = Tyler.Map(ext, m.crs, figure=fig,axis=ax)
ERROR: InexactError: trunc(Int64, NaN)
Stacktrace:
  [1] trunc
    @ ./float.jl:905 [inlined]
  [2] round
    @ ./float.jl:385 [inlined]
  [3] macro expansion
    @ ~/.julia/packages/StaticArrays/EHHaF/src/broadcast.jl:135 [inlined]
  [4] __broadcast
    @ ~/.julia/packages/StaticArrays/EHHaF/src/broadcast.jl:123 [inlined]
  [5] _broadcast
    @ ~/.julia/packages/StaticArrays/EHHaF/src/broadcast.jl:119 [inlined]
  [6] copy
    @ ~/.julia/packages/StaticArrays/EHHaF/src/broadcast.jl:60 [inlined]
  [7] materialize
    @ ./broadcast.jl:903 [inlined]
  [8] round_to_IRect2D(r::GeometryBasics.HyperRectangle{2, Float32})
    @ Makie ~/.julia/packages/Makie/VRavR/src/makielayout/helpers.jl:7
  [9] (::Makie.var"#1456#1457")(bbox::GeometryBasics.HyperRectangle{2, Float32}, limits::Rect2{Float64}, aspect::DataAspect)
    @ Makie ~/.julia/packages/Makie/VRavR/src/makielayout/helpers.jl:49
 [10] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::@Kwargs{})
    @ Base ./essentials.jl:892
 [11] invokelatest(::Any, ::Any, ::Vararg{Any})
    @ Base ./essentials.jl:889
 [12] (::Observables.MapCallback)(value::Any)
    @ Observables ~/.julia/packages/Observables/YdEbO/src/Observables.jl:436
 [13] #invokelatest#2
    @ ./essentials.jl:892 [inlined]
 [14] invokelatest
    @ ./essentials.jl:889 [inlined]
 [15] notify
    @ ~/.julia/packages/Observables/YdEbO/src/Observables.jl:206 [inlined]
 [16] setindex!(observable::Observable, val::Any)
    @ Observables ~/.julia/packages/Observables/YdEbO/src/Observables.jl:123
 [17] adjustlimits!(la::GeoAxis)
    @ Makie ~/.julia/packages/Makie/VRavR/src/makielayout/blocks/axis.jl:1009
 [18] (::GeoMakie.var"#51#53"{GeoAxis})(::GeometryBasics.HyperRectangle{2, Int64}, ::Rect2{Float64})
    @ GeoMakie ~/.julia/packages/GeoMakie/vcMuZ/src/makie-axis.jl:28
 [19] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::@Kwargs{})
    @ Base ./essentials.jl:892
 [20] invokelatest(::Any, ::Any, ::Vararg{Any})
    @ Base ./essentials.jl:889
 [21] (::Observables.OnAny)(value::Any)
    @ Observables ~/.julia/packages/Observables/YdEbO/src/Observables.jl:420
 [22] #invokelatest#2
    @ ./essentials.jl:892 [inlined]
 [23] invokelatest
    @ ./essentials.jl:889 [inlined]
 [24] notify
    @ ~/.julia/packages/Observables/YdEbO/src/Observables.jl:206 [inlined]
 [25] setindex!(observable::Observable, val::Any)
    @ Observables ~/.julia/packages/Observables/YdEbO/src/Observables.jl:123
 [26] reset_limits!(axis::GeoAxis; xauto::Bool, yauto::Bool)
    @ GeoMakie ~/.julia/packages/GeoMakie/vcMuZ/src/makie-axis.jl:137
 [27] reset_limits!
    @ ~/.julia/packages/GeoMakie/vcMuZ/src/makie-axis.jl:44 [inlined]
 [28] xlims!(ax::GeoAxis, xlims::Tuple{Float32, Float32})
    @ GeoMakie ~/.julia/packages/GeoMakie/vcMuZ/src/makie-axis.jl:449
 [29] limits!
    @ ~/.julia/packages/GeoMakie/vcMuZ/src/makie-axis.jl:471 [inlined]
 [30] Tyler.Map(extent::GeometryBasics.HyperRectangle{โ€ฆ}, extent_crs::MapTiles.WebMercator; resolution::Tuple{โ€ฆ}, figure::Figure, axis::GeoAxis, provider::TileProviders.Provider, crs::MapTiles.WebMercator, max_parallel_downloads::Int64, cache_size_gb::Int64, depth::Int64, halo::Float64, scale::Float64, max_zoom::Int64)
    @ Tyler ~/.julia/packages/Tyler/J1n7N/src/Tyler.jl:146
 [31] top-level scope
    @ REPL[54]:1
Some type information was truncated. Use `show(err)` to see complete types.

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Never delete z=0, z=1, even z=2 tile plots

There is still a small possibility of getting white flashes at the edges if you zoom out really fast after doing lots of scrolling around when zoomed in.

We could get around this and any other white flash problems by having some zoomed out tiles always sitting behind the other plots. At least you would see a blurry pixel of the right color instead of the obvious white flash. In the small flicker that its there for probably no one would notice how blurred it is. But the plain white background is really obvious.

Tyler doesn't work with WGLMakie

Hi, I have been trying to use Tyler together with the WGLMakie backend but get the error below. I'm using Mac. Any ideas on what can go wrong?
image

Tyler + GridLayout throws error

f = Figure(resolution=(1912 * scale, 2284 * scale))
ga = f[1:2, 1] = GridLayout()
m = Tyler.Map(extent; provider, figure = f, axis = ga);

throws this error:

ERROR: type GridLayout has no field autolimitaspect
Stacktrace:
 [1] setproperty!
   @ ~/.julia/packages/GridLayoutBase/lYdxT/src/gridlayout.jl:55 [inlined]
 [2] Tyler.Map(extent::Extent{(:X, :Y), Tuple{Tuple{Int64, Int64}, Tuple{Int64, Int64}}}, extent_crs::MapTiles.WGS84; resolution::Tuple{Int64, Int64}, figure::Figure, axis::GridLayout, provider::Provider, crs::MapTiles.WebMercator, max_parallel_downloads::Int64, cache_size_gb::Int64, depth::Int64, halo::Float64, scale::Float64)
   @ Tyler ~/.julia/packages/Tyler/mD1F5/src/Tyler.jl:126
 [3] top-level scope
   @ ~/Documents/GitHub/AltimPlots.jl/src/plot_data.jl:61

Fade in opacity of tile plots as they load

This might be overkill...

But google maps seems to avoid flickery tiles by loading more tiles at once. Or something. Tyler seems faster at getting tiles loaded than google maps, which is kinda surprising, but it gives this flickery effect.

If we fade in tile opacity for e.g. the first 0.2 seconds we could remove the tile flicker? Maybe that's expensive?

provider CartoDB doesn't work

The CartoDB() is not working here, but it does when using https://github.com/JuliaGeo/Leaflet.jl, I checked and the call to the url is the same in both cases, namely

Provider("https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png", Dict{Symbol, Any}(:url => "https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png", :attribution => "(C) OpenStreetMap contributors (C) CARTO", :variant => "light_all", :name => "CartoDB.Positron", :subdomains => "abcd", :html_attribution => "&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors &copy; <a href=\"https://carto.com/attributions\">CARTO</a>", :max_zoom => 20))

however something goes wrong here, at fetching time. I don't seem to find the differences. Help? Leaflet.jl is doing definitely something different.

make it work with WGLMakie

In the current version, doing:

using WGLMakie
using Tyler
tyler = Tyler.Map(Rect2f(-0.0921, 51.5, 0.04, 0.025))

shows the map and getting new tiles is possible. However, some errors are alive ๐Ÿ˜„

weird: this only show up once (the first time I ran the lines).

ERROR: MethodError: no method matching similar(::Nothing, ::Type{Any})
Closest candidates are:
  similar(::Union{LinearAlgebra.Adjoint{T, var"#s886"}, LinearAlgebra.Transpose{T, var"#s886"}} where {T, var"#s886"<:(AbstractVector)}, ::Type{T}) where T at /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/LinearAlgebra/src/adjtrans.jl:207
  similar(::Union{LinearAlgebra.Adjoint{T, S}, LinearAlgebra.Transpose{T, S}} where {T, S}, ::Type{T}) where T at /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/LinearAlgebra/src/adjtrans.jl:211
  similar(::Union{LinearAlgebra.Adjoint{T, S}, LinearAlgebra.Transpose{T, S}} where {T, S}, ::Type{T}, ::Tuple{Vararg{Int64, N}}) where {T, N} at /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/LinearAlgebra/src/adjtrans.jl:212
  ...

and

An exception was thrown in JS: Error: Key 18059950468910541220 not found! undefined
Additional message: Error while processing message {"payload":["normalmatrix",{"0":1,"1":0,"2":0,"3":0,"4":1,"5":0,"6":0,"7":0,"8":1}],"id":"18059950468910541220","msg_type":"0"}
Stack trace:
    Error: Key 18059950468910541220 not found! undefined
        at lookup_global_object (/Users/lalonso/.julia/packages/JSServe/KDXZU/js_dependencies/JSServe.bundled.js:3012)
        at Object.process_message (/Users/lalonso/.julia/packages/JSServe/KDXZU/js_dependencies/JSServe.bundled.js:3085)
        at /Users/lalonso/.julia/packages/JSServe/KDXZU/js_dependencies/Websocket.bundled.js:92
        at new Promise (<anonymous>)
        at websocket.onmessage (/Users/lalonso/.julia/packages/JSServe/KDXZU/js_dependencies/Websocket.bundled.js:90)
An exception was thrown in JS: Error: Key 18059950468910541220 not found! undefined
Additional message: Error while processing message {"payload":["normalmatrix",{"0":1,"1":0,"2":0,"3":0,"4":1,"5":0,"6":0,"7":0,"8":1}],"id":"18059950468910541220","msg_type":"0"}
Stack trace:
    Error: Key 18059950468910541220 not found! undefined
        at lookup_global_object 

and when zoom in and out, the following warnings:

@/Users/lalonso/.julia/packages/JSServe/KDXZU/js_dependencies/Websocket.bundled.js:90
โ”Œ Warning: getting tile plot already plotted
โ”” @ Tyler ~/.julia/packages/Tyler/3bd3k/src/Tyler.jl:195
โ”Œ Warning: getting tile plot already plotted
โ”” @ Tyler ~/.julia/packages/Tyler/3bd3k/src/Tyler.jl:195
โ”Œ Warning: getting tile plot already plotted
โ”” @ Tyler ~/.julia/packages/Tyler/3bd3k/src/Tyler.jl:195
โ”Œ Warning: getting tile plot already plotted
โ”” @ Tyler ~/.julia/packages/Tyler/3bd3k/src/Tyler.jl:195

Path to generic plots with GeoInterface

Not sure if this already works, but since this is the most complete package, I'll post it here.

Ideally we want this:

ax = plot(points)
background!(ax, TileProvider())

This requires that GeoInterface sets the crs on the plot object? Then we could derive an extent from the plot object (didn't test it, but I assume that's possible), which is enough (with a possible convert) to load the right tile(s) to plot in the background.

Could Tyler support scrollable and zoomable animated maps?

Thinking about how the Julia Geo ecosystem could wow other communities, I was wondering if it could be possible to create interactive (scrollable and zoomable) animated maps. For example is there a way to make the "Whale shark example trajectory" interactive?

Infinite, unstoppable loop if zoom is greater than allowed maximum

See the below MWE:

using Tyler, MapTiles, TileProviders, GLMakie
provider = TileProviders.NASAGIBS(:ViirsEarthAtNight2012)
m = Tyler.Map(HyperRectangle{2, Float32}(Float32[73.675735, 14.7520275], Float32[0.6598676, 1.0475613]), 15;
    provider, min_tiles=8, max_tiles=16, figure=Figure(resolution=(1000, 600)))

this causes a loop that continuously prints out warnings of the form "z greater than max zoom!". I wasn't able to copy it, but that was the gist.

(also, what exactly is zoom, and how do I find its max/min?)

increase label sizes

find a way to increase the font size for labels on top of tiles. Currently, they all are really small, specially when zooming in.

Tyler throws error when using CairoMakie

When using CairoMakie I get this error

ERROR: please load either GLMakie, WGLMakie or CairoMakie
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] Tyler.Map(rect::GeometryBasics.HyperRectangle{2, Float32}, zoom::Int64, input_cs::MapTiles.WGS84; figure::Figure, coordinate_system::MapTiles.WebMercator, provider::Provider, min_tiles::Int64, max_tiles::Int64, max_parallel_downloads::Int64, cache_size_gb::Int64)
   @ Tyler ~/.julia/packages/Tyler/eajCg/src/Tyler.jl:79
 [3] top-level scope
   @ ~/Documents/GitHub/Altim.jl/src/geolocate_dev.jl:88

I suspect that Tyler only works with GLMakie ?

If that's the case the the Error message needs updating.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.