getdcw
D = getdcw(codes; states=false, file::StrSymb="") -> Vector{GMTdataset}Get country/region polygons from the DCW (Digital Chart of the World) database.
Arguments
codes: Country codes as string (comma-separated for multiple) or vector of strings. Use 2-letter ISO 3166-1 codes (e.g., “PT”, “ES”, “FR”) or continent codes (e.g., “=AF” for Africa, “=EU” for Europe OR the continent names themselves). Special commands::list,:states,:continents
Keywords
states: If true, get state/province level polygons instead of country level. Only available for: AR, AU, BR, CA, CN, GB, IN, NO, RU, US. Default: falsefile: indicate that we want to use another netCDF file than the default DCW file.file, without extension, can be either just the absolute file name, case in which the file.nc is expected to be found in the shared folder that also contains the dcw-gmt.nc file, or the full file name, case in which the file can be located anywhere. For example:getdcw=(:CH, file=:ODS)extracts the Swiss polygon from (small) ODS.nc file.
Returns
Vector{GMTdataset}: Polygons with attributes including “CODE” and “NAME”.
Example
# Get single country
pt = getdcw("PT")
# Get multiple countries
iberia = getdcw("PT,ES")
# Get European countries (continent code)
europe = getdcw("=EU")
# Get Brazilian states
br_states = getdcw("BR", states=true)
# Use with fourcolors
polys = getdcw("PT,ES,FR,DE,IT,CH,AT,BE,NL")
fourcolors(polys, groupby="CODE")
# List available codes
getdcw(:list) # all countriesAvailable continent codes
=AF: Africa=AN: Antarctica=AS: Asia=EU: Europe=NA: North America=OC: Oceania=SA: South America=WD: World
Countries with state/province data
AR (Argentina), AU (Australia), BR (Brazil), CA (Canada), CN (China), GB (United Kingdom), IN (India), NO (Norway), RU (Russia), US (United States)
Source Code
This function has multiple methods:
getdcw(codes::Vector{<:AbstractString}; kwargs...)- getdcw.jl:93getdcw(codes::Union{String, Symbol}; states, file)- getdcw.jl:62