For this map I am trying to find a way to have some kind of GeoRegionValuePlot and I just want only the biggest cities, not every town. The shade of each city on the map will give the number of covid-19 cases in that city. TIA


1 Answer 1


Using CityData:

cities = CityData[{Large, "Sweden"}];
values = Thread[cities -> RandomReal[1, 6]];


The built-in data source only has a statistics on the administrative region level, at least for Sweden. Here's how we can map that data to the cities and plot it:

data = ResourceData["Epidemic Data for Novel Coronavirus COVID-19"];
cities = CityData[{Large, "Sweden"}];

administrativeRegionData = 
  Association @@ (#AdministrativeDivision -> # & /@ Normal@data[
       Select[#Country == Entity["Country", "Sweden"] &]

administrativeRegions = #["AdministrativeDivision"] & /@ cities;
cityData = administrativeRegionData /@ administrativeRegions;
deaths = #["Deaths"]["LastValue"] & /@ cityData;
GeoRegionValuePlot@Thread[cities -> deaths]

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.