# 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:** 22

<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:** [October 29, 2021, 3:30pm UTC](https://discourse.julialang.org/t/what-is-your-favorite-mapping-package/70509/22 "2021-10-29T15:30:07Z")

</div>

> [@j\_u](#):
>
> How can I direct GMT to save the file with the plot into desired location?

Use `savefig="figname"` Image format is picked from `figname` extension (default saves it in current dir)

The `gmtread` case. This function automatically detects many, raster and vector, formats. But not all. When it doesn’t you get that error message telling user that he/she must help a bit by specifying what type of data is expected to be read.

The `kml` and `json` cases. I would probably have to gave a look to the data (if we go into this detail level, please open an issue in GMT.jl so we don’t bother others with _package imperfections_). But generically, GMT knows how to wrap data around the the globe when it’s told that data is geographic and one asks for a projection. Otherwise, _dateline_ limit comes into play. There are configuration option in GMT to tell were we break the sphere. Default is _dateline_ but that can be set with the [FORMAT\_GEO\_OUT](https://docs.generic-mapping-tools.org/dev/gmt.conf.html#term-FORMAT_GEO_OUT) parameter that one would set probably as `par=(FORMAT_GEO_OUT="+D")` option in `imshow` or `plot` modules.  
Using `projection=:guess` often works pretty well and gets you a nice projected map (when the referencing system is known from input data).

**The gpx case**. Now here things look pretty more complicated. I made a couple of attempts and I’m puzzled because those files do not seem to be read very well by GDAL and violate the GDAL vector model. That is why you get that

```julia-auto
Vector{GMTdataset} with 0 segments

```

For example, if you try with (unzip attached file)

```julia-auto
julia> gmtread("25708.gpx", ogr=true)
Vector{GMTdataset} with 0 segments

```

But if you convert it to, for example, geopackage with

```julia-auto
ogr2ogr("25708.gpx", dest="25708.gpkg")

```

Then we can do (again, this can be made more user friendly if I can _teach_ `imshow` to recognize the file format)

```julia-auto
D = gmtread("25708.gpkg") # No need to tell it the format because ``.gpkg`` are automatically detected
imshow(D, proj=:guess, savefig="tricked_gpx.png")

```

 ![tricked_gpx](https://global.discourse-cdn.com/julialang/original/3X/8/a/8a415952ff54d4d4f7440f26495dc782ce736fc4.png)

> [@j\_u](#):
>
> What would be the correct syntax to prepare the plot with both netCDF and geojson (gpx) data combined?

We can continue this in another thread. Basically, use `grdimage()`, `plot!(...)`, etc. Remember GMT builds maps by layers.

P.S. Sorry, Discourse doesn’t let me attach a .zip or .gps file

---

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