What is your favorite mapping package?

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 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

Vector{GMTdataset} with 0 segments

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

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

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

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)

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

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

1 Like