GithubHelp home page GithubHelp logo

makieorg / geomakie.jl Goto Github PK

View Code? Open in Web Editor NEW
162.0 162.0 23.0 495.28 MB

Geographical plotting utilities for Makie.jl

Home Page: https://geo.makie.org

License: MIT License

Julia 99.84% Dockerfile 0.16%

geomakie.jl's People

Contributors

ali-ramadhan avatar asinghvi17 avatar datseris avatar dependabot[bot] avatar github-actions[bot] avatar haakon-e avatar jeremiahpslewis avatar juliatagbot avatar kdheepak avatar knuesel avatar lazarusa avatar navidcy avatar ranocha avatar simonbyrne avatar simondanisch avatar tabeaw 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  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  avatar  avatar  avatar

geomakie.jl's Issues

Tiny image when plotting a limited lon-lat range in GeoMakie 0.1.14

Not sure if it's a GeoMakie issue or if the problem is upstream, but just slightly modifying the README example (limiting the lat-lon range and not plotting coastlines) produces weird results in GeoMakie 0.1.14.

    lons = LinRange(1, 30, 360)   # lon-lat range for Scandinavia
    lats = LinRange(51, 74, 180)

    field = [exp(cosd(l)) + 3(y/90) for l in lons, y in lats]

    source = LonLat()
    dest = WinkelTripel()

    xs, ys = xygrid(lons, lats)
    Proj4.transform!(source, dest, vec(xs), vec(ys))

    scene = surface(xs, ys; color = field, shading = false, show_axis = false, scale_plot = false)

    geoaxis!(scene, extrema(lons), extrema(lats); crs = (src = source, dest = dest,))

GeoMakie 0.1.14 with Makie 0.11.0 (same result with Makie 0.9.5):
makie2

GeoMakie 0.1.10 with Makie 0.9.5:
makie1

West and East in the wrong direction

