Over the last month or so I developed a new command to draw maps. The command relies on frames and thus requires Stata 17 or newer. To install the command, type
Basic functionality of geoplot is similar to the one offered by the well-known and much appreciated spmap command by Maurizio Pisati, but geoplot has more streamlined syntax (i.e. more similar to usual graph syntax in Stata), is more flexible in terms of how layers of objects can be combined/arranged, and should also be easier to expand.
The geoplot package contains two commands, geoframe and geoplot. The general procedure is to first use geoframe to prepare one or several frames containing the source data (e.g. shape files translated by official Stata's spshape2dta command) and then use these frames in geoplot to draw a map. Multiple layers of elements such as regions, borders, lakes, roads, labels, and symbols can be freely combined and the look of the elements (e.g. their color) can be varied depending on the values of variables. See https://github.com/benjann/geoplot/ for a few examples.
I thank Asjad Naqvi for many valuable comments during the development of this command.
ben
Code:
ssc install geoplot, replace ssc install palettes, replace // if not already installed ssc install colrspace, replace // if not already installed ssc install moremata, replace // if not already installed
The geoplot package contains two commands, geoframe and geoplot. The general procedure is to first use geoframe to prepare one or several frames containing the source data (e.g. shape files translated by official Stata's spshape2dta command) and then use these frames in geoplot to draw a map. Multiple layers of elements such as regions, borders, lakes, roads, labels, and symbols can be freely combined and the look of the elements (e.g. their color) can be varied depending on the values of variables. See https://github.com/benjann/geoplot/ for a few examples.
I thank Asjad Naqvi for many valuable comments during the development of this command.
ben
Comment