# What is your favorite mapping package?

**URL:** https://discourse.julialang.org/t/what-is-your-favorite-mapping-package/70509
**Category:** General Usage
**Tags:** question, plotting, geo, gmt
**Created:** [October 27, 2021, 7:57pm UTC](https://discourse.julialang.org/t/what-is-your-favorite-mapping-package/70509 "2021-10-27T19:57:30Z")
**Posts on this page:** 1
**Showing post:** 19

<div class="post-metadata">

### Author: ![j\_u](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/j_u/32/219081_2.png) [@j\_u](https://discourse.julialang.org/u/j_u)
#### Post date: [October 29, 2021, 12:40am UTC](https://discourse.julialang.org/t/what-is-your-favorite-mapping-package/70509/19 "2021-10-29T00:40:47Z")

</div>

> [@rafael.guerra](#):
>
> and the authors [acknowledge it here](https://pdfs.semanticscholar.org/d866/3df662b6f8af6097379263363d26817307f9.pdf#page=4)

You guys make me smiling. 😉

So far, I have been using `Gadfly` to prepare statistical plots and `CairoMakie` to do quasi geo plotting in a sense that I plotted my geo data. However, my plots were missing coastlines and there was no proper reference to latitues and longitudes. Despite it, the plots were very helpful with understanding the subject. I also used `kepler.gl` to do a little more interactive analysis especially in reference to GPX data. I really like the ease of use of `GMT.jl` in relation to plotting coastalines and geo referenced netCDF data. This is my understanding after some very preliminary tests.

> [@joa-quim](#):
>
> If you have a GDAL built with _expat_ (you do if you installed GMT.jl on Windows), do
> 
> ```julia
> data = gmtread("/path/to/gpx");
> imshow(data)
> 
> ```

I installed GMT and GMT.jl according to the info from my post: [https://discourse.julialang.org/t/errors-associated-with-using-gmt/70393/18](https://discourse.julialang.org/t/errors-associated-with-using-gmt/70393/18)

Im on:  
`NAME="Ubuntu", VERSION="20.04.2 LTS (Focal Fossa)" over SSH.`  
and

```julia
Julia Version 1.8.0-DEV.829
Commit d71b77d7b6 (2021-10-27 00:39 UTC)
JULIA_EDITOR = "/home/username/.vscode-server/bin/[...]/node"

```

My Julia env consits of:

```julia
Status `~/data/geo_gmt/Project.toml`
  [5752ebe1] GMT v0.38.0
  [6099a3de] PythonCall v0.4.2 `https://github.com/cjdoris/PythonCall.jl.git#master`

```

My Conda env consists of:

```julia
Status /home/username/data/geo_gmt/PythonCallDeps.toml
Conda channels:
  conda-forge
  nasa-ames-stereo-pipeline
Conda packages:
  gmt =6.2

```

In:

```julia
/home/username/data/geo_gmt/conda_env/bin
shell> gmt --version
6.2.0

shell> gdal-config --version
3.3.2

shell> gdal-config --libs
-L/home/username/data/geo_gmt/conda_env/lib -lgdal

shell> gdal-config --dep-libs
-lcrypto -L/home/username/data/geo_gmt/conda_env/lib -ltiledb -L/home/username/data/geo_gmt/conda_env/lib -lpoppler -ljson-c -L/home/username/data/geo_gmt/conda_env/lib -L/home/username/data/geo_gmt/conda_env/lib -lfreexl -L/home/username/data/geo_gmt/conda_env/lib -lgeos_c -L/home/username/data/geo_gmt/conda_env/lib -lwebp -L/home/username/data/geo_gmt/conda_env/lib -lkmlbase -lkmldom -lkmlengine -lkmlxsd -lkmlregionator -L/home/username/data/geo_gmt/conda_env/lib -lexpat -L/home/username/data/geo_gmt/conda_env/lib -lxerces-c -lpthread -L/home/username/data/geo_gmt/conda_env/lib -lopenjp2 -L/home/username/data/geo_gmt/conda_env/lib -lnetcdf -L/home/username/data/geo_gmt/conda_env/lib -lhdf5 -L/home/username/data/geo_gmt/conda_env/lib -lmfhdf -ldf -lgif -L/home/username/data/geo_gmt/conda_env/lib -lgeotiff -L/home/username/data/geo_gmt/conda_env -L/home/username/data/geo_gmt/conda_env/lib -lpng -L/home/username/data/geo_gmt/conda_env -L/home/username/data/geo_gmt/conda_env/lib -lcfitsio -L/home/username/data/geo_gmt/conda_env/lib -lpq -L/home/username/data/geo_gmt/conda_env/lib -lzstd -llzma -L/home/username/data/geo_gmt/conda_env/lib -lsqlite3 -L/home/username/data/geo_gmt/conda_env/lib -lproj -L/home/username/data/geo_gmt/conda_env/lib -lsqlite3 -L/home/username/data/geo_gmt/conda_env/lib -ltiff -L/home/username/data/geo_gmt/conda_env -L/home/username/data/geo_gmt/conda_env/lib -ljpeg -ldeflate -lz -L/home/username/data/geo_gmt/conda_env -L/home/username/data/geo_gmt/conda_env/lib -lpthread -lm -lrt -ldl -L/home/username/data/geo_gmt/conda_env/lib -lspatialite -L/home/username/data/geo_gmt/conda_env/lib64 -L/home/username/data/geo_gmt/conda_env/lib -ldap -ldapserver -ldapclient -L/home/username/data/geo_gmt/conda_env/lib -lcurl -L/home/username/data/geo_gmt/conda_env/lib -lxml2 -L/home/username/data/geo_gmt/conda_env/lib -lz -L/home/username/data/geo_gmt/conda_env/lib -llzma -lpthread -L/home/username/data/geo_gmt/conda_env/lib -liconv -L/home/username/data/geo_gmt/conda_env/lib -licui18n -licuuc -licudata -lm -ldl -lpthread -luuid -lpcre -lLerc -L/home/username/data/geo_gmt/conda_env/lib -lcurl -liconv -L/home/username/data/geo_gmt/conda_env/lib -lxml2 -L/home/username/data/geo_gmt/conda_env/lib -lkea -L/home/username/data/geo_gmt/conda_env/lib -lhdf5_cpp -lhdf5

shell> gdal-config --cflags
-I/home/username/data/geo_gmt/conda_env/include

shell> gdal-config --datadir
/home/username/data/geo_gmt/conda_env/share/gdal

shell> gdal-config --ogr-enabled
yes

shell> gdal-config --gnm-enabled
yes

shell> gdal-config --formats
derived gtiff hfa mem vrt aaigrid adrg aigrid airsar arg blx bmp bsb cals ceos ceos2 coasp cosar ctg dimap dted elas envisat ers esric fit gff gsg gxf hf2 idrisi ilwis ingr iris iso8211 jaxapalsar jdem kmlsuperoverlay l1b leveller map mrf msgn ngsgeoid nitf northwood pds prf r raw rmf rs2 safe saga sdts sentinel2 sgi sigdem srtmhgt stacta terragen tga til tsx usgsdem xpm xyz zmap rik ozi eeda plmosaic rda wcs wms wmts daas ogcapi rasterlite mbtiles grib pdf tiledb webp dods openjpeg netcdf kea hdf5 hdf4 gif png pcraster fits jpeg pcidsk postgisraster

```

**Problem 1:**  
When:

```julia
fname = "path/to/netCDF4";
G = gmtread(fname, grd=true);
imshow(G, region=:global, projection=:Mollweide, frame=:ag, title="my title", figsize=15, colorbar=true, coast=true)

```

The image seems to be plotteing correctly, saved to /home/username/tmp/GMTjl\_tmp.png (its possible to open this file and to see the plot), however, I am getting:

```julia
ERROR: LoadError: IOError: could not spawn `xdg-open /home/username/tmp/GMTjl_tmp.png`: no such file or directory (ENOENT)
Stacktrace:
  [1] _spawn_primitive(file::String, cmd::Cmd, stdio::Vector{Any})
    @ Base ./process.jl:102
  [2] #702
    @ ./process.jl:115 [inlined]
  [3] setup_stdios(f::Base.var"#702#703"{Cmd}, stdios::Vector{Any})
    @ Base ./process.jl:199
  [4] _spawn
    @ ./process.jl:114 [inlined]
  [5] run(::Cmd; wait::Bool)
    @ Base ./process.jl:443
  [6] run
    @ ./process.jl:442 [inlined]
  [7] showfig(d::Dict{Symbol, Any}, fname_ps::String, fname_ext::String, opt_T::String, K::Bool, fname::String)
    @ GMT ~/.julia/packages/GMT/TPV4a/src/common_options.jl:3291
  [8] finish_PS_module(::Dict{Symbol, Any}, ::Vector{String}, ::String, ::Bool, ::Bool, ::Bool, ::GMTgrid{Float32, 2}, ::Vararg{Any})
    @ GMT ~/.julia/packages/GMT/TPV4a/src/common_options.jl:3428
  [9] grdimage(cmd0::String, arg1::GMTgrid{Float32, 2}, arg2::Nothing, arg3::Nothing; first::Bool, kwargs::Base.Pairs{Symbol, Any, NTuple{8, Symbol}, NamedTuple{(:show, :colorbar, :region, :frame, :title, :coast, :projection, :figsize), Tuple{Bool, Bool, Symbol, Symbol, String, Bool, Symbol, Int64}}})
    @ GMT ~/.julia/packages/GMT/TPV4a/src/grdimage.jl:126
 [10] imshow(arg1::GMTgrid{Float32, 2}; kw::Base.Pairs{Symbol, Any, NTuple{7, Symbol}, NamedTuple{(:region, :projection, :frame, :title, :figsize, :colorbar, :coast), Tuple{Symbol, Symbol, Symbol, String, Int64, Bool, Bool}}})
    @ GMT ~/.julia/packages/GMT/TPV4a/src/imshow.jl:88
 [11] top-level scope
    @ ~/data/geo_gmt/geo_gmt.jl:105
in expression starting at /home/username/data/geo_gmt/geo_gmt.jl:105

```

**Problem 2:**  
When:

```julia
data = "/path/to/gpx"
imshow(data)

```

I am getting

```julia
ERROR 4: `/path/to/gpx' not recognized as a supported file format.
grdinfo (gmtapi_import_grid): Not a supported grid format [/path/to/gpx]
[Session GMT (2)]: Error returned from GMT API: GMT_GRID_READ_ERROR (18)
[Session GMT (2)]: Error returned from GMT API: GMT_GRID_READ_ERROR (18)
ERROR: LoadError: BoundsError: attempt to access 0-element Vector{GMTdataset} at index [1]
Stacktrace:
 [1] getindex(A::Vector{GMTdataset}, i1::Int64)
   @ Base ./array.jl:921
 [2] snif_GI_set_CTRLlimits(G_I::String)
   @ GMT ~/.julia/packages/GMT/TPV4a/src/imshow.jl:133
 [3] imshow(arg1::String, x::Vector{Float64}, y::Vector{Float64}; kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ GMT ~/.julia/packages/GMT/TPV4a/src/imshow.jl:45
 [4] imshow (repeats 3 times)
   @ ~/.julia/packages/GMT/TPV4a/src/imshow.jl:36 [inlined]
 [5] top-level scope
   @ ~/data/geo_gmt/geo_gmt.jl:116
in expression starting at /home/username/data/geo_gmt/geo_gmt.jl:116

```

Similar errors I am getting when trying to plot the same data that is encoded in gpx when using csv, json, geojson, kml, txt files.

I also tried gdal-config --version 3.3.1 from conda\_channels = [“nasa-ames-stereo-pipeline”]. In this case, there were some conflicts when trying to install GMT 6.2.0 and there seems to be no support for gpx in this GDAL version as well.

Is there any GDAL version at Conda that is supporting gpx? How complicated / difficult is the build process? I’ve been using Linux for about 1 year. I have done only a few builds with cmake of Fortran and Go software. This is a hobby project, I can not commit all my time, however, should you be willing to provide some advice, I would be very interested to try to make it work. Also pls be informed that I might not reply immediately to your potential messages as I have some due answers to prepare also on this forum. However, I would really appreciate some additional info!

---

_[View the full topic](https://discourse.julialang.org/t/what-is-your-favorite-mapping-package/70509)._