Thanks for the great GeoAxis! Only problem at the moment, west and east for the ticks is the wrong way around. East should be positive and west negative. (Sorry, I'm currently not able to create a pull request...)

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!

TOP not defined: master doesn't build

julia> using GeoMakie, Proj4
[ Info: Precompiling GeoMakie [db073c08-6b98-4ee5-b6a4-5efafb3259c6]
ERROR: LoadError: LoadError: UndefVarError: Top not defined
Stacktrace:
 [1] top-level scope at C:\Users\m300808\.julia\packages\GeoMakie\OxAEN\src\utils.jl:5
 [2] include at .\boot.jl:328 [inlined]
 [3] include_relative(::Module, ::String) at .\loading.jl:1105
 [4] include at .\Base.jl:31 [inlined]
 [5] include(::String) at C:\Users\m300808\.julia\packages\GeoMakie\OxAEN\src\GeoMakie.jl:1
 [6] top-level scope at C:\Users\m300808\.julia\packages\GeoMakie\OxAEN\src\GeoMakie.jl:23
 [7] include at .\boot.jl:328 [inlined]
 [8] include_relative(::Module, ::String) at .\loading.jl:1105
 [9] include(::Module, ::String) at .\Base.jl:31
 [10] top-level scope at none:2
 [11] eval at .\boot.jl:330 [inlined]
 [12] eval(::Expr) at .\client.jl:425
 [13] top-level scope at .\none:3
in expression starting at C:\Users\m300808\.julia\packages\GeoMakie\OxAEN\src\utils.jl:5
in expression starting at C:\Users\m300808\.julia\packages\GeoMakie\OxAEN\src\GeoMakie.jl:23
ERROR: Failed to precompile GeoMakie [db073c08-6b98-4ee5-b6a4-5efafb3259c6] to C:\Users\m300808\.julia\compiled\v1.3\GeoMakie\GuQif_PD1po.ji.
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1283
 [3] _require(::Base.PkgId) at .\loading.jl:1024
 [4] require(::Base.PkgId) at .\loading.jl:922
 [5] require(::Module, ::Symbol) at .\loading.jl:917

geojson example that GeoMakie has trouble with

https://github.com/openpolis/geojson-italy/raw/master/geojson/limits_IT_provinces.geojson works fine like this

using LibGeos,Plots
Plots.plot(geo)

But in GeoMakie

using GeoJSON, GeoMakie, Makie
states = download("https://github.com/openpolis/geojson-italy/raw/master/geojson/limits_IT_provinces.geojson")
geo = GeoJSON.read(read(states, String))
poly(geo, strokecolor = :blue, strokewidth = 1)

gives

┌ Warning: Imprecise coordinates!  You may want to consider reprojecting to a different coordinate system.
│   coord =
│    4-element Array{GeometryBasics.Point{2,Float64},1}:
│     [8.816415720536941, 45.02230505017947]
│     [8.816376250325996, 45.022280229722504]
│     [8.814270060959595, 45.017394434268766]
│     [8.816415720536941, 45.02230505017947]
└ @ GeoMakie C:\Users\jr\.julia\dev\GeoMakie\src\conversions.jl:112
┌ Warning: Imprecise coordinates!  You may want to consider reprojecting to a different coordinate system.
│   coord =
│    4-element Array{GeometryBasics.Point{2,Float64},1}:
│     [8.704042688204055, 45.017526539521306]
│     [8.70638594669059, 45.013562784948256]
│     [8.705427668630502, 45.02448328736225]
│     [8.704042688204055, 45.017526539521306]
└ @ GeoMakie C:\Users\jr\.julia\dev\GeoMakie\src\conversions.jl:112
┌ Warning: Coordinates have been removed, because they were
│ too ambiguous.  Number of coordinates is now 67.
└ @ GeoMakie C:\Users\jr\.julia\dev\GeoMakie\src\conversions.jl:126

and not all provinces are plotted. MultiPolygons could be splitted into Polygons, but then this one

pl = GeoMakie.GeoInterface.Polygon(GeoMakie.GeoInterface.coordinates(geo.features[103].geometry)[1])
poly(pl, strokecolor = :blue, strokewidth = 1)

errors

ERROR: Not enough points in the contour. Found: GeometryBasics.Point{2,Float32}[[9.68323, 40.659004]]
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] decompose(::Type{GeometryBasics.NgonFace{3,GeometryBasics.OffsetInteger{-1,UInt32}}}, ::Array{GeometryBasics.Point{2,Float32},1}) at C:\Users\jr\.julia\packages\GeometryBasics\x7LIA\src\triangulation.jl:127
 [3] mesh(::Array{GeometryBasics.Point{2,Float32},1}; pointtype::Type{T} where T, facetype::Type{T} where T, normaltype::Nothing, nvertices::Nothing) at C:\Users\jr\.julia\packages\GeometryBasics\x7LIA\src\meshes.jl:137
 [4] triangle_mesh at C:\Users\jr\.julia\packages\GeometryBasics\x7LIA\src\meshes.jl:161 [inlined]
 [5] _broadcast_getindex_evalf at .\broadcast.jl:631 [inlined]
 [6] _broadcast_getindex at .\broadcast.jl:604 [inlined]
 [7] getindex at .\broadcast.jl:564 [inlined]
 [8] copy at .\broadcast.jl:854 [inlined]
 [9] materialize at .\broadcast.jl:820 [inlined]
 [10] poly_convert(::Array{Array{GeometryBasics.Point{2,Float32},1},1}) at C:\Users\jr\.julia\packages\AbstractPlotting\Pajd0\src\basic_recipes\basic_recipes.jl:74
 [11] poly_convert(::Array{GeometryBasics.Point{2,Float64},1}) at C:\Users\jr\.julia\packages\AbstractPlotting\Pajd0\src\basic_recipes\basic_recipes.jl:65
 [12] lift(::Function, ::Observables.Observable{Array{GeometryBasics.Point{2,Float64},1}}) at C:\Users\jr\.julia\packages\AbstractPlotting\Pajd0\src\interaction\nodes.jl:8
 [13] plot!(::Poly{...}) at C:\Users\jr\.julia\packages\AbstractPlotting\Pajd0\src\basic_recipes\basic_recipes.jl:101
 [14] plot!(::Scene, ::Type{Poly{...}}, ::Attributes, ::Tuple{Observables.Observable{GeoInterface.Polygon}}, ::Observables.Observable{Tuple{Array{GeometryBasics.Point{2,Float64},1}}}) at C:\Users\jr\.julia\packages\AbstractPlotting\Pajd0\src\interfaces.jl:633
 [15] plot!(::Scene, ::Type{Poly{...}}, ::Attributes, ::GeoInterface.Polygon; kw_attributes::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\Users\jr\.julia\packages\AbstractPlotting\Pajd0\src\interfaces.jl:563
 [16] plot! at C:\Users\jr\.julia\packages\AbstractPlotting\Pajd0\src\interfaces.jl:532 [inlined]
 [17] poly(::GeoInterface.Polygon; attributes::Base.Iterators.Pairs{Symbol,Any,Tuple{Symbol,Symbol},NamedTuple{(:strokecolor, :strokewidth),Tuple{Symbol,Int64}}}) at C:\Users\jr\.julia\packages\AbstractPlotting\Pajd0\src\recipes.jl:15
 [18] top-level scope at REPL[11]:1
 [19] eval(::Module, ::Any) at .\boot.jl:331
 [20] eval_user_input(::Any, ::REPL.REPLBackend) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\REPL\src\REPL.jl:86
 [21] run_backend(::REPL.REPLBackend) at C:\Users\jr\.julia\packages\Revise\WkyNB\src\Revise.jl:1023
 [22] top-level scope at none:0

and Plots+LibGEOS plots it fine Plots.plot(pl)
Sassari

I am on GeoMakie v0.1.10-DEV.

tracking projections that work and do not work

I did the following subset of projections (almost all available from Proj4) to test how many are done correctly and show them in BeautifulMakie(output). Is better than expected, still some corner cases [that I don't use], but those are really hard to get right. Either way, I leave the code here as reference. This is just for lines, I can imagine that for surfaces (heatmaps) less will be successful.

using GLMakie, GeoMakie
GLMakie.activate!()
let
    projections = ["+proj=adams_hemi", "+proj=adams_ws1", "+proj=adams_ws2",
        "+proj=aea +lat_1=29.5 +lat_2=42.5", "+proj=aeqd", "+proj=airy", "+proj=aitoff",
        "+proj=apian", "+proj=august", "+proj=bacon", "+proj=bertin1953", "+proj=bipc +ns",
        "+proj=boggs", "+proj=bonne +lat_1=10", "+proj=cass", "+proj=cea",
        "+proj=chamb +lat_1=10 +lon_1=30 +lon_2=40", "+proj=collg", "+proj=comill",
        "+proj=crast", "+proj=denoy", "+proj=eck1", "+proj=eck2", "+proj=eck3",
        "+proj=eck4", "+proj=eck5", "+proj=eck6", "+proj=eqc", "+proj=eqdc +lat_1=55 +lat_2=60",
        "+proj=eqearth", "+proj=euler +lat_1=67 +lat_2=75", "+proj=fahey", "+proj=fouc", "+proj=fouc_s",
        "+proj=gall", "+proj=geos +h=35785831.0 +lon_0=-60 +sweep=y", "+proj=gins8", "+proj=gn_sinu +m=2 +n=3",
        "+proj=goode", "+proj=guyou", "+proj=hammer", "+proj=hatano",
        "+proj=igh", "+proj=igh_o +lon_0=-160", "+proj=imw_p +lat_1=30 +lat_2=-40", "+proj=isea",
        "+proj=kav5", "+proj=kav7", "+proj=laea", "+proj=lagrng", "+proj=larr", "+proj=lask",
        "+proj=lcca +lat_0=35", "+proj=leac", "+proj=loxim",
        "+proj=lsat +ellps=GRS80 +lat_1=-60 +lat_2=60 +lsat=2 +path=2", "+proj=mbt_s", "+proj=mbt_fps",
        "+proj=mbtfpp", "+proj=mbtfpq", "+proj=mbtfps", "+proj=merc", "+proj=mill", "+proj=misrsom +path=1",
        "+proj=moll", "+proj=murd1 +lat_1=30 +lat_2=50",
        "+proj=murd3 +lat_1=30 +lat_2=50", "+proj=natearth", "+proj=natearth2",
        "+proj=nell", "+proj=nell_h", "+proj=nicol",
        "+proj=ob_tran +o_proj=mill +o_lon_p=40 +o_lat_p=50 +lon_0=60", "+proj=ocea", "+proj=oea +m=1 +n=2",
        "+proj=omerc +lat_1=45 +lat_2=55", "+proj=ortel", "+proj=ortho", "+proj=patterson", "+proj=poly",
        "+proj=putp1", "+proj=putp2", "+proj=putp3", "+proj=putp3p", "+proj=putp4p", "+proj=putp5",
        "+proj=putp5p", "+proj=putp6", "+proj=putp6p", "+proj=qua_aut", "+proj=robin", "+proj=rouss",
        "+proj=rpoly", "+proj=sinu", "+proj=times", "+proj=tissot +lat_1=60 +lat_2=65", "+proj=tmerc",
        "+proj=tobmerc", "+proj=tpeqd +lat_1=60 +lat_2=65", "+proj=urm5 +n=0.9 +alpha=2 +q=4",
        "+proj=urmfps +n=0.5", "+proj=vandg", "+proj=vandg2", "+proj=vandg3", "+proj=vandg4",
        "+proj=vitk1 +lat_1=45 +lat_2=55", "+proj=wag1", "+proj=wag2", "+proj=wag3", "+proj=wag4",
        "+proj=wag5", "+proj=wag6", "+proj=wag7", "+proj=webmerc +datum=WGS84", "+proj=weren",
        "+proj=wink1", "+proj=wink2", "+proj=wintri"]

    fig = Figure(resolution=(1200, 9000))
    k = 2
    for i in 1:39, j in 1:3
        try
            ga = GeoAxis(fig[i, j]; dest=projections[k],
                title=projections[k], coastlines=true)
            hidedecorations!(ga)
        catch ex
        end
        k += 1
    end
    fig
end;

geoProjections

Multiple callback errors when hovering over a projected map (no inverse_transform method)

Using the mouse to hover over the map generated in tests/runtests.jl produces the following error (Windows 10, GeoMakie 0.1.16). A new error is dumped for every mousemove event, so the REPL quickly gets filled with errors.

While waiting for a fix: is there an easy way to disable the hover callback for a given figure?

Error in callback:
MethodError: no method matching inverse_transform(::Makie.PointTrans{2, GeoMakie.PROJ{Projection, Projection}})
Closest candidates are:
  inverse_transform(::typeof(identity)) at C:\Stuff\Makie\src\layouting\transformation.jl:316
  inverse_transform(::typeof(log10)) at C:\Stuff\Makie\src\layouting\transformation.jl:317
  inverse_transform(::typeof(log)) at C:\Stuff\Makie\src\layouting\transformation.jl:318
  ...
Stacktrace:
  [1] process_interaction(r::Makie.MakieLayout.RectangleZoom, event::MouseEvent, ax::Axis)
    @ Makie.MakieLayout C:\Stuff\Makie\src\makielayout\interactions.jl:156
  [2] (::Makie.MakieLayout.var"#process_event#291"{Axis})(event::MouseEvent)
    @ Makie.MakieLayout C:\Stuff\Makie\src\makielayout\layoutables\axis.jl:399
  [3] #invokelatest#2
    @ .\essentials.jl:708 [inlined]
  [4] invokelatest
    @ .\essentials.jl:706 [inlined]
  [5] notify(observable::Makie.PriorityObservable{MouseEvent})
    @ Makie C:\Stuff\Makie\src\interaction\PriorityObservable.jl:72
  [6] setindex!
    @ C:\Stuff\Makie\src\interaction\PriorityObservable.jl:66 [inlined]
  [7] (::Makie.MakieLayout.var"#99#101"{Scene, Makie.MakieLayout.var"#is_mouse_over_relevant_area#96"{Scene, Tuple{}}, Base.RefValue{Float64}, Base.RefValue{Bool}, Base.RefValue{Bool}, Base.RefValue{Union{Nothing, Makie.Mouse.Button}}, Base.RefValue{Bool}, Base.RefValue{GeometryBasics.Point{2, Float32}}, Base.RefValue{GeometryBasics.Point{2, Float32}}, Base.RefValue{Makie.Mouse.Action}, Makie.PriorityObservable{MouseEvent}, Module})(mp::Tuple{Float64, Float64})
    @ Makie.MakieLayout C:\Stuff\Makie\src\makielayout\mousestatemachine.jl:212
  [8] #invokelatest#2
    @ .\essentials.jl:708 [inlined]
  [9] invokelatest
    @ .\essentials.jl:706 [inlined]
 [10] notify(observable::Makie.PriorityObservable{Tuple{Float64, Float64}})
    @ Makie C:\Stuff\Makie\src\interaction\PriorityObservable.jl:72
 [11] setindex!
    @ C:\Stuff\Makie\src\interaction\PriorityObservable.jl:66 [inlined]
 [12] (::GLMakie.var"#71#72"{Events, GLFW.Window})(#unused#::Nothing)
    @ GLMakie C:\Users\niclas\.julia\packages\GLMakie\ayWSm\src\events.jl:6
 [13] #invokelatest#2
    @ .\essentials.jl:708 [inlined]
 [14] invokelatest
    @ .\essentials.jl:706 [inlined]
 [15] notify
    @ C:\Users\niclas\.julia\packages\Observables\OFj0u\src\Observables.jl:88 [inlined]
 [16] setindex!(observable::Observable{Nothing}, val::Nothing)
    @ Observables C:\Users\niclas\.julia\packages\Observables\OFj0u\src\Observables.jl:248
 [17] fps_renderloop(screen::GLMakie.Screen, framerate::Float64)
    @ GLMakie C:\Users\niclas\.julia\packages\GLMakie\ayWSm\src\rendering.jl:22
 [18] renderloop(screen::GLMakie.Screen; framerate::Float64)
    @ GLMakie C:\Users\niclas\.julia\packages\GLMakie\ayWSm\src\rendering.jl:48
 [19] renderloop(screen::GLMakie.Screen)
    @ GLMakie C:\Users\niclas\.julia\packages\GLMakie\ayWSm\src\rendering.jl:41
 [20] (::GLMakie.var"#50#52"{GLMakie.Screen})()
    @ GLMakie .\task.jl:411

v0.3.0 examples somewhat broken

Glad to see an update with simplified syntax and improved docs! But just FYI in case nobody noticed, there's something wrong with the examples. For instance, this is how the final example in the docs renders:

download

The axis labels are off and the whole map is too zoomed in so it looks rectangular instead of round. Everything renders the same way when I cut & paste the code and try it myself.

Warnings on fresh install

Let me start this issue with a bunch of hearts ❤️ ❤️ ❤️ this package will really help with my current research.

I just want to point out that there are many warnings with the simple example:

WARNING: both GeoInterface and GeometryBasics export "LineString"; uses of it in module GeoMakie must be qualified
WARNING: both GeoInterface and GeometryBasics export "Polygon"; uses of it in module GeoMakie must be qualified
WARNING: both AbstractPlotting and GeometryBasics export "Vecf0"; uses of it in module GeoMakie must be qualified
WARNING: both AbstractPlotting and GeometryBasics export "Pointf0"; uses of it in module GeoMakie must be qualified
WARNING: both AbstractPlotting and Base export "Text"; uses of it in module GeoMakie must be qualified

Many names from GeoInterface, GeometryBasics, and other packages are conflicting. It would be nice to clean that up and release a new patch. I want to show off the package to my colleagues at work :)

downgrading AbstractPlotting v0.15.6 ⇒ v0.13.11

Is it possible to simply increase the upper bound for AbstractPlotting without breaking the functionality of the package?, or is not that straightforward ?

I'm looking forward to make a gallery :D, if possible.
Cheers,

GeoInterface 1 support

copied from #115 (comment)

We can work on the GeoInterface integration when JuliaGeometry/GeometryBasics.jl#175 and JuliaGeo/GeoJSON.jl#36 are ready, since this package relies on both packages. Right now GeoInterface 1 cannot be used with this package because GeoJSON.jl is preventing that.

These conversions won't be needed anymore:

https://github.com/JuliaPlots/GeoMakie.jl/blob/ea3e71baa108a90f924172bf59de3519380bd769/src/conversions.jl#L4-L53

And these assets can be updated:

https://github.com/JuliaPlots/GeoMakie.jl/blob/ea3e71baa108a90f924172bf59de3519380bd769/src/data.jl#L11-L24

no method matching layout_text

I just tested a new env for GeoMakie with the following example.

using GLMakie, GeoMakie
fig = Figure()
ga = GeoAxis(
    fig[1, 1]; # any cell of the figure's layout
    dest="+proj=wintri", # the CRS in which you want to plot
    coastlines=true # plot coastlines from Natural Earth, as a reference.
)
scatter!(ga, -120:15:120, -60:7.5:60; color=-60:7.5:60, strokecolor=(:black, 0.2))
fig
MethodError: no method matching layout_text(::String, ::Float64, ::FreeTypeAbstraction.FTFont, ::Vec{2, Float32}, ::Float64, ::Float64, ::Float64, ::RGBA{Float32}, ::RGBA{Float32}, ::Float32)
Closest candidates are:
  layout_text(::AbstractString, ::Union{Number, AbstractVector}, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) at ~/.julia/packages/Makie/imJQo/src/layouting/layouting.jl:41
Stacktrace:
  [1] text_bbox(textstring::String, textsize::Float64, font::FreeTypeAbstraction.FTFont, align::Vec{2, Float32}, rotation::Float64, justification::Float64, lineheight::Float64)
    @ GeoMakie ~/.julia/packages/GeoMakie/rlSdn/src/utils.jl:245
  [2] directional_pad(scene::Scene, limits::GeometryBasics.HyperRectangle{2, Float32}, tickcoord_in_inputspace::Point{2, Float32}, ticklabel::String, tickpad::Point{2, Float32}, ticksize::Float64, tickfont::FreeTypeAbstraction.FTFont, tickrotation::Float64; ds::Float64)
    @ GeoMakie ~/.julia/packages/GeoMakie/rlSdn/src/utils.jl:295
  [3] directional_pad(scene::Scene, limits::GeometryBasics.HyperRectangle{2, Float32}, tickcoord_in_inputspace::Point{2, Float32}, ticklabel::String, tickpad::Point{2, Float32}, ticksize::Float64, tickfont::FreeTypeAbstraction.FTFont, tickrotation::Float64)
    @ GeoMakie ~/.julia/packages/GeoMakie/rlSdn/src/utils.jl:263
  [4] _broadcast_getindex_evalf
    @ ./broadcast.jl:670 [inlined]
  [5] _broadcast_getindex
    @ ./broadcast.jl:643 [inlined]
  [6] _getindex
    @ ./broadcast.jl:667 [inlined]
  [7] _getindex
    @ ./broadcast.jl:666 [inlined]
  [8] _broadcast_getindex
    @ ./broadcast.jl:642 [inlined]
  [9] getindex
    @ ./broadcast.jl:597 [inlined]
 [10] copy
    @ ./broadcast.jl:899 [inlined]
 [11] materialize(bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Nothing, typeof(+), Tuple{Vector{Point{2, Float32}}, Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Nothing, typeof(GeoMakie.directional_pad), Tuple{Base.RefValue{Scene}, Base.RefValue{GeometryBasics.HyperRectangle{2, Float32}}, Vector{Point{2, Float32}}, Vector{String}, Base.RefValue{Point{2, Float32}}, Float64, Base.RefValue{FreeTypeAbstraction.FTFont}, Float64}}}})
    @ Base.Broadcast ./broadcast.jl:860
 [12] (::GeoMakie.var"#44#47"{Axis, Int64, Bool, MakieCore.Text{Tuple{Vector{Tuple{AbstractString, Point{2, Float32}}}}}, MakieCore.Text{Tuple{Vector{Tuple{AbstractString, Point{2, Float32}}}}}, Observable{Tuple{Float32, Float32}}, Observable{Tuple{Float32, Float32}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{String}}, Observable{Vector{String}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Scene})(limits::GeometryBasics.HyperRectangle{2, Float32}, xticks::LinearTicks, xtickformat::Function, yticks::LinearTicks, ytickformat::Function, xminor::IntervalsBetween, yminor::IntervalsBetween, pxarea::GeometryBasics.HyperRectangle{2, Int64}, _tfunc::Proj4.Transformation, spinewidth::Float64, xgridwidth::Float64, ygridwidth::Float64)
    @ GeoMakie ~/.julia/packages/GeoMakie/rlSdn/src/geoaxis.jl:227
 [13] map(::GeoMakie.var"#44#47"{Axis, Int64, Bool, MakieCore.Text{Tuple{Vector{Tuple{AbstractString, Point{2, Float32}}}}}, MakieCore.Text{Tuple{Vector{Tuple{AbstractString, Point{2, Float32}}}}}, Observable{Tuple{Float32, Float32}}, Observable{Tuple{Float32, Float32}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{String}}, Observable{Vector{String}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Scene}, ::Observable{GeometryBasics.HyperRectangle{2, Float32}}, ::Observable{Any}, ::Vararg{Any}; ignore_equal_values::Bool)
    @ Observables ~/.julia/packages/Observables/ynr7h/src/Observables.jl:444
 [14] map(::GeoMakie.var"#44#47"{Axis, Int64, Bool, MakieCore.Text{Tuple{Vector{Tuple{AbstractString, Point{2, Float32}}}}}, MakieCore.Text{Tuple{Vector{Tuple{AbstractString, Point{2, Float32}}}}}, Observable{Tuple{Float32, Float32}}, Observable{Tuple{Float32, Float32}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{String}}, Observable{Vector{String}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Point{2, Float32}}}, Scene}, ::Observable{GeometryBasics.HyperRectangle{2, Float32}}, ::Observable{Any}, ::Observable{Any}, ::Vararg{Any})
    @ Observables ~/.julia/packages/Observables/ynr7h/src/Observables.jl:444
 [15] draw_geoticks!(ax::Axis, hijacked_observables::Dict{Symbol, Observable}, line_density::Int64, remove_overlapping_ticks::Bool)
    @ GeoMakie ~/.julia/packages/GeoMakie/rlSdn/src/geoaxis.jl:200
 [16] GeoAxis(args::GridPosition; source::String, dest::String, transformation::Proj4.Transformation, lonlims::Tuple{Int64, Int64}, latlims::Tuple{Int64, Int64}, coastlines::Bool, coastline_attributes::NamedTuple{(:label,), Tuple{String}}, line_density::Int64, remove_overlapping_ticks::Bool, xtickformat::typeof(GeoMakie.longitude_format), ytickformat::typeof(GeoMakie.latitude_format), xticks::LinearTicks, yticks::LinearTicks, xticklabelpad::Float64, yticklabelpad::Float64, alignmode::Outside, kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ GeoMakie ~/.julia/packages/GeoMakie/rlSdn/src/geoaxis.jl:157
 [17] top-level scope
    @ ~/Documents/GeoMakieAgain/scripts/test.jl:3

my versions:

(GeoMakieAgain) pkg> st
      Status `~/Documents/GeoMakieAgain/Project.toml`
  [e9467ef8] GLMakie v0.6.1
  [db073c08] GeoMakie v0.4.0

Something is off at mid longtitude

For some reason (which I don't immediatelly see,

I have:

lons = 0.5:1:359.5
lons .- 180 # Proj4 requires this format for longtitude
lats = -89.5:1:89.5

field = rand(length(lons), length(lats), 5)

(notice that I've exchange the naming of lon and lat that you use so that they correspond to reality.

and then I do

source = WGS84()
dest = Projection("+proj=robin")

points = GeoMakie.transform.(WGS84(), dest, GeoMakie.gridpoints(lons, lats))
faces  = GeoMakie.grid_triangle_faces(lons, lats)

colorfunc(i) = vec(field[:, :, i])
r = 1:size(field)[3]
i = r[1]
scene.plots[1].color = colorfunc(i)

which gives me
image

As you can see, after the mid longitude, the plotting stops weorking properly... :(

Tag a new version

Seems like GeoMakie holds up MakieGallery version resolve, which looks like it's fixed on master

How to use `heatmap!`, `contourf!`, or `heatmap!` with GeoMakie.jl v0.2?

Thanks so much to the people who helped revive GeoMakie.jl and released v0.2! Been looking for a Julia alternative for matplotlib + cartopy so I'm excited to switch my plotting pipelines to GeoMakie.jl.

The new example (https://github.com/JuliaPlots/GeoMakie.jl/blob/master/examples/geomakie_new.jl) worked for me with CairoMakie.jl so I'm trying to modify it to plot model output but can't seem to get a minimal working example with heatmap!, contourf!, or heatmap!. Apologies if I'm doing something wrong.

Minimal working example

using CairoMakie
using GeoMakie
using GeoMakie.GeoInterface
using GeoMakie.GeoJSON
using Proj4

# select a coordinate projection, using a string that PROJ accepts
# see e.g. https://proj.org/operations/projections/index.html
source = "+proj=longlat +datum=WGS84"
dest = "+proj=natearth2"
trans = Proj4.Transformation(source, dest, always_xy=true)
ptrans = Makie.PointTrans{2}(trans)

fig = Figure()
ax = Axis(fig[1, 1], aspect=DataAspect())

# all input data coordinates are projected using this function
ax.scene.transformation.transform_func[] = ptrans

# draw projected grid lines and set limits accordingly
lats = -90:10.0:90 |> collect
lons = -180:10.0:180 |> collect

# avoid PROJ wrapping 180 to -180
lons[end] = prevfloat(lons[end])

field = [exp(cosd(l)) + 3(y/90) for l in lons, y in lats]

# heatmap!(ax, lons, lats, field)
# contourf!(ax, lons, lats, field)
# surface!(ax, lons, lats, color=field)
# save("geomakie.png", fig, px_per_unit=2)

heatmap!

heatmap!(ax, lons, lats, field)
save("geomakie.png", fig, px_per_unit=2)

produces

geomakie

contourf!

Rerunning the MWE with

contourf!(ax, lons, lats, field)
save("geomakie.png", fig, px_per_unit=2)

produces

geomakie

surface!

Rerunning the MWE with

surface!(ax, lons, lats, color=field)
save("geomakie.png", fig, px_per_unit=2)

produces an error

ERROR: LoadError: `Makie.convert_arguments` for the plot type Surface{Tuple{Vector{Float64}, Vector{Float64}}} and its conversion trait ContinuousSurface() was unsuccessful.                                                                                                           
                                                                                                                                                                                                                                                                                        
The signature that could not be converted was:                                                                                                                                                                                                                                          
::Vector{Float32}, ::Vector{Float32}                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                        
Makie needs to convert all plot input arguments to types that can be consumed by the backends (typically Arrays with Float32 elements).                                                                                                                                                 
You can define a method for `Makie.convert_arguments` (a type recipe) for these types or their supertypes to make this set of arguments convertible (See http://makie.juliaplots.org/stable/recipes.html).                                                                              
                                                                                                                                                                                                                                                                                        
Alternatively, you can define `Makie.convert_single_argument` for single arguments which have types that are unknown to Makie but which can be converted to known types and fed back to the conversion pipeline.                                                                        
                                                                                                                                                                                                                                                                                        
Stacktrace:                                                                                                                                                                                                                                                                             
  [1] error(s::String)                                                                                                                                                                                                                                                                  
    @ Base ./error.jl:33                                                                                                                                                                                                                                                                
  [2] convert_arguments(::Type{Surface{Tuple{Vector{Float64}, Vector{Float64}}}}, ::Vector{Float32}, ::Vararg{Vector{Float32}, N} where N; kw::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})                                                                
    @ Makie ~/.julia/packages/Makie/Riyar/src/conversions.jl:17                                                                                                                                                                                                                         
  [3] convert_arguments(::Type{Surface{Tuple{Vector{Float64}, Vector{Float64}}}}, ::Vector{Float32}, ::Vector{Float32})                                                                                                                                                                 
    @ Makie ~/.julia/packages/Makie/Riyar/src/conversions.jl:8                                                                                                                                                                                                                          
  [4] convert_arguments_individually(::Type{Surface{Tuple{Vector{Float64}, Vector{Float64}}}}, ::Vector{Float64}, ::Vararg{Vector{Float64}, N} where N)                                                                                                                                 
    @ Makie ~/.julia/packages/Makie/Riyar/src/conversions.jl:51                                                                                                                                                                                                                         
  [5] convert_arguments(::Type{Surface{Tuple{Vector{Float64}, Vector{Float64}}}}, ::Vector{Float64}, ::Vararg{Vector{Float64}, N} where N; kw::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})                                                                
    @ Makie ~/.julia/packages/Makie/Riyar/src/conversions.jl:14                                                                                                                                                                                                                         
  [6] convert_arguments(::Type{Surface{Tuple{Vector{Float64}, Vector{Float64}}}}, ::Vector{Float64}, ::Vector{Float64})                                                                                                                                                                 
    @ Makie ~/.julia/packages/Makie/Riyar/src/conversions.jl:8                                                                                                                                                                                                                          
  [7] plot!(::Scene, ::Type{Surface{ArgType} where ArgType}, ::Attributes, ::Vector{Float64}, ::Vararg{Vector{Float64}, N} where N; kw_attributes::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})                                                            
    @ Makie ~/.julia/packages/Makie/Riyar/src/interfaces.jl:369                                                                                                                                                                                                                         
  [8] plot!(::Scene, ::Type{Surface{ArgType} where ArgType}, ::Attributes, ::Vector{Float64}, ::Vector{Float64})                                                                                                                                                                        
    @ Makie ~/.julia/packages/Makie/Riyar/src/interfaces.jl:356                                                                                                                                                                                                                         
  [9] plot!(::Axis, ::Type{Surface{ArgType} where ArgType}, ::Attributes, ::Vector{Float64}, ::Vararg{Vector{Float64}, N} where N; kw_attributes::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})                                                             
    @ Makie.MakieLayout ~/.julia/packages/Makie/Riyar/src/makielayout/layoutables/axis.jl:641                                                                                                                                                                                           
 [10] plot!(::Axis, ::Type{Surface{ArgType} where ArgType}, ::Attributes, ::Vector{Float64}, ::Vector{Float64})                                                                                                                                                                         
    @ Makie.MakieLayout ~/.julia/packages/Makie/Riyar/src/makielayout/layoutables/axis.jl:636                                                                                                                                                                                           
 [11] plot!(::Type{Surface{ArgType} where ArgType}, ::Axis, ::Vector{Float64}, ::Vararg{Vector{Float64}, N} where N; kw_attributes::Base.Iterators.Pairs{Symbol, Matrix{Float64}, Tuple{Symbol}, NamedTuple{(:color,), Tuple{Matrix{Float64}}}})                                        
    @ Makie.MakieLayout ~/.julia/packages/Makie/Riyar/src/makielayout/layoutables/axis.jl:653                                                                                                                                                                                           
 [12] surface!(::Axis, ::Vararg{Any, N} where N; attributes::Base.Iterators.Pairs{Symbol, Matrix{Float64}, Tuple{Symbol}, NamedTuple{(:color,), Tuple{Matrix{Float64}}}})                                                                                                               
    @ MakieCore ~/.julia/packages/MakieCore/S8PkO/src/recipes.jl:35                                                                                                                                                                                                                     
 [13] top-level scope                                                                                                                                                                                                                                                                   
    @ ~/Oceananigans.jl/validation/cubed_sphere_eddying_aquaplanet/geomakie_test.jl:34                                                                                                                                                                                                  
 [14] include(fname::String)                                                                                                                                                                                                                                                            
    @ Base.MainInclude ./client.jl:444                                                                                                                                                                                                                                                  
 [15] top-level scope                                                                                                                                                                                                                                                                   
    @ REPL[21]:1                                                                                                                                                                                                                                                                        
in expression starting at /home/alir/Oceananigans.jl/validation/cubed_sphere_eddying_aquaplanet/geomakie_test.jl:34

caused by: MethodError: no method matching convert_arguments(::Type{Surface{Tuple{Vector{Float64}, Vector{Float64}}}}, ::Vector{Float32}, ::Vector{Float32})                                                                                                                            
Closest candidates are:                                                                                                                                                                                                                                                                 
  convert_arguments(::Union{Type{Any}, Type{var"#s261"} where var"#s261"<:AbstractPlot}, ::Any...; kw...) at /home/alir/.julia/packages/Makie/Riyar/src/conversions.jl:7                                                                                                                
  convert_arguments(::SurfaceLike, ::AbstractVector{T1}, ::AbstractVector{T2}, ::Function) where {T1, T2} at /home/alir/.julia/packages/Makie/Riyar/src/conversions.jl:323                                                                                                              
  convert_arguments(::SurfaceLike, ::AbstractVecOrMat{var"#s261"} where var"#s261"<:Number, ::AbstractVecOrMat{var"#s260"} where var"#s260"<:Number, ::AbstractMatrix{var"#s259"} where var"#s259"<:Number) at /home/alir/.julia/packages/Makie/Riyar/src/conversions.jl:280            
  ...                                                                                                                                                                                                                                                                                   
Stacktrace:                                                                                                                                                                                                                                                                             
  [1] convert_arguments_individually(::Type{Surface{Tuple{Vector{Float64}, Vector{Float64}}}}, ::Vector{Float32}, ::Vararg{Vector{Float32}, N} where N)                                                                                                                                 
    @ Makie ~/.julia/packages/Makie/Riyar/src/conversions.jl:47                                                                                                                                                                                                                         
  [2] convert_arguments(::Type{Surface{Tuple{Vector{Float64}, Vector{Float64}}}}, ::Vector{Float32}, ::Vararg{Vector{Float32}, N} where N; kw::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})                                                                
    @ Makie ~/.julia/packages/Makie/Riyar/src/conversions.jl:14                                                                                                                                                                                                                         
  [3] convert_arguments(::Type{Surface{Tuple{Vector{Float64}, Vector{Float64}}}}, ::Vector{Float32}, ::Vector{Float32})                                                                                                                                                                 
    @ Makie ~/.julia/packages/Makie/Riyar/src/conversions.jl:8                                                                                                                                                                                                                          
  [4] convert_arguments_individually(::Type{Surface{Tuple{Vector{Float64}, Vector{Float64}}}}, ::Vector{Float64}, ::Vararg{Vector{Float64}, N} where N)                                                                                                                                 
    @ Makie ~/.julia/packages/Makie/Riyar/src/conversions.jl:51                                                                                                                                                                                                                         
  [5] convert_arguments(::Type{Surface{Tuple{Vector{Float64}, Vector{Float64}}}}, ::Vector{Float64}, ::Vararg{Vector{Float64}, N} where N; kw::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})                                                                
    @ Makie ~/.julia/packages/Makie/Riyar/src/conversions.jl:14                                                                                                                                                                                                                         
  [6] convert_arguments(::Type{Surface{Tuple{Vector{Float64}, Vector{Float64}}}}, ::Vector{Float64}, ::Vector{Float64})                                                                                                                                                                 
    @ Makie ~/.julia/packages/Makie/Riyar/src/conversions.jl:8                                                                                                                                                                                                                          
  [7] plot!(::Scene, ::Type{Surface{ArgType} where ArgType}, ::Attributes, ::Vector{Float64}, ::Vararg{Vector{Float64}, N} where N; kw_attributes::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})                                                            
    @ Makie ~/.julia/packages/Makie/Riyar/src/interfaces.jl:369                                                                                                                                                                                                                         
  [8] plot!(::Scene, ::Type{Surface{ArgType} where ArgType}, ::Attributes, ::Vector{Float64}, ::Vector{Float64})                                                                                                                                                                        
    @ Makie ~/.julia/packages/Makie/Riyar/src/interfaces.jl:356                                                                                                                                                                                                                         
  [9] plot!(::Axis, ::Type{Surface{ArgType} where ArgType}, ::Attributes, ::Vector{Float64}, ::Vararg{Vector{Float64}, N} where N; kw_attributes::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})                                                             
    @ Makie.MakieLayout ~/.julia/packages/Makie/Riyar/src/makielayout/layoutables/axis.jl:641                                                                                                                                                                                           
 [10] plot!(::Axis, ::Type{Surface{ArgType} where ArgType}, ::Attributes, ::Vector{Float64}, ::Vector{Float64})                                                                                                                                                                         
    @ Makie.MakieLayout ~/.julia/packages/Makie/Riyar/src/makielayout/layoutables/axis.jl:636                                                                                                                                                                                           
 [11] plot!(::Type{Surface{ArgType} where ArgType}, ::Axis, ::Vector{Float64}, ::Vararg{Vector{Float64}, N} where N; kw_attributes::Base.Iterators.Pairs{Symbol, Matrix{Float64}, Tuple{Symbol}, NamedTuple{(:color,), Tuple{Matrix{Float64}}}})                                        
    @ Makie.MakieLayout ~/.julia/packages/Makie/Riyar/src/makielayout/layoutables/axis.jl:653                                                                                                                                                                                           
 [12] surface!(::Axis, ::Vararg{Any, N} where N; attributes::Base.Iterators.Pairs{Symbol, Matrix{Float64}, Tuple{Symbol}, NamedTuple{(:color,), Tuple{Matrix{Float64}}}})                                                                                                               
    @ MakieCore ~/.julia/packages/MakieCore/S8PkO/src/recipes.jl:35                                                                                                                                                                                                                     
 [13] top-level scope                                                                                                                                                                                                                                                                   
    @ ~/Oceananigans.jl/validation/cubed_sphere_eddying_aquaplanet/geomakie_test.jl:34                                                                                                                                                                                                  
 [14] include(fname::String)                                                                                                                                                                                                                                                            
    @ Base.MainInclude ./client.jl:444                                                                                                                                                                                                                                                  
 [15] top-level scope                                                                                                                                                                                                                                                                   
    @ REPL[21]:1

