2
$\begingroup$

I have given the following list of European cities and I would like to have the area (surface or metropolitan, I do not care much). For example, the surface area of Paris is 105.4 km². Is there a way to extract this information from Mathematica?

Thanks in advance.

{Entity["City", {"Brussels", "Brussels", "Belgium"}], 
 Entity["City", {"Antwerp", "Antwerp", "Belgium"}], 
 Entity["City", {"Paris", "IleDeFrance", "France"}], 
 Entity["City", {"Marseille", "ProvenceAlpesCoteDAzur", "France"}], 
 Entity["City", {"Lyon", "RhoneAlpes", "France"}], 
 Entity["City", {"Toulouse", "MidiPyrenees", "France"}], 
 Entity["City", {"Nice", "ProvenceAlpesCoteDAzur", "France"}], 
 Entity["City", {"Madrid", "Madrid", "Spain"}], 
 Entity["City", {"Barcelona", "Barcelona", "Spain"}], 
 Entity["City", {"Valencia", "Valencia", "Spain"}], 
 Entity["City", {"Seville", "Seville", "Spain"}], 
 Entity["City", {"Zaragoza", "Zaragoza", "Spain"}], 
 Entity["City", {"Malaga", "Malaga", "Spain"}], 
 Entity["City", {"Murcia", "Murcia", "Spain"}], 
 Entity["City", {"LasPalmas", "LasPalmas", "Spain"}], 
 Entity["City", {"Palma", "Balears", "Spain"}], 
 Entity["City", {"Bilbao", "Vizcaya", "Spain"}], 
 Entity["City", {"Cordoba", "Cordoba", "Spain"}], 
 Entity["City", {"Alicante", "Alacant", "Spain"}], 
 Entity["City", {"Valladolid", "Valladolid", "Spain"}], 
 Entity["City", {"Lisbon", "Lisboa", "Portugal"}], 
 Entity["City", {"Dublin", "Dublin", "Ireland"}], 
 Entity["City", {"London", "GreaterLondon", "UnitedKingdom"}], 
 Entity["City", {"Birmingham", "Birmingham", "UnitedKingdom"}], 
 Entity["City", {"Leeds", "Leeds", "UnitedKingdom"}], 
 Entity["City", {"Glasgow", "GlasgowCity", "UnitedKingdom"}], 
 Entity["City", {"Sheffield", "Sheffield", "UnitedKingdom"}], 
 Entity["City", {"Bradford", "Bradford", "UnitedKingdom"}], 
 Entity["City", {"Manchester", "Manchester", "UnitedKingdom"}], 
 Entity["City", {"Liverpool", "Liverpool", "UnitedKingdom"}], 
 Entity["City", {"Edinburgh", "Edinburgh", "UnitedKingdom"}], 
 Entity["City", {"Bristol", "Bristol", "UnitedKingdom"}], 
 Entity["City", {"Croydon", "GreaterLondon", "UnitedKingdom"}], 
 Entity["City", {"Leicester", "Leicester", "UnitedKingdom"}], 
 Entity["City", {"Coventry", "Coventry", "UnitedKingdom"}], 
 Entity["City", {"Doncaster", "Doncaster", "UnitedKingdom"}], 
 Entity["City", {"Caerdydd", "Cardiff", "UnitedKingdom"}], 
 Entity["City", {"Amsterdam", "NoordHolland", "Netherlands"}], 
 Entity["City", {"Rotterdam", "ZuidHolland", "Netherlands"}], 
 Entity["City", {"TheHague", "ZuidHolland", "Netherlands"}], 
 Entity["City", {"Utrecht", "Utrecht", "Netherlands"}], 
 Entity["City", {"Rome", "Lazio", "Italy"}], 
 Entity["City", {"Milan", "Lombardy", "Italy"}], 
 Entity["City", {"Naples", "Campania", "Italy"}], 
 Entity["City", {"Turin", "Piemonte", "Italy"}], 
 Entity["City", {"Palermo", "Sicily", "Italy"}], 
 Entity["City", {"Genoa", "Liguria", "Italy"}], 
 Entity["City", {"Bologna", "EmiliaRomagna", "Italy"}], 
 Entity["City", {"Florence", "Toscana", "Italy"}], 
 Entity["City", {"Bari", "Apulia", "Italy"}], 
 Entity["City", {"Catania", "Sicily", "Italy"}], 
 Entity["City", {"Zurich", "Zurich", "Switzerland"}], 
 Entity["City", {"Vienna", "Vienna", "Austria"}], 
 Entity["City", {"Berlin", "Berlin", "Germany"}], 
 Entity["City", {"Hamburg", "Hamburg", "Germany"}], 
 Entity["City", {"Munich", "Bavaria", "Germany"}], 
 Entity["City", {"Cologne", "NorthRhineWestphalia", "Germany"}], 
 Entity["City", {"Frankfurt", "Hesse", "Germany"}], 
 Entity["City", {"Stuttgart", "BadenWurttemberg", "Germany"}], 
 Entity["City", {"Dusseldorf", "NorthRhineWestphalia", "Germany"}], 
 Entity["City", {"Essen", "NorthRhineWestphalia", "Germany"}], 
 Entity["City", {"Dortmund", "NorthRhineWestphalia", "Germany"}], 
 Entity["City", {"Bremen", "Bremen", "Germany"}], 
 Entity["City", {"Dresden", "Saxony", "Germany"}], 
 Entity["City", {"Hanover", "LowerSaxony", "Germany"}], 
 Entity["City", {"Leipzig", "Saxony", "Germany"}], 
 Entity["City", {"Nuremberg", "Bavaria", "Germany"}], 
 Entity["City", {"Duisburg", "NorthRhineWestphalia", "Germany"}], 
 Entity["City", {"Bochum", "NorthRhineWestphalia", "Germany"}], 
 Entity["City", {"Wuppertal", "NorthRhineWestphalia", "Germany"}], 
 Entity["City", {"Bielefeld", "NorthRhineWestphalia", "Germany"}], 
 Entity["City", {"Bonn", "NorthRhineWestphalia", "Germany"}], 
 Entity["City", {"Mannheim", "BadenWurttemberg", "Germany"}]}
$\endgroup$

2 Answers 2

2
$\begingroup$

For 12 of the 73 cities in the list cities, we can get the area using GeoArea:

Quiet @ DeleteMissing[
  Transpose[
    {CommonName @ cities, 
     GeoArea @ cities, 
     GeoArea[cities, UnitSystem -> "Metric"]}], 
  1, 1] // Grid

enter image description here

$\endgroup$
0
$\begingroup$

With cities set to the list above this retrieves the Area property for each city. Unfortunately, the result is Missing["NotAvailable"] for all of them.

#["Area"] & /@ cities

Other properties are available

#["Population"] & /@ cities
$\endgroup$
2
  • $\begingroup$ This is very inefficient code, each application in the map is another call $\endgroup$
    – M.R.
    Commented Oct 29, 2020 at 15:47
  • $\begingroup$ @M.R. Yes. Much more efficient to retrieve in a single call EntityValue[cities, "Area"]. $\endgroup$ Commented Oct 29, 2020 at 18:51

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.