Plotting in GeoStats

Thank you @TimG for another useful example.

I believe @technocrat is expecting LatLon coordinates to show in a 2D axis. He also has expections about the axis itself like labels showing latitude and longitude as opposed to the actual projected coordinate system.

Regarding the first expectation, it is simply a misunderstanding caused by legacy software. LatLon values are angles in a 3D ellipsoid. They can be (incorrectly) treated as 2D Cartesian coordinates for plotting purposes using the Plate-Carree coordinate system. This is achived by sending the geotable to a

geotable |> Proj(PlateCarree)

See Equirectangular projection - Wikipedia Equirectangular projection - Wikipedia

Regarding the second expectation, that is a feature of the Makie.jl axis itself, not a feature of the data. He is familiar with the custom axis provided in GeoMakie.jl and there is no issue in using it with our viz recipes. The downside is that this axis is implemented with the C PROJ library and strings, a dependency we can’t afford. We have plans to provide similar axis functionality in native Julia in the future.

In the meantime, you can simply create your GeoAxis as usual and then call viz to add the data to it.

1 Like

For those interested, https://gist.github.com/technocrat/96679a50eaceecc6ceda88353383216c is a transcript of my experience.

1 Like

Notice that your environment is polluted with old versions of packages. Try running the commands in a fresh environment with the latest version of GeoStats.jl, GeoIO.jl and a Makie.jl backend.

A couple of observations:

  1. GeoIO.jl loads GeoTable.jl objects. If you need to use nrow or similar functions with geotables, you just need to load that package, or the full GeoStats.jl stack as you did to bring these functions into scope.
  2. If you are seeing any warning during precompilation, then that is a sign that your environment has old packages mixed with newer ones. The specific warnings you are seeing seem to be caused by yet another setback in JuliaGeo to cope with bad design decisions.
  3. If you end up opting for GeoStats.jl in your work, I highly recommend sticking to the packages that are part of the project. Any addition of third-party packages may hold you from the latest versions.
  4. Anytime we release a new version of the project, we make sure that our entire software stack is up-to-date with 0 warnings. We also update the GDSJL book to make sure that things are working as expected besides the extensive tests we run for every module.

If you can pin point specific issues that you think deserve more attention, we can take a look. I suggest a new thread on Discourse or Zulip to avoid expanding the scope of this current thread further.

As shown in the transcript it was run under

julia> Pkg.status()
Project testbed v0.1.0
Status `~/projects/testbed/Project.toml`
  [336ed68f] CSV v0.10.15
  [13f3f980] CairoMakie v0.15.4
  [e9467ef8] GLMakie v0.13.4
  [5752ebe1] GMT v1.31.0
  [db073c08] GeoMakie v0.7.15
  [dcc97b0b] GeoStats v0.81.2
  [e502b557] GeoTables v1.24.19
  [e6f89c97] LoggingExtras v1.1.0
  [56ddb016] Logging v1.11.0

Package Latest Stable Version (as of 2025-07-27)
according to repo Package.toml files, checked by hand

  • CSV v0.10.15 :check_mark:
  • CairoMakie v0.15.4 :check_mark:
  • GLMakie Managed v0.13.4 :check_mark:
  • GMT v1.31.0 v1.31.0 :check_mark:
  • GeoMakie 0.7.15 :check_mark:
  • GeoStats v0.81.2 :check_mark:
  • GeoTables v1.24.19 :check_mark:
  • LoggingExtras v1.1.0 :check_mark:

Your shared environment above doesn’t have GeoIO.jl, yet your transcript has it. Something is off. Please double check the environment and try again. You shouldn’t see warnings in a fresh environment.

I started with a clean environment with just GeoIO.jl, GeoStats.jl, CairoMakie.jl and Makie.jl installed.

I added each of the extra packages @technocrat has one at a time and tried to recreate the chloropleth map. I never encountered any difficulty at all. In the end, I had:

pkg> st
Status `C:\Users\tim\OneDrive\Documents\Julia\chloropleth-usa\Project.toml`
  [336ed68f] CSV v0.10.15
  [13f3f980] CairoMakie v0.15.4
  [e9467ef8] GLMakie v0.13.4
  [5752ebe1] GMT v1.31.0
  [f5a160d5] GeoIO v1.20.7
  [db073c08] GeoMakie v0.7.15
  [dcc97b0b] GeoStats v0.81.2
  [e502b557] GeoTables v1.24.19
  [ee78f7c6] Makie v0.24.4

pkg> add LoggingExtras
   Resolving package versions...
    Updating `C:\Users\tim\OneDrive\Documents\Julia\chloropleth-usa\Project.toml`
  [e6f89c97] + LoggingExtras v1.1.0
  No Changes to `C:\Users\tim\OneDrive\Documents\Julia\chloropleth-usa\Manifest.toml`

and

julia> versioninfo()
Julia Version 1.11.6
Commit 9615af0f26 (2025-07-09 12:58 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 24 × AMD Ryzen 9 9900X 12-Core Processor
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, generic)
Threads: 8 default, 0 interactive, 4 GC (on 24 virtual cores)
Environment:
  JULIA_EDITOR = code
  JULIA_VSCODE_REPL = 1
  JULIA_NUM_THREADS = 8

Everything just worked. I don’t think a polluted environment can be the source of @technocrat’s issues unless something is not visible here. The only difference I can see is I have GeoIO.jl and Makie.jl explicitly listed and they don’t.

1 Like

I started afresh and hung for 10 minutes before pulling the plug on @display(). Perhaps a macOS artifact. I’ll try again on ubuntu and windows once I set that up.

1 Like

If you encounter a real performance issue, please report and we can take a look. We improve performance upon demand.

1 Like