MakieOrg / GeoMakie.jl

Geographical plotting utilities for Makie.jl
https://geo.makie.org
MIT License
167 stars 24 forks source link

{x,y}autolimits=false breaks example #166

Closed filchristou closed 3 months ago

filchristou commented 1 year ago

I took the example of the italian map visualization and added xautolimits=false, yautolimits=false, and it doesn't work.

let
    it_states = Downloads.download("https://github.com/openpolis/geojson-italy/raw/master/geojson/limits_IT_provinces.geojson")
    geo = GeoJSON.read(read(it_states, String))

    fig = Figure()
    ga = GeoAxis(fig[1, 1]; dest = "+proj=ortho +lon_0=12.5 +lat_0=42", lonlims=(12, 13), latlims = (40, 44))
    poly!(ga, geo; strokecolor = :blue, strokewidth = 1, color = (:blue, 0.5), shading = false, xautolimits=false, yautolimits=false);
    datalims!(ga)

    fig
end

image

Reproducibility Julia Version 1.8.5 Commit 17cfb8e65ea (2023-01-08 06:45 UTC) Platform Info: OS: Linux (x86_64-linux-gnu) CPU: 12 × 12th Gen Intel(R) Core(TM) i5-1235U WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-13.0.1 (ORCJIT, goldmont) Threads: 6 on 12 virtual cores Environment: JULIA_REVISE_WORKER_ONLY = 1 Status /tmp/jl_QxKbHf/Project.toml [13f3f980] CairoMakie v0.10.4 [db073c08] GeoMakie v0.5.0
asinghvi17 commented 3 months ago

Huh, this now just goes on infinitely for me, not sure why.

asinghvi17 commented 3 months ago

Updated syntax + geometry source that doesn't cause freezing:

using GeoMakie, CairoMakie, GADM
ita = GADM.get("ITA"; depth = 1)
fig = Figure()
ga = GeoAxis(fig[1, 1]; dest = "+proj=ortho +lon_0=12.5 +lat_0=42", limits = ((12, 13), (40, 44)))
poly!(ga, GeoMakie.to_multipoly(ita.geom); xautolimits = false, yautolimits = false)
fig

download-1 This looks correct to me, closing the issue!