Choropleth example from documentation does not work

Open
#1,621 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
julia

Research direction

Reproduce the linked choropleth example, checking GMT.mk_codes_values, plot(), and the gmtread URL. Verify the reported String3 mismatch, palette_init error, and renamed repository branch, then update the example so it runs without these errors. Done means the documented choropleth workflow completes successfully.

Written by the indexing model from the issue text.

Description

I try to follow the example here, but I get errors:

  • GMT.mk_codes_values expects a Vector{String}, however paises[!, 2] is a Vector{String3}. Perhaps one solution would be to make GMT.mk_codes_values expect a Vector{AbstractString}? Converting it to a Vector{String} makes that call work.
  • The call to plot() a bit below fails:
ERROR: MethodError: no method matching palette_init(::Ptr{Nothing}, ::Vector{GMTdataset{Float64, 2}})
The function `palette_init` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  palette_init(::Ptr{Nothing}, ::GMTcpt)
   @ GMT ~/.julia/packages/GMT/3I1CI/src/gmt_main.jl:1245
  • Further down, the call countries = gmtread("/vsicurl/https://github.com/datasets/geo-countries/raw/master/data/countries.geojson") fails, because the master branch on that repository was renamed to main (this is an easy fix, just substitute master with main in the URL and it works).
Dominant language
Julia
Stars
222
Forks
35
Avg merge
8h 1m
Merged PRs (30d)
9

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GenericMappingTools/GMT.jl

All issues in GenericMappingTools/GMT.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.