caused by: MethodError: no method matching convert_arguments(::ContinuousSurface, ::Vector{Float32}, ::Vector{Float32})                                                                                                                                                                 
Closest candidates are:                                                                                                                                                                                                                                                                 
  convert_arguments(::SurfaceLike, ::AbstractVector{T1}, ::AbstractVector{T2}, ::Function) where {T1, T2} at /home/alir/.julia/packages/Makie/Riyar/src/conversions.jl:323                                                                                                              
  convert_arguments(::SurfaceLike, ::AbstractVecOrMat{var"#s261"} where var"#s261"<:Number, ::AbstractVecOrMat{var"#s260"} where var"#s260"<:Number, ::AbstractMatrix{var"#s259"} where var"#s259"<:Number) at /home/alir/.julia/packages/Makie/Riyar/src/conversions.jl:280            
  convert_arguments(::SurfaceLike, ::AbstractVecOrMat{var"#s261"} where var"#s261"<:Number, ::AbstractVecOrMat{var"#s260"} where var"#s260"<:Number, ::AbstractMatrix{var"#s259"} where var"#s259"<:Union{Number, Colorant}) at /home/alir/.julia/packages/Makie/Riyar/src/conversions.$
l:277                                                                                                                                                                                                                                                                                   
  ...                                                                                                                                                                                                                                                                                   
