# Plotting polygons defined in degrees

**URL:** <https://discourse.julialang.org/t/plotting-polygons-defined-in-degrees/137556>\
**Category:** Visualization\
**Created:** [June 11, 2026, 8:29am UTC](https://discourse.julialang.org/t/plotting-polygons-defined-in-degrees/137556 "2026-06-11T08:29:40Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mastomaki](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@Mastomaki](https://discourse.julialang.org/u/Mastomaki)\
**Post date:** [June 11, 2026, 8:29am UTC](https://discourse.julialang.org/t/plotting-polygons-defined-in-degrees/137556/1 "2026-06-11T08:29:40Z")

</div>

I’m trying to plot the polygons from GADM.jl. I do the following:

```julia-auto
using GeoTables
using GeoArtifacts
using Countries
using DataFrames
using Meshes
using GLMakie 
using GeoMakie

> gdf = GADM.get("FIN"; level=0)
> p = reduce(vcat, gdf.geometry)
> typeof(p.geoms[1])
 PolyArea{🌐, CoordRefSystems.GeodeticLatLon{CoordRefSystems.WGS84Latest, Unitful.Quantity{Float64, NoDims, Unitful.FreeUnits{(°,), NoDims, nothing}}}, Ring{🌐, CoordRefSystems.GeodeticLatLon{CoordRefSystems.WGS84Latest, Unitful.Quantity{Float64, NoDims, Unitful.FreeUnits{(°,), NoDims, nothing}}}, CircularArrays.CircularVector{Meshes.Point{🌐, CoordRefSystems.GeodeticLatLon{CoordRefSystems.WGS84Latest, Unitful.Quantity{Float64, NoDims, Unitful.FreeUnits{(°,), NoDims, nothing}}}}, Vector{Meshes.Point{🌐, CoordRefSystems.GeodeticLatLon{CoordRefSystems.WGS84Latest, Unitful.Quantity{Float64, NoDims, Unitful.FreeUnits{(°,), NoDims, nothing}}}}}}}, Vector{Ring{🌐, CoordRefSystems.GeodeticLatLon{CoordRefSystems.WGS84Latest, Unitful.Quantity{Float64, NoDims, Unitful.FreeUnits{(°,), NoDims, nothing}}}, CircularArrays.CircularVector{Meshes.Point{🌐, CoordRefSystems.GeodeticLatLon{CoordRefSystems.WGS84Latest, Unitful.Quantity{Float64, NoDims, Unitful.FreeUnits{(°,), NoDims, nothing}}}}, Vector{Meshes.Point{🌐, CoordRefSystems.GeodeticLatLon{CoordRefSystems.WGS84Latest, Unitful.Quantity{Float64, NoDims, Unitful.FreeUnits{(°,), NoDims, nothing}}}}}}}}}

```

This is not plottable by **viz!()** (from Meshes.jl I believe). Simply nothing is plotted. I can plot PolyAreas when the coordinates are plain numbers, not (:lat, :lon) tuples in degree units.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [June 11, 2026, 9:25am UTC](https://discourse.julialang.org/t/plotting-polygons-defined-in-degrees/137556/2 "2026-06-11T09:25:40Z")

</div>

Check [Optimize visualization of non-Euclidean geometries and domains · Issue #1367 · JuliaGeometry/Meshes.jl · GitHub](https://github.com/JuliaGeometry/Meshes.jl/issues/1367) for additional information.

The current workaround is to project the spherical geometries into “flat” Euclidean geometries before plotting, and that is already optimized:

```julia
julia> using GeoStats

julia> using GeoArtifacts

julia> import GLMakie as Mke

julia> gtb = GADM.get("FIN")
               1×3 GeoTable over 1 GeometrySet
┌─────────────┬─────────────┬───────────────────────────────┐
│ GID_0 │ COUNTRY │ geometry │
│ Categorical │ Categorical │ MultiPolygon │
│ [NoUnits] │ [NoUnits] │ 🖈 GeodeticLatLon{WGS84Latest} │
├─────────────┼─────────────┼───────────────────────────────┤
│ FIN │ Finland │ Multi(2879×PolyArea) │
└─────────────┴─────────────┴───────────────────────────────┘

julia> ptb = gtb |> Proj(Robinson)
            1×3 GeoTable over 1 GeometrySet
┌─────────────┬─────────────┬─────────────────────────┐
│ GID_0 │ COUNTRY │ geometry │
│ Categorical │ Categorical │ MultiPolygon │
│ [NoUnits] │ [NoUnits] │ 🖈 Robinson{WGS84Latest} │
├─────────────┼─────────────┼─────────────────────────┤
│ FIN │ Finland │ Multi(2879×PolyArea) │
└─────────────┴─────────────┴─────────────────────────┘

julia> viewer(ptb)

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/4/3/43ace380bd5bf40d439358a403f0458f5141250e.png)

If you have the time and skill to contribute, please reach out in our community channels.

---

<div class="post-metadata">

**Author:** ![Mastomaki](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@Mastomaki](https://discourse.julialang.org/u/Mastomaki)\
**Post date:** [June 11, 2026, 1:35pm UTC](https://discourse.julialang.org/t/plotting-polygons-defined-in-degrees/137556/3 "2026-06-11T13:35:43Z")

</div>

Ok this works. Although the color is not what I expected.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/a/7/a7f4d0c44dfc242260b92e9942b721e7c1ea7aca.png)

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [June 11, 2026, 2:17pm UTC](https://discourse.julialang.org/t/plotting-polygons-defined-in-degrees/137556/4 "2026-06-11T14:17:16Z")

</div>

Please share the script used, otherwise it is impossible to debug. The color is assigned by the `viewer` or you can specify it with the lower level `viz` function.

I highly recommend reading the GDSJL book:

> **[Geospatial Data Science with Julia](https://juliaearth.github.io/geospatial-data-science-with-julia/)**

---

<div class="post-metadata">

**Author:** ![mihalybaci](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mihalybaci/32/13528_2.png) [@mihalybaci](https://discourse.julialang.org/u/mihalybaci)\
**Post date:** [June 11, 2026, 2:48pm UTC](https://discourse.julialang.org/t/plotting-polygons-defined-in-degrees/137556/5 "2026-06-11T14:48:09Z")

</div>

Another simple way to plot this is

```julia-auto
using DataFrames
using GADM
using GeoMakie
using CairoMakie # Or GLMakie should work
gdf = GADM.get("FIN"; depth=0) |> DataFrame

fig = Figure()
ga = GeoAxis(fig[1, 1]; dest="+proj=eqdc +datum=WGS84 +lat_1=60 +lat_2=71")
poly!(ga, gdf.geom; color=:blue, strokecolor=:darkblue, strokewidth=1, shading=NoShading)
fig

```

---

<div class="post-metadata">

**Author:** ![Mastomaki](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@Mastomaki](https://discourse.julialang.org/u/Mastomaki)\
**Post date:** [June 11, 2026, 3:58pm UTC](https://discourse.julialang.org/t/plotting-polygons-defined-in-degrees/137556/6 "2026-06-11T15:58:09Z")

</div>

Here is the code:

> using GeoTables  
> using GeoArtifacts  
> using Countries  
> using DataFrames  
> using Meshes  
> using GLMakie  
> using GeoMakie  
> using GeoStats  
> p = GADM.get(“FIN”, level = 0)  
> viz(p.geometry |\> Meshes.Proj(Mercator), color = :blue)

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [June 11, 2026, 4:42pm UTC](https://discourse.julialang.org/t/plotting-polygons-defined-in-degrees/137556/7 "2026-06-11T16:42:02Z")

</div>

> [@Mastomaki](#):
>
> viz(p.geometry |\> Meshes.Proj(Mercator), color = :blue)

I cannot reproduce the issue:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/1/6/16bfb228ae123023df3532af1525c900985f247e.png)

Notice that `GADM.get` doesn’t have a `level` option. You’re probably confusing the GADM.jl package that we used to maintain in the past with the new `GeoArtifacts.GADM` submodule.

Please remove all imports from other stacks to avoid confusion. All you need is GeoStats.jl, GeoArtifacts.jl and a Makie.jl backend.

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [June 11, 2026, 5:09pm UTC](https://discourse.julialang.org/t/plotting-polygons-defined-in-degrees/137556/8 "2026-06-11T17:09:03Z")

</div>

> [@mihalybaci](#):
>
> Another simple way to plot this is

And another even simpler is

```julia-auto
using GMT

data = gadm("IND");
viz(data, proj=:guess)

```

 ![GMTjl_j](https://global.discourse-cdn.com/julialang/original/3X/c/6/c6cf637d5944f94d90e9b8cfeac16f96cd8a7faa.png)

---

<div class="post-metadata">

**Author:** ![Mastomaki](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@Mastomaki](https://discourse.julialang.org/u/Mastomaki)\
**Post date:** [June 11, 2026, 5:36pm UTC](https://discourse.julialang.org/t/plotting-polygons-defined-in-degrees/137556/9 "2026-06-11T17:36:05Z")

</div>

gadm() is different from GADM.get()? Why we need not the Proj() function in this case?

---

<div class="post-metadata">

**Author:** ![Mastomaki](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@Mastomaki](https://discourse.julialang.org/u/Mastomaki)\
**Post date:** [June 11, 2026, 5:41pm UTC](https://discourse.julialang.org/t/plotting-polygons-defined-in-degrees/137556/10 "2026-06-11T17:41:28Z")

</div>

Ok, it seems to be `depth` instead. The color problem seems to be specific to GLMakie, not CairoMakie. And colored fills, not grey ones.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [June 11, 2026, 6:25pm UTC](https://discourse.julialang.org/t/plotting-polygons-defined-in-degrees/137556/11 "2026-06-11T18:25:32Z")

</div>

Are you using llvmpipe? That’s known to cause color issues

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [June 11, 2026, 6:28pm UTC](https://discourse.julialang.org/t/plotting-polygons-defined-in-degrees/137556/12 "2026-06-11T18:28:56Z")

</div>

> [@Mastomaki](#):
>
> The color problem seems to be specific to GLMakie

Notice that I used GLMakie.jl in my machine, so the problem is not there.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [June 11, 2026, 6:29pm UTC](https://discourse.julialang.org/t/plotting-polygons-defined-in-degrees/137556/13 "2026-06-11T18:29:21Z")

</div>

It could be machine-specific as @jules pointed out.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [June 11, 2026, 6:32pm UTC](https://discourse.julialang.org/t/plotting-polygons-defined-in-degrees/137556/14 "2026-06-11T18:32:30Z")

</div>

> [@Mastomaki](#):
>
> gadm() is different from GADM.get()? Why we need not the Proj() function in this case?

This is a different function from the GMT.jl package, which is a wrapper to an external library (not written in Julia). Unfortunately they decided to call their command `viz` after we picked that name, so users get even more confused.

Notice that they call `proj=:guess` as well. GMT doesn’t support interactive 3D scenes nor spherical geometries as we do.

---

<div class="post-metadata">

**Author:** ![Mastomaki](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@Mastomaki](https://discourse.julialang.org/u/Mastomaki)\
**Post date:** [June 12, 2026, 9:26am UTC](https://discourse.julialang.org/t/plotting-polygons-defined-in-degrees/137556/15 "2026-06-12T09:26:26Z")

</div>

Yes I am.
