I am attempting to plot the most populous cities on a world map.
Currently, I have the line of code:
numberofpeople =
Map[{#, Length[CityData[#, "Population"]]} &, CityData[All]];
which should give me the City name, and the population. However, when I type in the line of code
Reverse[SortBy[numberofpeople, Last]][[1 ;; 20]]
I am getting odd data, which is that the most populous cities have 1 person.
Could somebody debug my code, and answer any future questions I have on the matter? Much appreciated.
EDIT: How do I plot these points on a World Map? Currently I have
Graphics[{EdgeForm[Black], , CountryData[#, "SchematicPolygon"]} & /@
CountryData[]]
but I have no idea what goes between the points.