# Geopandas equivalent?

**URL:** <https://discourse.julialang.org/t/geopandas-equivalent/66262>\
**Category:** New to Julia\
**Tags:** geo, gmt\
**Created:** [August 12, 2021, 11:40am UTC](https://discourse.julialang.org/t/geopandas-equivalent/66262 "2021-08-12T11:40:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![CompulsoryCoffee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/compulsorycoffee/32/30434_2.png) [@CompulsoryCoffee](https://discourse.julialang.org/u/CompulsoryCoffee)\
**Post date:** [August 12, 2021, 11:40am UTC](https://discourse.julialang.org/t/geopandas-equivalent/66262/1 "2021-08-12T11:40:43Z")

</div>

Hi,

I am looking for an equivalent to Geopandas in Julia to load shapefiles as dataframes.

I read about GeoDataFrames.jl but I am having trouble installing it, giving me this error message:

```julia
(@v1.6) pkg> add GeoDataFrames
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package GeoStatsBase [323cb8eb]:

```

As a bonus question (should probably be a different topic), any package that could plot those shapefiles with a base map (Google map, OSM etc.) would be great

Thanks!  
Alex

---

<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:** [August 12, 2021, 11:58am UTC](https://discourse.julialang.org/t/geopandas-equivalent/66262/2 "2021-08-12T11:58:57Z")

</div>

> [@CompulsoryCoffee](#):
>
> As a bonus question (should probably be a different topic), any package that could plot those shapefiles with a base map (Google map, OSM etc.) would be great

[GMT.jl](https://github.com/GenericMappingTools/GMT.jl). Plots shapefiles directly over georeferenced images but no particular interface with OSM.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [August 12, 2021, 1:24pm UTC](https://discourse.julialang.org/t/geopandas-equivalent/66262/3 "2021-08-12T13:24:19Z")

</div>

It looks like you’re installing all your packages in the default environment - don’t do this, as it will likely lead to compat issues (as you see) between packages you don’t actually need at the same time, and you’re foregoing the reproducibility benefits of Julia’s lightweight environments and their associated Project and Manifest toml files.

So in short make a folder for the analysis you’re looking to do, activate an environment in that folder, and add the packages you need (in this case it looks like GeoDataFrames and GMT). if that still doesn’t work post the whole error here and we’ll see what we can do.

---

<div class="post-metadata">

**Author:** ![CompulsoryCoffee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/compulsorycoffee/32/30434_2.png) [@CompulsoryCoffee](https://discourse.julialang.org/u/CompulsoryCoffee)\
**Post date:** [August 12, 2021, 1:47pm UTC](https://discourse.julialang.org/t/geopandas-equivalent/66262/4 "2021-08-12T13:47:10Z")

</div>

Thank you for the quick reply

It is a lot cleaner indeed and the installation worked.  
I tried this and got an error message:

```julia
using GMT, DataFrames, CSV
using GeoDataFrames; const GDF=GeoDataFrames

pts = GDF.read("pts.shp")

```

```julia
ERROR: LoadError: could not load library ""
dlopen(.dylib, 1): image not found
Stacktrace:
 [1] gdalopenex(pszFilename::String, nOpenFlags::Int64, papszAllowedDrivers::Ptr{Cstring}, papszOpenOptions::Ptr{Cstring}, papszSiblingFiles::Ptr{Cstring})
   @ GDAL ~/.julia/packages/GDAL/5CClC/src/gdal_h.jl:472
 [2] #read#139
   @ ~/.julia/packages/ArchGDAL/erkjx/src/dataset.jl:441 [inlined]
 [3] read
   @ ~/.julia/packages/ArchGDAL/erkjx/src/dataset.jl:441 [inlined]
 [4] read(fn::String; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ GeoDataFrames ~/.julia/packages/GeoDataFrames/43O9q/src/io.jl:40
 [5] read(fn::String)
   @ GeoDataFrames ~/.julia/packages/GeoDataFrames/43O9q/src/io.jl:40
 [6] top-level scope
   @ ~/Documents/Github/Sajag_Nepal/flowR_model/Display_shapefile_and_output_csv.jl:4
in expression starting at /Users/alexdunant/Documents/Github/Sajag_Nepal/flowR_model/Display_shapefile_and_output_csv.jl:4

```

Thanks joa-quim - GMT looks pretty great for nice looking maps!

---

<div class="post-metadata">

**Author:** ![visr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/visr/32/17204_2.png) [@visr](https://discourse.julialang.org/u/visr)\
**Post date:** [August 12, 2021, 2:38pm UTC](https://discourse.julialang.org/t/geopandas-equivalent/66262/5 "2021-08-12T14:38:00Z")

</div>

> [@CompulsoryCoffee](#):
>
> ```julia
> ERROR: LoadError: could not load library ""
> dlopen(.dylib, 1): image not found
> 
> ```

This is odd, why is the library string here empty? Is this using the latest GDAL.jl? Perhaps it’s good to file an issue at the GDAL.jl repo, with the output of `] st -m` and your `versioninfo()`.

Meanwhile you could also try out [GitHub - JuliaEarth/GeoTables.jl: Geospatial tables compatible with the GeoStats.jl framework](https://github.com/JuliaEarth/GeoTables.jl), which by default loads shapefiles using Shapefile.jl (not GDAL). Then you can plot the geometries with [GitHub - JuliaGeometry/MeshViz.jl: Makie.jl recipes for visualization of Meshes.jl](https://github.com/JuliaGeometry/MeshViz.jl).

---

<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:** [August 12, 2021, 3:18pm UTC](https://discourse.julialang.org/t/geopandas-equivalent/66262/6 "2021-08-12T15:18:35Z")

</div>

Sorry if we confuse you with all the alternatives (I would get confused) but you can read your shapefile with

```julia
D = gmtread("pts.shp");

```

and get the data in a [GMTdaset](https://www.generic-mapping-tools.org/GMT.jl/dev/types/#Dataset-type) type. I would like one day to make an interface between this type and others mentioned above but so far I need data in that type to communicate with the GMT library.