Stacktrace:                                                                                                                                                                                                                                                                             
  [1] convert_arguments(::Type{Surface{Tuple{Vector{Float64}, Vector{Float64}}}}, ::Vector{Float32}, ::Vararg{Vector{Float32}, N} where N; kw::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})                                                                
    @ Makie ~/.julia/packages/Makie/Riyar/src/conversions.jl:10                                                                                                                                                                                                                         
  [2] convert_arguments(::Type{Surface{Tuple{Vector{Float64}, Vector{Float64}}}}, ::Vector{Float32}, ::Vector{Float32})                                                                                                                                                                 
    @ Makie ~/.julia/packages/Makie/Riyar/src/conversions.jl:8                                                                                                                                                                                                                          
  [3] convert_arguments_individually(::Type{Surface{Tuple{Vector{Float64}, Vector{Float64}}}}, ::Vector{Float64}, ::Vararg{Vector{Float64}, N} where N)                                                                                                                                 
    @ Makie ~/.julia/packages/Makie/Riyar/src/conversions.jl:51
  [4] convert_arguments(::Type{Surface{Tuple{Vector{Float64}, Vector{Float64}}}}, ::Vector{Float64}, ::Vararg{Vector{Float64}, N} where N; kw::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie ~/.julia/packages/Makie/Riyar/src/conversions.jl:14
  [5] convert_arguments(::Type{Surface{Tuple{Vector{Float64}, Vector{Float64}}}}, ::Vector{Float64}, ::Vector{Float64})
    @ Makie ~/.julia/packages/Makie/Riyar/src/conversions.jl:8
  [6] plot!(::Scene, ::Type{Surface{ArgType} where ArgType}, ::Attributes, ::Vector{Float64}, ::Vararg{Vector{Float64}, N} where N; kw_attributes::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie ~/.julia/packages/Makie/Riyar/src/interfaces.jl:369
  [7] plot!(::Scene, ::Type{Surface{ArgType} where ArgType}, ::Attributes, ::Vector{Float64}, ::Vector{Float64})
    @ Makie ~/.julia/packages/Makie/Riyar/src/interfaces.jl:356
  [8] plot!(::Axis, ::Type{Surface{ArgType} where ArgType}, ::Attributes, ::Vector{Float64}, ::Vararg{Vector{Float64}, N} where N; kw_attributes::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie.MakieLayout ~/.julia/packages/Makie/Riyar/src/makielayout/layoutables/axis.jl:641
  [9] plot!(::Axis, ::Type{Surface{ArgType} where ArgType}, ::Attributes, ::Vector{Float64}, ::Vector{Float64})
    @ Makie.MakieLayout ~/.julia/packages/Makie/Riyar/src/makielayout/layoutables/axis.jl:636
 [10] plot!(::Type{Surface{ArgType} where ArgType}, ::Axis, ::Vector{Float64}, ::Vararg{Vector{Float64}, N} where N; kw_attributes::Base.Iterators.Pairs{Symbol, Matrix{Float64}, Tuple{Symbol}, NamedTuple{(:color,), Tuple{Matrix{Float64}}}})
    @ Makie.MakieLayout ~/.julia/packages/Makie/Riyar/src/makielayout/layoutables/axis.jl:653
 [11] surface!(::Axis, ::Vararg{Any, N} where N; attributes::Base.Iterators.Pairs{Symbol, Matrix{Float64}, Tuple{Symbol}, NamedTuple{(:color,), Tuple{Matrix{Float64}}}})
    @ MakieCore ~/.julia/packages/MakieCore/S8PkO/src/recipes.jl:35
 [12] top-level scope
    @ ~/Oceananigans.jl/validation/cubed_sphere_eddying_aquaplanet/geomakie_test.jl:34
 [13] include(fname::String)
    @ Base.MainInclude ./client.jl:444
 [14] top-level scope
    @ REPL[21]:1

caused by: MethodError: no method matching convert_arguments(::ContinuousSurface, ::Vector{Float64}, ::Vector{Float64})
Closest candidates are:
  convert_arguments(::SurfaceLike, ::AbstractVector{T1}, ::AbstractVector{T2}, ::Function) where {T1, T2} at /home/alir/.julia/packages/Makie/Riyar/src/conversions.jl:323
  convert_arguments(::SurfaceLike, ::AbstractVecOrMat{var"#s261"} where var"#s261"<:Number, ::AbstractVecOrMat{var"#s260"} where var"#s260"<:Number, ::AbstractMatrix{var"#s259"} where var"#s259"<:Number) at /home/alir/.julia/packages/Makie/Riyar/src/conversions.jl:280           
  convert_arguments(::SurfaceLike, ::AbstractVecOrMat{var"#s261"} where var"#s261"<:Number, ::AbstractVecOrMat{var"#s260"} where var"#s260"<:Number, ::AbstractMatrix{var"#s259"} where var"#s259"<:Union{Number, Colorant}) at /home/alir/.julia/packages/Makie/Riyar/src/conversions.jl:277
  ...
Stacktrace:
  [1] convert_arguments(::Type{Surface{Tuple{Vector{Float64}, Vector{Float64}}}}, ::Vector{Float64}, ::Vararg{Vector{Float64}, N} where N; kw::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie ~/.julia/packages/Makie/Riyar/src/conversions.jl:10
  [2] convert_arguments(::Type{Surface{Tuple{Vector{Float64}, Vector{Float64}}}}, ::Vector{Float64}, ::Vector{Float64})
    @ Makie ~/.julia/packages/Makie/Riyar/src/conversions.jl:8
  [3] plot!(::Scene, ::Type{Surface{ArgType} where ArgType}, ::Attributes, ::Vector{Float64}, ::Vararg{Vector{Float64}, N} where N; kw_attributes::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie ~/.julia/packages/Makie/Riyar/src/interfaces.jl:369
  [4] plot!(::Scene, ::Type{Surface{ArgType} where ArgType}, ::Attributes, ::Vector{Float64}, ::Vector{Float64})
    @ Makie ~/.julia/packages/Makie/Riyar/src/interfaces.jl:356
  [5] plot!(::Axis, ::Type{Surface{ArgType} where ArgType}, ::Attributes, ::Vector{Float64}, ::Vararg{Vector{Float64}, N} where N; kw_attributes::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie.MakieLayout ~/.julia/packages/Makie/Riyar/src/makielayout/layoutables/axis.jl:641
  [6] plot!(::Axis, ::Type{Surface{ArgType} where ArgType}, ::Attributes, ::Vector{Float64}, ::Vector{Float64})
    @ Makie.MakieLayout ~/.julia/packages/Makie/Riyar/src/makielayout/layoutables/axis.jl:636
  [7] plot!(::Type{Surface{ArgType} where ArgType}, ::Axis, ::Vector{Float64}, ::Vararg{Vector{Float64}, N} where N; kw_attributes::Base.Iterators.Pairs{Symbol, Matrix{Float64}, Tuple{Symbol}, NamedTuple{(:color,), Tuple{Matrix{Float64}}}})
    @ Makie.MakieLayout ~/.julia/packages/Makie/Riyar/src/makielayout/layoutables/axis.jl:653
  [8] surface!(::Axis, ::Vararg{Any, N} where N; attributes::Base.Iterators.Pairs{Symbol, Matrix{Float64}, Tuple{Symbol}, NamedTuple{(:color,), Tuple{Matrix{Float64}}}})
    @ MakieCore ~/.julia/packages/MakieCore/S8PkO/src/recipes.jl:35
  [9] top-level scope
    @ ~/Oceananigans.jl/validation/cubed_sphere_eddying_aquaplanet/geomakie_test.jl:34
 [10] include(fname::String)
    @ Base.MainInclude ./client.jl:444
 [11] top-level scope
    @ REPL[21]:1

Orthographic projection not working.

by using "+proj=ortho" in the README example the following error is shown.

error message: LoadError: Invalid x-limits (-6.378137f6, Inf32) for scale identity which is defined on the interval -Inf..Inf (open)

Plotting Coastlines with ortographic projection

Hello,

I was trying out this nice package and found an issue when trying to run the example on the repository landing page using a destination projection that does not represent the full earth (like the ortographic one for example).

Here is the code I used to run the example

using GeoMakie, Makie

lons = LinRange(-89.5, 89.5, 180)
lats = LinRange(-89.5, 89.5, 180)

field = [exp(cosd(l)) + 3(y/90) for l in lons, y in lats]

source = GeoMakie.LonLat()
# dest = GeoMakie.Proj4()
dest = GeoMakie.Projection("+proj=ortho")

xs, ys = GeoMakie.xygrid(lons, lats)
GeoMakie.Proj4.transform!(source, dest, vec(xs), vec(ys))

scene = Makie.surface(xs, ys; color = field, shading = false, show_axis = false, scale_plot = false)

GeoMakie.geoaxis!(scene, extrema(lons), extrema(lats); crs = (src = source, dest = dest,))

GeoMakie.coastlines!(scene; crs = (src = source, dest = dest,))

which throws an error transform error: tolerance condition error at the last line coming from the Proj4 dependency.

The problem is that the transform function from the proj library return an err code when a single point is provided to the function and this lies outside of the visible earth in the projection.
When multiple points are provided to the transform function instead, points that lie outside of the visible earth are simply transformed to Inf without throwing an error.
This error could then be solved either by changing the behavior of Proj4 (maybe with a flag or something to disregard error code -20 related to this transformation problem), or by passing the vector of coastlines point to the plot function as a full vector instead of doing it point-by-point.

I decided to open an Issue here because I thought the latter would be preferable if possible but being quite new to Julia and especially Makie I am not sure how much problematic following this approach could be.

More efficient projections

We can theoretically convert large enough arrays to StructArrays and call Proj's array transformation methods on those. It would have to be tested though.

Large polygons are bad for performance

You can't realistically go above 720x360 in a polygon without running into serious performance issues, at least the way I've implemented it currently. @SimonDanisch is there any way this could be done in the backend, as a nonlinear projection? It would have to be sort of black-boxed, though.

To give a brief explanation of what's going on now, what I've done is to simply define a mesh based on a regular grid in input space (usually untransformed lat-long), and then transform the points into projected space (whatever target projection is given). Then, an image is provided as the colour for the mesh.

As I understand it, this is similar to the approach which most people take to deforming images; however, it is much less performant. Any help optimizing this would be really appreciated.

GeoMakie example does not show geoaxis

I am running the GeoMakie (v0.1.14) example (https://github.com/JuliaPlots/GeoMakie.jl/blob/master/README.md) in IJulia (Windows 10), but the geoaxis object is not shown. The rest, including the coastline is shown. What am I doing wrong?
download

using GeoMakie, Makie
AbstractPlotting.inline!(true)

lons = LinRange(-179.5, 179.5, 360)
lats = LinRange(-89.5, 89.5, 180)

field = [exp(cosd(l)) + 3(y/90) for l in lons, y in lats]

source = LonLat()
dest = WinkelTripel()

xs, ys = xygrid(lons, lats)
Proj4.transform!(source, dest, vec(xs), vec(ys))

scene = surface(xs, ys; color = field, shading = false, show_axis = false, scale_plot = false)

geoaxis!(scene, extrema(lons), extrema(lats); crs = (src = source, dest = dest,))

coastlines!(scene; crs = (src = source, dest = dest,))

How to plot coastlines?

Let's say I plot some whatever random field in my plot of the earth, like

using GeoMakie, Makie, Proj4
lons = 0.5:1:359.5
lats = -89.5:1:89.5
field = [sind(l)^2 + (y/90)^2 for l in lons, y in lats, i in 1:5] # not my actual data, but this will do
source = WGS84()
dest = Projection("+proj=moll +lon_0=+180")
points = GeoMakie.transform.(WGS84(), dest, GeoMakie.gridpoints(lons, lats))
faces  = GeoMakie.grid_triangle_faces(lons, lats)
colorfunc(i) = vec(field[:, :, i])
scene = poly(points, faces; color = colorfunc(1), show_axis = false)
geoaxis!(scene, -180, 180, -90, 90; crs = (dest = dest,))

image

How do I plot the coastlines on top of that, which I think it is the only way to decide if I am using correctly my longitude and lattitude?

Projections!

Hi! I've just stumbled upon this (thanks to the Julia Slack for pointing me here), but are there plans to include map projections in GeoMakie? If so how do we go about contributing (i have no experience in doing map projections, but I can try).

WilkinsonTicks problem on current master

uuuuurg I want to test the Robinson plotting so muuuuuuuch!
On current master:

julia> using GeoMakie
[ Info: Precompiling GeoMakie [db073c08-6b98-4ee5-b6a4-5efafb3259c6]
┌ Warning: The X11 color names with spaces are not recommended because they are not allowed in the SVG/CSS.
│ Use "LightGrey" or "lightgrey" instead.
│   caller = @colorant_str(::LineNumberNode, ::Module, ::Any) at parse.jl:192
└ @ Colors C:\Users\datse\.julia\packages\Colors\P2rUx\src\parse.jl:192
ERROR: LoadError: LoadError: UndefVarError: WilkinsonTicks not defined
Stacktrace:
 [1] getproperty(::Module, ::Symbol) at .\Base.jl:13
 [2] top-level scope at C:\Users\datse\.julia\packages\GeoMakie\BWyYa\src\recipes\geoaxis.jl:17
 [3] include at .\boot.jl:328 [inlined]
 [4] include_relative(::Module, ::String) at .\loading.jl:1105
 [5] include at .\Base.jl:31 [inlined]
 [6] include(::String) at C:\Users\datse\.julia\packages\GeoMakie\BWyYa\src\GeoMakie.jl:1
 [7] top-level scope at C:\Users\datse\.julia\packages\GeoMakie\BWyYa\src\GeoMakie.jl:23
 [8] include at .\boot.jl:328 [inlined]
 [9] include_relative(::Module, ::String) at .\loading.jl:1105
 [10] include(::Module, ::String) at .\Base.jl:31
 [11] top-level scope at none:2
 [12] eval at .\boot.jl:330 [inlined]
 [13] eval(::Expr) at .\client.jl:425
 [14] top-level scope at .\none:3
in expression starting at C:\Users\datse\.julia\packages\GeoMakie\BWyYa\src\recipes\geoaxis.jl:17
in expression starting at C:\Users\datse\.julia\packages\GeoMakie\BWyYa\src\GeoMakie.jl:23
ERROR: Failed to precompile GeoMakie [db073c08-6b98-4ee5-b6a4-5efafb3259c6] to C:\Users\datse\.julia\compiled\v1.3\GeoMakie\GuQif_dccTM.ji.
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1283
 [3] _require(::Base.PkgId) at .\loading.jl:1024
 [4] require(::Base.PkgId) at .\loading.jl:922
 [5] require(::Module, ::Symbol) at .\loading.jl:917

Template for GeoAxis

Until MakieOrg/Makie.jl#1355 is merged, we can use something like this for a GeoAxis:

using GLMakie, GeoMakie
using GeoMakie.GeoInterface
using GeoMakie.GeoJSON
using Proj4

struct GeoAxis
    axis::LScene
    kw
end

function GeoAxis(args...; source = "+proj=longlat +datum=WGS84", dest = "+proj=natearth2", kw...)
    trans = Proj4.Transformation(source, dest, always_xy=true)
    ptrans = Makie.PointTrans{2}(trans)
    ax = LScene(args...; scenekw=(show_axis=false, camera=cam2d!))
    # TODO, pass this to scenekw?!
    ax.scene.transformation.transform_func[] = ptrans
    # here you can draw in any axis grids etc
    return GeoAxis(ax, kw)
end

function bb_transformed(plot::AbstractPlot)
    # Relies on Makie#master 
    # There's definitely also a way to make thise work on tagged Makie...
    bb_ref = Base.RefValue(Rect3f())
    points = Makie.point_iterator(plot)
    t = Makie.transformation(plot)
    model = Makie.model_transform(t)
    trans_func = t.transform_func[]
    Makie.foreach_transformed(points, model, trans_func) do point
        Makie.update_boundingbox!(bb_ref, point)
    end
    return bb_ref[]
end


function Makie.plot!(
        ta::GeoAxis, P::Makie.PlotFunc,
        attributes::Makie.Attributes, args...)
    # Do PlotFunc (Heatmap, Surface, etc) specific overloads here
    p = Makie.plot!(ta.axis.scene, P, attributes, args...)
    # Do custom, GeoAxis specific things like updating the transformed limits
    update_cam!(ta.axis.scene, bb_transformed(p))
    return p
end

# just part of overloading the pipeline... The above is the more generic one!
function Makie.plot!(P::Makie.PlotFunc, ax::GeoAxis, args...; kw_attributes...)
    Makie.plot!(ax, P, Attributes(kw_attributes), args...)
end

fig = Figure()
ax = GeoAxis(fig[1, 1])

lats = -90:10.0:90
lons = -180:10.0:180
lons = collect(lons)
lons[end] = prevfloat(lons[end])  # avoid PROJ wrapping 180 to -180
field = [exp(cosd(l)) + 3(y/90) for l in lons, y in lats]

p = wireframe!(ax, lons, lats, field, color=(:gray, 0.2), transparency=true)
fig

Projections and GeoFormatTypes

JuliaGeo has:

https://github.com/JuliaGeo/GeoFormatTypes.jl

It integrates with ArchGDAL for conversion between projection formats using convert and reprojection of points in any projection format using ArchGDAL.reproject. It handles well known text, proj, epsg, gml and other projection formats without the handling package having to know what they are.

It would be good if we could somehow integrate projections between these packages so that e.g. EPSG projections can be used here.

I'm looking to integrate this with GeoData.jl plotting at some stage. Currently I guess everything could be converted to GeoFormatTypes.ProjString using convert and rewrapped as Projection here? But it might be nice if any projection format just worked.

Released versions don't work on Julia 1.6

My packages that use GeoMakie get various strange errors when running in Julia 1.6, so I went back to basics and decided to try to get the simplest README example working in a new environment. Here's a log of the package installation. Notice when adding Makie that GeoMakie immediately downgrades to v0.1.14 and AbstractPlotting to v0.11.2.

julia> cd("MakieTest")

(@v1.6) pkg> activate .
  Activating new environment at `C:\Stuff\Julia\MakieTest\Project.toml`

(MakieTest) pkg> add GeoMakie
    Updating registry at `C:\Users\niclas\.julia\registries\General`
    Updating git-repo `https://github.com/JuliaRegistries/General.git`
   Resolving package versions...
    Updating `C:\Stuff\Julia\MakieTest\Project.toml`
  [db073c08] + GeoMakie v0.1.15
    Updating `C:\Stuff\Julia\MakieTest\Manifest.toml`
  [621f4979] + AbstractFFTs v1.0.1
  [537997a7] + AbstractPlotting v0.13.11
  [79e6a3ab] + Adapt v3.3.0
  [27a7e980] + Animations v0.4.1
  [4fba245c] + ArrayInterface v3.1.7
  [13072b0f] + AxisAlgorithms v1.0.0
  [fa961155] + CEnum v0.4.1
  [d360d2e6] + ChainRulesCore v0.9.38
  [a2cac450] + ColorBrewer v0.4.0
  [35d6a980] + ColorSchemes v3.12.0
  [3da002f7] + ColorTypes v0.10.12
  [c3611d14] + ColorVectorSpace v0.8.7
  [5ae59095] + Colors v0.12.7
  [34da2185] + Compat v3.27.0
  [d38c429a] + Contour v0.5.7
  [9a962f9c] + DataAPI v1.6.0
  [864edb3b] + DataStructures v0.18.9
  [e2d170a0] + DataValueInterfaces v1.0.0
  [31c24e10] + Distributions v0.24.18
  [ffbed154] + DocStringExtensions v0.8.4
  [5160dea5] + EarCut v2.0.0
  [da5c29d0] + EllipsisNotation v1.1.0
  [c87230d0] + FFMPEG v0.4.0
  [7a1cc6ca] + FFTW v1.4.0
  [5789e2e9] + FileIO v1.7.0
  [1a297f60] + FillArrays v0.11.7
  [53c48c17] + FixedPointNumbers v0.8.4
  [59287772] + Formatting v0.4.2
  [b38be410] + FreeType v3.0.1
  [663a7486] + FreeTypeAbstraction v0.8.4
  [cf35fbd7] + GeoInterface v0.5.5
  [61d90e0f] + GeoJSON v0.5.1
  [db073c08] + GeoMakie v0.1.15
  [5c1252a2] + GeometryBasics v0.3.10
  [c27321d9] + Glob v1.3.0
  [a2bd30eb] + Graphics v1.1.0
  [3955a311] + GridLayoutBase v0.4.1
  [42e2da0e] + Grisu v1.0.0
  [615f187c] + IfElse v0.1.0
  [a09fc81d] + ImageCore v0.8.22
  [82e4d734] + ImageIO v0.3.1
  [6218d12a] + ImageMagick v1.2.1
  [9b13fd28] + IndirectArrays v0.5.1
  [a98d9a8b] + Interpolations v0.13.2
  [8197267c] + IntervalSets v0.5.3
  [f1662d9f] + Isoband v0.1.1
  [c8e1da08] + IterTools v1.3.0
  [82899510] + IteratorInterfaceExtensions v1.0.0
  [692b3bcd] + JLLWrappers v1.3.0
  [682c06a0] + JSON v0.21.1
  [0f8b85d8] + JSON3 v1.8.1
  [5ab0869b] + KernelDensity v0.6.2
  [2ab3a3ac] + LogExpFunctions v0.2.2
  [dbb5928d] + MappedArrays v0.4.0
  [7eb4fadd] + Match v1.1.0
  [e1d29d7a] + Missings v0.4.5
  [e94cdb99] + MosaicViews v0.3.3
  [9526e54e] + NASAEarthObservations v0.1.0
  [77ba4419] + NaNMath v0.3.5
  [510215fc] + Observables v0.3.3
  [6fe1bfb0] + OffsetArrays v1.6.2
  [bac558e1] + OrderedCollections v1.4.0
  [90014a1f] + PDMats v0.11.0
  [f57f5aa1] + PNGFiles v0.3.7
  [19eb6ba3] + Packing v0.4.1
  [5432bcbf] + PaddedViews v0.5.8
  [69de0a69] + Parsers v1.1.0
  [995b91a9] + PlotUtils v1.0.10
  [647866c9] + PolygonOps v0.1.1
  [21216c6a] + Preferences v1.2.1
  [9a7e659c] + Proj4 v0.7.4
  [1fd47b50] + QuadGK v2.4.1
  [c84ed2f1] + Ratios v0.4.0
  [3cdcf5f2] + RecipesBase v1.1.1
  [189a3867] + Reexport v0.2.0
  [ae029012] + Requires v1.1.3
  [79098fc4] + Rmath v0.7.0
  [992d4aef] + Showoff v0.3.2
  [73760f76] + SignedDistanceFields v0.4.0
  [a2af1166] + SortingAlgorithms v0.3.1
  [276daf66] + SpecialFunctions v1.3.0
  [cae243ae] + StackViews v0.1.1
  [aedffcd0] + Static v0.2.4
  [90137ffa] + StaticArrays v1.1.1
  [2913bbd2] + StatsBase v0.33.5
  [4c63d2b9] + StatsFuns v0.9.8
  [09ab397b] + StructArrays v0.4.2
  [856f2bd8] + StructTypes v1.7.2
  [3783bdb8] + TableTraits v1.0.1
  [bd369af6] + Tables v1.4.2
  [1cfade01] + UnicodeFun v0.4.1
  [efce3f68] + WoodburyMatrices v0.5.3
  [6e34b625] + Bzip2_jll v1.0.6+5
  [5ae413db] + EarCut_jll v2.1.5+1
  [b22a6f82] + FFMPEG_jll v4.3.1+4
  [f5851436] + FFTW_jll v3.3.9+7
  [d7e528f0] + FreeType2_jll v2.10.1+5
  [559328eb] + FriBidi_jll v1.0.5+6
  [c73af94c] + ImageMagick_jll v6.9.10-12+3
  [1d5cc7b8] + IntelOpenMP_jll v2018.0.3+2
  [aacddb02] + JpegTurbo_jll v2.0.1+3
  [c1c5ebd0] + LAME_jll v3.100.0+3
  [dd192d2f] + LibVPX_jll v1.9.0+1
  [89763e89] + Libtiff_jll v4.1.0+2
  [856f044c] + MKL_jll v2021.1.1+1
  [e7412a2a] + Ogg_jll v1.3.4+2
  [458c3c95] + OpenSSL_jll v1.1.1+6
  [efe28fd5] + OpenSpecFun_jll v0.5.3+4
  [91d4177d] + Opus_jll v1.3.1+3
  [58948b4f] + PROJ_jll v700.202.100+0
  [f50d1b31] + Rmath_jll v0.3.0+0
  [76ed43ae] + SQLite_jll v3.34.0+0
  [3161d3a3] + Zstd_jll v1.4.8+0
  [9a68df92] + isoband_jll v0.2.2+0
  [0ac62f75] + libass_jll v0.14.0+4
  [f638f0a6] + libfdk_aac_jll v0.1.6+4
  [b53b4c65] + libpng_jll v1.6.37+6
  [f27f6e37] + libvorbis_jll v1.3.6+6
  [1270edf5] + x264_jll v2020.7.14+2
  [dfaa095f] + x265_jll v3.0.0+3
  [0dad84c5] + ArgTools
  [56f22d72] + Artifacts
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8bb1440f] + DelimitedFiles
  [8ba89e20] + Distributed
  [f43a241f] + Downloads
  [b77e0a4c] + InteractiveUtils
  [4af54fe1] + LazyArtifacts
  [b27032c2] + LibCURL
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [a63ad114] + Mmap
  [ca575930] + NetworkOptions
  [44cfe95a] + Pkg
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA
  [9e88b42a] + Serialization
  [1a1011a3] + SharedArrays
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays
  [10745b16] + Statistics
  [4607b0f0] + SuiteSparse
  [fa267f1f] + TOML
  [a4e569a6] + Tar
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  [e66e0078] + CompilerSupportLibraries_jll
  [deac9b47] + LibCURL_jll
  [29816b5a] + LibSSH2_jll
  [c8ffd9c3] + MbedTLS_jll
  [14a3606d] + MozillaCACerts_jll
  [83775a58] + Zlib_jll
  [8e850ede] + nghttp2_jll
  [3f19e933] + p7zip_jll
  Progress [========================================>]  3/3
3 dependencies successfully precompiled in 43 seconds (121 already precompiled)

(MakieTest) pkg> add Makie
   Resolving package versions...
    Updating `C:\Stuff\Julia\MakieTest\Project.toml`
  [db073c08]  GeoMakie v0.1.15  v0.1.14
  [ee78f7c6] + Makie v0.11.0
    Updating `C:\Stuff\Julia\MakieTest\Manifest.toml`
  [537997a7]  AbstractPlotting v0.13.11  v0.11.2
  [4fba245c]  ArrayInterface v3.1.7  v2.14.17
  [49dc2e85] + Calculus v0.5.1
  [d360d2e6] - ChainRulesCore v0.9.38
  [bbf7d656] + CommonSubexpressions v0.3.0
  [01453d9d] + DiffEqDiffTools v1.7.0
  [163ba53b] + DiffResults v1.0.3
  [b552c78f] + DiffRules v1.0.2
  [b4f34e82] + Distances v0.10.2
  [31c24e10]  Distributions v0.24.18  v0.23.8
  [da5c29d0]  EllipsisNotation v1.1.0  v1.0.0
  [c87230d0]  FFMPEG v0.4.0  v0.3.0
  [1a297f60]  FillArrays v0.11.7  v0.8.14
  [f6369f11] + ForwardDiff v0.10.18
  [f7f18e0c] + GLFW v3.4.1
  [38e38edf] + GLM v1.4.1
  [e9467ef8] + GLMakie v0.1.5
  [db073c08]  GeoMakie v0.1.15  v0.1.14
  [5c1252a2]  GeometryBasics v0.3.10  v0.2.15
  [3955a311]  GridLayoutBase v0.4.1  v0.3.7
  [615f187c] - IfElse v0.1.0
  [82e4d734]  ImageIO v0.3.1  v0.2.0
  [a98d9a8b]  Interpolations v0.13.2  v0.12.10
  [f1662d9f] - Isoband v0.1.1
  [5ab0869b]  KernelDensity v0.6.2  v0.5.1
  [d3d80556] + LineSearches v7.1.1
  [4345ca2d] + Loess v0.5.3
  [1914dd2f] + MacroTools v0.5.6
  [ee78f7c6] + Makie v0.11.0
  [5a521ce4] + MakieLayout v0.9.10
  [7269a6da] + MeshIO v0.4.0
  [66fc600b] + ModernGL v1.1.2
  [d41bc354] + NLSolversBase v7.5.0
  [429524aa] + Optim v0.22.0
  [90014a1f]  PDMats v0.11.0  v0.10.1
  [f57f5aa1]  PNGFiles v0.3.7  v0.2.1
  [d96e819e] + Parameters v0.12.2
  [647866c9] - PolygonOps v0.1.1
  [85a6dd25] + PositiveFactorizations v0.2.4
  [9a7e659c]  Proj4 v0.7.4  v0.7.3
  [65257c39] + ShaderAbstractions v0.2.5
  [1277b4bf] + ShiftedArrays v1.0.0
  [276daf66]  SpecialFunctions v1.3.0  v0.10.3
  [aedffcd0] - Static v0.2.4
  [90137ffa]  StaticArrays v1.1.1  v0.12.5
  [65254759] + StatsMakie v0.2.3
  [3eaba693] + StatsModels v0.6.22
  [3a884ed6] + UnPack v1.0.2
  [0656b61e] + GLFW_jll v3.3.3+0
  [d4300ac3] + Libgcrypt_jll v1.8.5+4
  [7e76a0d4] + Libglvnd_jll v1.3.0+3
  [7add5ba3] + Libgpg_error_jll v1.36.0+3
  [94ce4f54] + Libiconv_jll v1.16.0+7
  [58948b4f]  PROJ_jll v700.202.100+0  v7.2.1+0
  [02c8fc9c] + XML2_jll v2.9.11+0
  [aed1982a] + XSLT_jll v1.1.33+4
  [4f6342f7] + Xorg_libX11_jll v1.6.9+4
  [0c0b7dd1] + Xorg_libXau_jll v1.0.9+4
  [935fb764] + Xorg_libXcursor_jll v1.2.0+4
  [a3789734] + Xorg_libXdmcp_jll v1.1.3+4
  [1082639a] + Xorg_libXext_jll v1.3.4+4
  [d091e8ba] + Xorg_libXfixes_jll v5.0.3+4
  [a51aa0fd] + Xorg_libXi_jll v1.7.10+4
  [d1454406] + Xorg_libXinerama_jll v1.1.4+4
  [ec84b674] + Xorg_libXrandr_jll v1.5.2+4
  [ea2f1a96] + Xorg_libXrender_jll v0.9.10+4
  [14d82f49] + Xorg_libpthread_stubs_jll v0.1.0+3
  [c7cfdc94] + Xorg_libxcb_jll v1.13.0+3
  [c5fb5394] + Xorg_xtrans_jll v1.4.0+3
  [9a68df92] - isoband_jll v0.2.2+0
  Progress [========================================>]  7/7
7 dependencies successfully precompiled in 24 seconds (157 already precompiled)

Now trying the README example (for v0.1.14).

julia> using GeoMakie, Makie
┌ Warning: MakieLayout.jl has been absorbed by AbstractPlotting.jl and will not receive any more updates.
│ It is enough to install AbstractPlotting to receive the newest functionality.
│ Visit the Makie docs at http://makie.juliaplots.org/ for more information on how to use it.
└ @ MakieLayout C:\Users\niclas\.julia\packages\MakieLayout\qJ2me\src\MakieLayout.jl:27

julia> lons = LinRange(-179.5, 179.5, 360);  # suppressing output, no problem here
lats = LinRange(-89.5, 89.5, 180);

field = [exp(cosd(l)) + 3(y/90) for l in lons, y in lats];

source = LonLat();
dest = WinkelTripel();

xs, ys = xygrid(lons, lats);
Proj4.transform!(source, dest, vec(xs), vec(ys));

julia> scene = surface(xs, ys; color = field, shading = false, show_axis = false, scale_plot = false)
Error showing value of type Scene:
ERROR: MethodError: no method matching shadertype(::FileIO.File{FileIO.DataFormat{:UNKNOWN}, String})
Closest candidates are:
  shadertype(::GLMakie.GLAbstraction.Shader) at C:\Users\niclas\.julia\packages\GLMakie\wpJsD\src\GLAbstraction\GLShader.jl:63
  shadertype(::FileIO.File{FileIO.DataFormat{:GLSLShader}, Name} where Name) at C:\Users\niclas\.julia\packages\GLMakie\wpJsD\src\GLAbstraction\GLShader.jl:64
  shadertype(::AbstractString) at C:\Users\niclas\.julia\packages\GLMakie\wpJsD\src\GLAbstraction\GLShader.jl:67
Stacktrace:
  [1] compile_shader(path::String, source_str::String)
    @ GLMakie.GLAbstraction ~\.julia\packages\GLMakie\wpJsD\src\GLAbstraction\GLShader.jl:145
  [2] (::GLMakie.GLAbstraction.var"#52#53"{String, Dict{String, String}, Dict{Symbol, Any}})()
    @ GLMakie.GLAbstraction ~\.julia\packages\GLMakie\wpJsD\src\GLAbstraction\GLShader.jl:170
  [3] get!(default::GLMakie.GLAbstraction.var"#52#53"{String, Dict{String, String}, Dict{Symbol, Any}}, h::Dict{String, Vector{String}}, key::String)
    @ Base .\dict.jl:465
  [4] get_template!(path::String, view::Dict{String, String}, attributes::Dict{Symbol, Any})
    @ GLMakie.GLAbstraction ~\.julia\packages\GLMakie\wpJsD\src\GLAbstraction\GLShader.jl:162
  [5] gl_convert(lazyshader::GLMakie.GLAbstraction.LazyShader, data::Dict{Symbol, Any})
    @ GLMakie.GLAbstraction ~\.julia\packages\GLMakie\wpJsD\src\GLAbstraction\GLShader.jl:250
  [6] GLMakie.GLAbstraction.RenderObject(data::Dict{Symbol, Any}, program::GLMakie.GLAbstraction.LazyShader, pre::GLMakie.PostprocessPrerender, post::Nothing, bbs::Observable{GeometryBasics.HyperRectangle{3, Float32}}, main::Nothing)
    @ GLMakie.GLAbstraction ~\.julia\packages\GLMakie\wpJsD\src\GLAbstraction\GLTypes.jl:327
  [7] RenderObject
    @ ~\.julia\packages\GLMakie\wpJsD\src\GLAbstraction\GLTypes.jl:295 [inlined]
  [8] postprocess(color::GLMakie.GLAbstraction.Texture{RGBA{FixedPointNumbers.N0f8}, 2}, position::GLMakie.GLAbstraction.Texture{Vec{4, Float32}, 2}, normal::GLMakie.GLAbstraction.Texture{Vec{3, Float32}, 2}, ssao_noise::GLMakie.GLAbstraction.Texture{Vec{2, Float32}, 2}, occlusion::GLMakie.GLAbstraction.Texture{Float32, 2}, objectid::GLMakie.GLAbstraction.Texture{Vec2{UInt16}, 2}, color_luma::GLMakie.GLAbstraction.Texture{RGBA{FixedPointNumbers.N0f8}, 2}, framebuffer_size::Observable{Tuple{Int64, Int64}})
    @ GLMakie ~\.julia\packages\GLMakie\wpJsD\src\glwindow.jl:92
  [9] GLMakie.GLFramebuffer(fb_size::Tuple{Int64, Int64})
    @ GLMakie ~\.julia\packages\GLMakie\wpJsD\src\glwindow.jl:203
 [10] GLMakie.Screen(; resolution::Tuple{Int64, Int64}, visible::Bool, title::String, kw_args::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ GLMakie ~\.julia\packages\GLMakie\wpJsD\src\screen.jl:316
 [11] Screen
    @ ~\.julia\packages\GLMakie\wpJsD\src\screen.jl:275 [inlined]
 [12] global_gl_screen
    @ ~\.julia\packages\GLMakie\wpJsD\src\screen.jl:346 [inlined]
 [13] global_gl_screen(resolution::Tuple{Int64, Int64}, visibility::Bool, tries::Int64)
    @ GLMakie ~\.julia\packages\GLMakie\wpJsD\src\screen.jl:356
 [14] global_gl_screen
    @ ~\.julia\packages\GLMakie\wpJsD\src\screen.jl:355 [inlined]
 [15] backend_display
    @ ~\.julia\packages\GLMakie\wpJsD\src\gl_backend.jl:57 [inlined]
 [16] display(d::AbstractPlotting.PlotDisplay, scene::Scene)
    @ AbstractPlotting ~\.julia\packages\AbstractPlotting\q9DyS\src\display.jl:45
 [17] display(x::Any)
    @ Base.Multimedia .\multimedia.jl:328
 [18] #invokelatest#2
    @ .\essentials.jl:708 [inlined]
 [19] invokelatest
    @ .\essentials.jl:706 [inlined]
 [20] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Union{Nothing, AbstractDisplay})
    @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:247
 [21] (::REPL.var"#40#41"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
    @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:231
 [22] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:462
 [23] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
    @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:229
 [24] (::REPL.var"#do_respond#61"{Bool, Bool, REPL.var"#72#82"{REPL.LineEditREPL, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
    @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:798
 [25] #invokelatest#2
    @ .\essentials.jl:708 [inlined]
 [26] invokelatest
    @ .\essentials.jl:706 [inlined]
 [27] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\LineEdit.jl:2441
 [28] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:1126
 [29] (::REPL.var"#44#49"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL .\task.jl:406

I can see from the commits that you're in the midst of "starting anew", but could you please first consider releasing a version of the established API that works in Julia 1.6?

Please, stop breaking this package on the main outlets.

Hi @asinghvi17 , please stop pushing directly to the master branch and instead use pull requests that are merged only once it is ensured that the package is at least possible to be using.

Every time I try to load GeoMakie with a distance of more than a week, it is almost guaranteed that the package won't even load. This is an extremely unpleasant experience, and I'd appreciate it so much if it stopped happening.

So, please, please, as far as the master branch and the stable releases go, only push things there if they pass some elementary tests, e.g. that the package can load. It shouldn't be hard to not push PRs that don't even allow using the package.


If the experience of just using this is so frustrating from the very first command (using GeoMakie), it is difficult for users to give feedback and help improve this. You may know the source of this package inside out, but trust me, even something trivial as Top not defined is impossible to fix for someone that has no experience with the source.

Horrible interactive zooming performance

This is likely because of the overly complex tick logic. I wonder if we could split the tick computation into stages, and use async_latest for the tick removal logic? In that case we could theoretically only run the colocation check in the main update code.

transform_func not working

I tried running the example in the readme, and for me it only works if I turn off this line:

https://github.com/JuliaPlots/GeoMakie.jl/blob/a3c333da829ca7446b8d369620454e51ff309f1a/examples/geomakie_new.jl#L16

Otherwise I just get an empty figure.

However then the plot is of course no longer projected and I just get the ugly
image

I'd like to start trying out JuliaGeo/Proj.jl#51 as a replacement for https://github.com/JuliaPlots/GeoMakie.jl/blob/master/src/projections.jl. This should be equivalent:

ax.scene.transformation.transform_func[] = Makie.PointTrans{2}(Proj4.Transformation("+proj=longlat +datum=WGS84", "+proj=wintri +lon_0=0 +lat_1=0 +x_0=0 +y_0=0 +units=m", normalize=true))

Which can be verified with

p = Point2f0(150, -27)

ptrans = GeoMakie.proj(source, dest)
ptrans.f(p)
ptrans.f.([p, p])

ptrans2 = Makie.PointTrans{2}(Proj4.Transformation("+proj=longlat +datum=WGS84", "+proj=wintri +lon_0=0 +lat_1=0 +x_0=0 +y_0=0 +units=m", normalize=true))
ptrans2.f(p)
ptrans2.f.([p, p])

ptrans.f(p) == ptrans2.f(p)  # -> true

But since neither old nor new projection code produces a plot, with no errors, it's a bit hard to figure out what's wrong.

How to shift the central meridian?

My data are in this form, and this is the form I load them, so it can't be changed.

using GeoMakie, Makie, Proj4
lons = 0.5:1:359.5
lats = -89.5:1:89.5
field = [sind(l)^2 + (y/90)^2 for l in lons, y in lats, i in 1:5] # not my actual data, but this will do

my plotting code is:

points = GeoMakie.transform.(WGS84(), dest, GeoMakie.gridpoints(lons, lats))
faces  = GeoMakie.grid_triangle_faces(lons, lats)
colorfunc(i) = vec(field[:, :, i])
scene = poly(points, faces; color = colorfunc(1), show_axis = false)
geoaxis!(scene, -180, 180, -90, 90; crs = (dest = dest,))

which, when run as is gives

image

Now, apparently the way to solve this is to simply do lons .-= 180 because I guess this is what Proj4 prefers (???), which gives correct result:

image

But unfortunately the central meridional (the grinwich one, at 0 longitude) is not at the center of the screen but at the edge. I've tried many different things, but nothing made this possible. How do I "shift" things around, preferably without altering my data, so that the plot turns out as I want it?

Status quo and "release" checklist

Hi, I have some time I can spend for GeoMakiel.jl development. But I haven't been here for >6months so I've lost touch. Could someone give an update of the status quo, and also outline what is remaining to make this library as stable as possible and as suitable for long-term work as possible?

cc @SimonDanisch

Coastlines overwrite

Just reporting this issue on latest master:

julia> using GeoMakie
[ Info: Precompiling GeoMakie [db073c08-6b98-4ee5-b6a4-5efafb3259c6]
WARNING: Method definition coastlines() in module GeoMakie at C:\Users\datse\.julia\packages\AbstractPlotting\3uXXp\src\recipes.jl:152 overwritten at C:\Users\datse\.julia\packages\GeoMakie\sgu5N\src\recipes\stock.jl:21.
  ** incremental compilation may be fatally broken for this module **

WARNING: Method definition coastlines!() in module GeoMakie at C:\Users\datse\.julia\packages\GeoMakie\sgu5N\src\recipes\stock.jl:22 overwritten at C:\Users\datse\.julia\packages\GeoMakie\sgu5N\src\recipes\stock.jl:23.
  ** incremental compilation may be fatally broken for this module **

WARNING: Method definition #coastlines!(Any, typeof(GeoMakie.coastlines!)) in module GeoMakie overwritten.
  ** incremental compilation may be fatally broken for this module **

WARNING: Method definition earth() in module GeoMakie at C:\Users\datse\.julia\packages\AbstractPlotting\3uXXp\src\recipes.jl:152 overwritten at C:\Users\datse\.julia\packages\GeoMakie\sgu5N\src\recipes\stock.jl:62.
  ** incremental compilation may be fatally broken for this module **

WARNING: Method definition earth!() in module GeoMakie at C:\Users\datse\.julia\packages\GeoMakie\sgu5N\src\recipes\stock.jl:63 overwritten at C:\Users\datse\.julia\packages\GeoMakie\sgu5N\src\recipes\stock.jl:64.
  ** incremental compilation may be fatally broken for this module **

WARNING: Method definition #earth!(Any, typeof(GeoMakie.earth!)) in module GeoMakie overwritten.
  ** incremental compilation may be fatally broken for this module **

Cartopy feature list

  • Inline tick labels (for projections like ortho or igh which have singularities at longitudes)
  • Nonlinear clip
  • Square axes with offset tick lines (though this would be more of a Makie thing)
  • Better projection support
  • Automatic projection domain finding

Tissot indicatrix

colors on a mesh maybe? or deformations using decomposed circles (probably better).

Path doesn't contain DeJaVu Sans........????

ERROR: recursion, font path seems to not contain dejavu sans: C:\Users\datse\.julia\packages\AbstractPlotting\3uXXp\src\..\assets\fonts
Stacktrace:
 [1] (::AbstractPlotting.var"#244#245"{AbstractPlotting.Key{:font},String})() at C:\Users\datse\.julia\packages\AbstractPlotting\3uXXp\src\conversions.jl:587
 [2] get!(::AbstractPlotting.var"#244#245"{AbstractPlotting.Key{:font},String}, ::Dict{String,Array{Ptr{FreeType.FT_FaceRec},1}}, ::String) at .\dict.jl:452
 [3] convert_attribute at C:\Users\datse\.julia\packages\AbstractPlotting\3uXXp\src\conversions.jl:579 [inlined]
 [4] to_font at C:\Users\datse\.julia\packages\AbstractPlotting\3uXXp\src\conversions.jl:25 [inlined]     
 [5] plot!(::Annotations{...}) at C:\Users\datse\.julia\packages\AbstractPlotting\3uXXp\src\basic_recipes\basic_recipes.jl:401
 [6] plot!(::GeoAxis{...}, ::Type{Annotations{...}}, ::Attributes, ::Observables.Observable{Array{Tuple{String,GeometryTypes.Point{2,Float32}},1}}) at C:\Users\datse\.julia\packages\AbstractPlotting\3uXXp\src\interfaces.jl:670
 [7] #annotations!#378(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(annotations!), ::GeoAxis{...}, ::Attributes, ::Observables.Observable{Array{Tuple{String,GeometryTypes.Point{2,Float32}},1}}) at C:\Users\datse\.julia\packages\AbstractPlotting\3uXXp\src\recipes.jl:38
 [8] annotations! at C:\Users\datse\.julia\packages\AbstractPlotting\3uXXp\src\recipes.jl:38 [inlined]    
 [9] draw_ticks!(::GeoAxis{...}) at C:\Users\datse\.julia\packages\GeoMakie\sgu5N\src\recipes\geoaxis.jl:280
 [10] plot! at C:\Users\datse\.julia\packages\GeoMakie\sgu5N\src\recipes\geoaxis.jl:125 [inlined]
 [11] plot!(::Scene, ::Type{GeoAxis{...}}, ::Attributes, ::NTuple{4,Observables.Observable{Int64}}, ::Observables.Observable{Tuple{GeometryTypes.HyperRectangle{2,Float32}}}) at C:\Users\datse\.julia\packages\AbstractPlotting\3uXXp\src\interfaces.jl:646
 [12] #plot!#210(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(plot!), 
::Scene, ::Type{GeoAxis{...}}, ::Attributes, ::Int64, ::Vararg{Int64,N} where N) at C:\Users\datse\.julia\packages\AbstractPlotting\3uXXp\src\interfaces.jl:568
 [13] plot!(::Scene, ::Type{GeoAxis{...}}, ::Attributes, ::Int64, ::Int64, ::Int64, ::Vararg{Int64,N} where N) at C:\Users\datse\.julia\packages\AbstractPlotting\3uXXp\src\interfaces.jl:537
 [14] #geoaxis!#28(::Base.Iterators.Pairs{Symbol,NamedTuple{(:src, :dest),Tuple{Projection,Projection}},Tuple{Symbol},NamedTuple{(:crs,),Tuple{NamedTuple{(:src, :dest),Tuple{Projection,Projection}}}}}, ::typeof(geoaxis!), ::Scene, ::Int64, ::Vararg{Int64,N} where N) at C:\Users\datse\.julia\packages\AbstractPlotting\3uXXp\src\recipes.jl:24
 [15] (::GeoMakie.var"#kw##geoaxis!")(::NamedTuple{(:crs,),Tuple{NamedTuple{(:src, :dest),Tuple{Projection,Projection}}}}, ::typeof(geoaxis!), ::Scene, ::Int64, ::Int64, ::Vararg{Int64,N} where N) at .\none:0    
 [16] top-level scope at C:\Users\datse\ownCloud\Science Projects\AlbedoProperties\scripts\plotting\makie_ebaf.jl:32

when I try to do

geoaxis!(scene, -180, 180, -90, 90; crs = (src = source, dest = dest,))

lonlims seems to misbehave

with v0.4.1, the following

f = Figure()
ax = GeoAxis(f[1,1],dest = "+proj=longlat +datum=WGS84 +lon_0=-90.0")
f

gives

Screen Shot 2022-06-20 at 3 08 29 PM

(where the ticks should be on the left hand side)

and

f = Figure()
ax = GeoAxis(f[1,1],dest = "+proj=longlat +datum=WGS84 +lon_0=-90.0",lonlims = (-270, 90))
f

gives

Screen Shot 2022-06-20 at 3 12 48 PM

(where the plot no longer reaches -270 and does not show the ticks on the left)

Example for GeoMakie / Orthodromic vs Loxodromic navigation

Hello,

After following discussion on https://discourse.julialang.org/t/geodesy-how-to-calculate-the-straight-line-distance-between-two-locations-which-is-represented-by-longitude-and-latitude/19984/10 I have just found this project that I missed on https://discourse.julialang.org/search?q=geomakie.

So thanks for building GeoMakie! It seems to be a great project!

Maybe you should create a specific post on Julia discourse to present this project and add link to it from https://discourse.julialang.org/t/plotting-data-on-a-map-in-julia/4655 post.

I also think that creating a Jupyter notebook showing difference between orthodromic navigation (aka great-circle navigation) navigation and loxodromic navigation using GeoMakie could be a nice example to have.

http://ressources.univ-lemans.fr/AccesLibre/UM/Pedago/physique/02/divers/ortholoxo.html
provide such an example.

Be also aware that a lot of maps can be found at https://www.sciencespo.fr/cartographie/khartis/docs/les-fonds-de-carte-disponibles/index.html
https://github.com/AtelierCartographie/Khartis/tree/master/public/data/map

Kind regards

README example broken at geoaxis!() call

My code broke after updating GeoMakie. Not sure what version I had before, but following the README now gives this error with GeoMakie 0.1.7, Makie 0.9.6 and Julia 1.4:

julia> geoaxis!(scene, -180, 180, -90, 90; crs = (src = source, dest = dest,))
ERROR: MethodError: no method matching getindex(::GeometryTypes.HyperRectangle{2,Float32}, ::GridLayoutBase.Left)
Stacktrace:
 [1] (::GeoMakie.var"#36#41"{Observables.Observable{Array{GeometryTypes.Point{2,Float32},1}},Observables.Observable{Array{GeometryTypes.Point{2,Float32},1}},Observables.Observable{Array{GeometryTypes.Point{2,Float32},1}},Observables.Observable{Array{GeometryTypes.Point{2,Float32},1}}})(::GeometryTypes.HyperRectangle{2,Float32}, ::Projection, ::Projection, ::Int64) at C:\Users\niclas\.julia\packages\GeoMakie\2pQ8r\src\recipes\geoaxis.jl:152
 [2] lift(::Function, ::Observables.Observable{GeometryTypes.HyperRectangle{2,Float32}}, ::Observables.Observable{Any}, ::Vararg{Observables.Observable{Any},N} where N) at C:\Users\niclas\.julia\packages\AbstractPlotting\S71fs\src\interaction\nodes.jl:8
 [3] draw_frames!(::GeoAxis{...}) at C:\Users\niclas\.julia\packages\GeoMakie\2pQ8r\src\recipes\geoaxis.jl:150
 [4] plot! at C:\Users\niclas\.julia\packages\GeoMakie\2pQ8r\src\recipes\geoaxis.jl:129 [inlined]
 [5] plot!(::Scene, ::Type{GeoAxis{...}}, ::Attributes, ::NTuple{4,Observables.Observable{Int64}}, ::Observables.Observable{Tuple{GeometryTypes.HyperRectangle{2,Float32}}}) at C:\Users\niclas\.julia\packages\AbstractPlotting\S71fs\src\interfaces.jl:654
 [6] plot!(::Scene, ::Type{GeoAxis{...}}, ::Attributes, ::Int64, ::Vararg{Int64,N} where N; kw_attributes::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\Users\niclas\.julia\packages\AbstractPlotting\S71fs\src\interfaces.jl:576
 [7] plot!(::Scene, ::Type{GeoAxis{...}}, ::Attributes, ::Int64, ::Int64, ::Int64, ::Vararg{Int64,N} where N) at C:\Users\niclas\.julia\packages\AbstractPlotting\S71fs\src\interfaces.jl:545
 [8] geoaxis!(::Scene, ::Int64, ::Vararg{Int64,N} where N; attributes::Base.Iterators.Pairs{Symbol,NamedTuple{(:src, :dest),Tuple{Projection,Projection}},Tuple{Symbol},NamedTuple{(:crs,),Tuple{NamedTuple{(:src, :dest),Tuple{Projection,Projection}}}}}) at C:\Users\niclas\.julia\packages\AbstractPlotting\S71fs\src\recipes.jl:24
 [9] top-level scope at REPL[43]:1
 [10] eval(::Module, ::Any) at .\boot.jl:331
 [11] eval_user_input(::Any, ::REPL.REPLBackend) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\REPL\src\REPL.jl:86
 [12] run_backend(::REPL.REPLBackend) at C:\Users\niclas\.julia\packages\Revise\Pcs5V\src\Revise.jl:1073
 [13] top-level scope at none:0

FR: nonlinear clip

In #56, I noticed that the coastline plot extended beyond the right spine of the axis:

This would require nonlinear clip to be implemented. My current thought is to restrict this to CairoMakie, and create a clip recipe which will be caught by CairoMakie but decomposes to nothing in GLMakie or similar (since I don't know how to do nonlinear clip there).

This will need a good amount of testing, and for the time being the recipe would probably live here, with a Requires hook into CairoMakie.

error during testing

Hello!

Here's the output of doing test GeoMakie in a fresh environment. It's on a server/cluster without OpenGL. Makie is falling back on CairoMakie, so that's perhaps the culprit.

Thanks!

Warning: Loaded OpenGL Backend, but OpenGL isn't working
└ @ GLMakie ~/.julia/packages/GLMakie/tywRm/src/GLMakie.jl:60
OPENGL = false
┌ Warning: No OpenGL detected!  Using CairoMakie instead.
└ @ Main ~/.julia/packages/GeoMakie/4QOPe/test/runtests.jl:8
ERROR: LoadError: could not open file /gpfs/home/dl2594/.julia/packages/MakieGallery/9sGif/examples/geomakie.jl
Stacktrace:
 [1] include at ./boot.jl:328 [inlined]
 [2] include_relative(::Module, ::String) at ./loading.jl:1105
 [3] include at ./Base.jl:31 [inlined]
 [4] include(::String) at /gpfs/home/dl2594/.julia/packages/MakieGallery/9sGif/src/MakieGallery.jl:1
 [5] top-level scope at /gpfs/home/dl2594/.julia/packages/GeoMakie/4QOPe/test/runtests.jl:14
 [6] eval at ./boot.jl:330 [inlined]
 [7] eval at /gpfs/home/dl2594/.julia/packages/MakieGallery/9sGif/src/MakieGallery.jl:1 [inlined]
 [8] load_database(::Array{String,1}) at /gpfs/home/dl2594/.julia/packages/MakieGallery/9sGif/src/MakieGallery.jl:91
 [9] top-level scope at /gpfs/home/dl2594/.julia/packages/GeoMakie/4QOPe/test/runtests.jl:14
 [10] include at ./boot.jl:328 [inlined]
 [11] include_relative(::Module, ::String) at ./loading.jl:1105
 [12] include(::Module, ::String) at ./Base.jl:31
 [13] include(::String) at ./client.jl:424
 [14] top-level scope at none:6
in expression starting at /gpfs/home/dl2594/.julia/packages/GeoMakie/4QOPe/test/runtests.jl:14
ERROR: Package GeoMakie errored during testing
(test) pkg> st
    Status `/mnt/automountdir/gpfs/home/dl2594/GitRepos/test/Project.toml`
  [db073c08] GeoMakie v0.1.3

(test) pkg> st --manifest
    Status `/mnt/automountdir/gpfs/home/dl2594/GitRepos/test/Manifest.toml`
  [85c772de] AbstractNumbers v0.2.1
  [537997a7] AbstractPlotting v0.9.20
  [27a7e980] Animations v0.3.1
  [b99e7846] BinaryProvider v0.5.8
  [6e34b625] Bzip2_jll v1.0.6+1
  [fa961155] CEnum v0.2.0
  [a2cac450] ColorBrewer v0.4.0
  [35d6a980] ColorSchemes v3.6.0
  [3da002f7] ColorTypes v0.9.1
  [c3611d14] ColorVectorSpace v0.8.3
  [5ae59095] Colors v0.11.2
  [34da2185] Compat v2.2.0
  [d38c429a] Contour v0.5.1
  [9a962f9c] DataAPI v1.1.0
  [864edb3b] DataStructures v0.17.9
  [e2d170a0] DataValueInterfaces v1.0.0
  [ffbed154] DocStringExtensions v0.8.1
  [5160dea5] EarCut v1.1.0
  [da5c29d0] EllipsisNotation v0.4.0
  [c87230d0] FFMPEG v0.2.4
  [5789e2e9] FileIO v1.2.2
  [53c48c17] FixedPointNumbers v0.7.1
  [59287772] Formatting v0.4.1
  [b38be410] FreeType v3.0.0
  [d7e528f0] FreeType2_jll v2.10.1+1
  [663a7486] FreeTypeAbstraction v0.5.0
  [cf35fbd7] GeoInterface v0.5.3
  [61d90e0f] GeoJSON v0.5.1
  [db073c08] GeoMakie v0.1.3
  [4d00f742] GeometryTypes v0.7.7
  [c27321d9] Glob v1.2.0
  [a2bd30eb] Graphics v1.0.1
  [a09fc81d] ImageCore v0.8.11
  [6218d12a] ImageMagick v1.1.2
  [c73af94c] ImageMagick_jll v6.9.10-12+0
  [8197267c] IntervalSets v0.4.0
  [82899510] IteratorInterfaceExtensions v1.0.0
  [682c06a0] JSON v0.21.0
  [0f8b85d8] JSON3 v1.0.1
  [aacddb02] JpegTurbo_jll v2.0.1+0
  [89763e89] Libtiff_jll v4.0.10+0
  [5a521ce4] MakieLayout v0.2.16
  [dbb5928d] MappedArrays v0.2.2
  [7eb4fadd] Match v1.1.0
  [e1d29d7a] Missings v0.4.3
  [9526e54e] NASAEarthObservations v0.1.0
  [77ba4419] NaNMath v0.3.3
  [510215fc] Observables v0.2.3
  [6fe1bfb0] OffsetArrays v1.0.2
  [efe28fd5] OpenSpecFun_jll v0.5.3+1
  [bac558e1] OrderedCollections v1.1.0
  [19eb6ba3] Packing v0.3.0
  [5432bcbf] PaddedViews v0.5.1
  [69de0a69] Parsers v0.3.11
  [995b91a9] PlotUtils v0.6.3
  [9a7e659c] Proj4 v0.6.0
  [3cdcf5f2] RecipesBase v0.8.0
  [189a3867] Reexport v0.2.0
  [ae029012] Requires v1.0.1
  [992d4aef] Showoff v0.3.1
  [73760f76] SignedDistanceFields v0.4.0
  [a2af1166] SortingAlgorithms v0.3.1
  [276daf66] SpecialFunctions v0.10.0
  [90137ffa] StaticArrays v0.12.1
  [2913bbd2] StatsBase v0.32.1
  [09ab397b] StructArrays v0.4.2
  [856f2bd8] StructTypes v1.0.2
  [3783bdb8] TableTraits v1.0.0
  [bd369af6] Tables v1.0.1
  [1cfade01] UnicodeFun v0.4.0
  [83775a58] Zlib_jll v1.2.11+8
  [3161d3a3] Zstd_jll v1.4.4+0
  [b53b4c65] libpng_jll v1.6.37+2
  [2a0f44e3] Base64
  [ade2ca70] Dates
  [8bb1440f] DelimitedFiles
  [8ba89e20] Distributed
  [b77e0a4c] InteractiveUtils
  [76f85450] LibGit2
  [8f399da3] Libdl
  [37e2e46d] LinearAlgebra
  [56ddb016] Logging
  [d6f4376e] Markdown
  [a63ad114] Mmap
  [44cfe95a] Pkg
  [de0858da] Printf
  [3fa0cd96] REPL
  [9a3f8284] Random
  [ea8e919c] SHA
  [9e88b42a] Serialization
  [1a1011a3] SharedArrays
  [6462fe0b] Sockets
  [2f01184e] SparseArrays
  [10745b16] Statistics
  [8dfed614] Test
  [cf7118a7] UUIDs
  [4ec0a83e] Unicode



(test) > versioninfo()
Julia Version 1.3.1
Commit 2d5741174c (2019-12-30 21:36 UTC)
Platform Info:
  OS: Linux (x86_64-redhat-linux)
  CPU: Intel(R) Xeon(R) Gold 6150 CPU @ 2.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 16

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.