koenderks/rcityviews

[Feature] I would like to be able to select cities by lat/long, or by city & country

emmaklugman opened this issue · 2 comments

I was excited when I saw this package advertised in the RWeekly email! I thought the maps it made looked beautiful, so I installed the package on my computer so I could try making a map of Boston, MA (USA). I wasn't able to, since there are two identically named cities in the dataset (Boston, UK, and Boston, USA), and the behaviour of the cityview function itself (which it helpfully reported) was "More than one city matched to this name, using the first match", a default which I wasn't able to figure out how to override. Similarly, when I looked for "Cambridge", there were four cities, across four countries, and I couldn't select between them.

I would recommend adding an option to cityview that allows for selecting cities by city & country, by row number, by lat/long, or perhaps even interactively, by writing a message to the console when multiple matches are found, and asking the user to report which of the options (1, 2, 3, or 4) perhaps, they meant, before rendering the map.

Thanks for your work on this!

Hi,

Cool to see it featured on RWeekly! This was indeed implemented a bit clumsy, but now (as of c0566fd) you should be able to pick from a list of cities (with country, lat/long) that share the same name. Let me know if this works for you!

Perfect, thanks! Works great.