# GeoIO plotting in a map

**URL:** <https://discourse.julialang.org/t/geoio-plotting-in-a-map/118982>\
**Category:** New to Julia\
**Tags:** geo, geostats, geoio\
**Created:** [September 3, 2024, 9:50am UTC](https://discourse.julialang.org/t/geoio-plotting-in-a-map/118982 "2024-09-03T09:50:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![imantha](https://avatars.discourse-cdn.com/v4/letter/i/6a8cbe/32.png) [@imantha](https://discourse.julialang.org/u/imantha)\
**Post date:** [September 3, 2024, 9:50am UTC](https://discourse.julialang.org/t/geoio-plotting-in-a-map/118982/1 "2024-09-03T09:50:35Z")

</div>

I am wondering if there is a possibility to plot a shapefile loaded using GeoIO in map ?

```julia
using GeoIO
df_lo = GeoIO.load("data/processed/low/us_division_2018/us_division_2018.shp")
df_hi = GeoIO.load("data/processed/high/us_state_2018/us_state_2018.shp")

```

Here is the python code to do it …

```julia
df_lo = gpd.read_file("data/processed/low/us_division_2018/us_division_2018.shp")
df_hi = gpd.read_file("data/processed/high/us_state_2018/us_state_2018.shp")

fig, (ax1, ax2) = plt.subplots(ncols = 2, sharex = True, sharey = True)
df_lo.plot(ax = ax1, column = "area")
df_hi.plot(ax = ax2, column = "area")
fig.set_figheight(20)
fig.set_figwidth(20)
ax1.set_title("Low Resolution Boundaries")
ax2.set_title("High Resolution Boundaries")
plt.show()

```

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

---

<div class="post-metadata">

**Author:** ![TimG](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@TimG](https://discourse.julialang.org/u/TimG)\
**Post date:** [September 3, 2024, 11:02am UTC](https://discourse.julialang.org/t/geoio-plotting-in-a-map/118982/2 "2024-09-03T11:02:49Z")

</div>

You might like to check out [Visualization · GeoStats.jl (juliaearth.github.io)](https://juliaearth.github.io/GeoStatsDocs/stable/visualization/).

---

<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:** [September 3, 2024, 11:07am UTC](https://discourse.julialang.org/t/geoio-plotting-in-a-map/118982/3 "2024-09-03T11:07:59Z")

</div>

Thank you @TimG for sharing the docs.

@imantha you may also find the book useful:

[https://juliaearth.github.io/geospatial-data-science-with-julia](https://juliaearth.github.io/geospatial-data-science-with-julia)

---

<div class="post-metadata">

**Author:** ![TimG](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@TimG](https://discourse.julialang.org/u/TimG)\
**Post date:** [September 3, 2024, 11:52am UTC](https://discourse.julialang.org/t/geoio-plotting-in-a-map/118982/4 "2024-09-03T11:52:49Z")

</div>

Using a UK-based shapefile from ONS: [Local Authority Districts (December 2023) Boundaries UK BFC](https://geoportal.statistics.gov.uk/datasets/127c4bda06314409a1fa0df505f510e6_0/explore:)

```julia
using GeoStats, GeoIO
import CairoMakie as Mke
plotdf = GeoIO.load("LAD_DEC_2023_UK_BGC.shp")
fig = Mke.Figure()
ax2 = Mke.Axis(fig[1, 1], aspect=Mke.DataAspect())
viz!(ax2, plotdf.geometry, color=1:nrow(plotdf), colormap=:lajolla)
Mke.display(fig)

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/8/0/8052a36d41a7577af8d1b4cd55e6fadc6f777088.png)

You can control every aspect of the plot’s appearance in [Makie](https://docs.makie.org/v0.21/).

---

<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:** [September 3, 2024, 11:59am UTC](https://discourse.julialang.org/t/geoio-plotting-in-a-map/118982/5 "2024-09-03T11:59:40Z")

</div>

And if you need US boundaries from an open database, check GeoArtifacts.jl:

> [@\[ANN\] GeoArtifacts.jl - Artifacts for Geospatial Data Science in Julia](https://discourse.julialang.org/t/ann-geoartifacts-jl-artifacts-for-geospatial-data-science-in-julia/114508/2):
>
> GeoArtifacts.jl v1.1 This release comes with a complete refactor of the internals to benefit from the various repairs of geometries implemented in GeoIO.jl. The NaturalEarth submodule is very comprehensive now, allowing users to download all sorts of datasets with clean syntax. Below is an example where we create a 3D visualization with a “raster” of the Earth, country borders, airports and water ports: using GeoStats using GeoArtifacts import GLMakie as Mke # download artifacts from natura…
