This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

CityData

CityData
gives the value of the specified property for the city with the specified name.
CityData
gives a list of the full specifications of cities whose names are consistent with name.
  • The full specification of a city is , where is a state, province or other administrative division.
  • Names of cities, regions, and countries are given in standard forms, such as , , and .
  • CityData gives a list of all available cities worldwide that use the name , sorted in order of decreasing population.
  • CityData gives the full specifications for all available cities in the specified country that use the name . The results are sorted in order of decreasing population.
  • CityData gives the value of for the city with the largest population in the given country that has the specified name.
  • CityData gives the value of for the particular city represented by the full city specification .
  • If there is more than one city with a given name in a particular region and country, the standard name for that city will contain additional identifying information, such as a county name.
  • CityData[{All, "region", "country"}] gives a list of all available cities in the specified region of a country, sorted in order of decreasing population.
  • CityData[{Large, "region", "country"}] gives a list of all large cities in the specified region. Large cities are typically defined as having populations above 100,000.
  • CityData[{All, "country"}] and CityData[{Large, "country"}] give all available cities and all large cities, respectively, in the specified country.
  • Typical properties for cities include:
"Coordinates"latitude, longitude for the city center
"Elevation"elevation in meters of the city center
"Latitude"latitude for the city center
"LocationLink"URI for a map centered on the city
"Longitude"longitude for the city center
"Population"estimated total ordinary population
"TimeZone"current time zone relative to UTC
  • Names and identification-related properties include:
"AlternateNames"alternate names
"Country"country in which the city lies
"FullName"primary full English name (e.g. )
"Name"primary short English name (e.g. )
"Region"state, province, or other administrative division
"RegionName"English or local name for region
  • CityData gives various annotations associated with a property. Typical annotations include:
"Date"date to which the data refers
"Description"the description of the property
"Note"special note about the property given
"Units"units in which the value is given
"UnitsName"English name for the units used
"UnitsNotation"notation for the units used
"UnitsStandardName"Mathematica standard name for the units used
Find all available cities in the world named London, sorted by decreasing population:
Find the population of London, England:
Find the population of London, Ontario:
Find the latitude and longitude of the center of London, England:
Give English names for a city:
Large cities (of over 100,000) in Ireland:
Large cities in Ohio:
Find all available cities in Vanuatu:
Find all available cities in the world named London, sorted by decreasing population:
In[1]:=
Click for copyable input
Out[1]=
 
Find the population of London, England:
In[1]:=
Click for copyable input
Out[1]=
Find the population of London, Ontario:
In[2]:=
Click for copyable input
Out[2]=
 
Find the latitude and longitude of the center of London, England:
In[1]:=
Click for copyable input
Out[1]=
 
Give English names for a city:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
 
Large cities (of over 100,000) in Ireland:
In[1]:=
Click for copyable input
Out[1]=
Large cities in Ohio:
In[2]:=
Click for copyable input
Out[2]=
 
Find all available cities in Vanuatu:
In[1]:=
Click for copyable input
Out[1]=
Standard Mathematica names omit all spaces:
Cities can be requested using names that contain spaces:
The property gives traditional names, with spaces:
Specify the Los Angeles in Chile:
All available cities named Fresno in the world:
Cities in the U.S. named Fresno:
Specify Fresno, Texas:
Multiple cities with the same name in a state are identified by county or other information:
The basic names are the same:
The full names of the smaller cities contain county information:
Find alternate names for Beijing:
There is no known city with the name Frog anywhere in the world:
Find all available cities in Tuvalu:
Find large cities (population above 100,000) in Belgium:
Find all available cities in the state of Illinois:
The coordinates of the center of Chicago:
The elevation of Chicago in meters:
A link to a web-based map of the city:
The region in which Chicago lies:
Create a function to find the nearest large cities to a given position in the U.S.:
Find the three large cities nearest Champaign, Illinois:
Plot the positions of all available cities in Japan:
Find city names that occur in both Germany and Belgium:
Make a rank plot of the populations of cities in several U.S. states:
Plot the large cities in Australia, with tooltips for their names:
Plot larger cities with larger, transparent disks:
Find a traveling salesman tour of the large cities in Germany:
Make a 3D contour map of Colorado based on the elevations of its cities:
Make a scatter plot of population versus elevation for cities in Colorado:
CityData gives cities listed in order of decreasing population:
CountryData can give the largest cities in a country:
Make a Lambert azimuthal projection map, centered on New York City:
CityData includes only complete cities, not parts of cities:
Sometimes the name of a city, region and country can all be the same:
There can be multiple cities in one state with the same name:
The smaller ones have county or other identifying information:
Find the 10 most common city names in the world:
Find the countries where cities named San Jose exist:
Find the city names that appear in the largest number of different countries:
Find the number of cities with shared names between all countries:
Plot a matrix of shared city names:
Find clusters of countries that share many city names:
Find the maximum number of cities shared between two countries:
Find for which countries this is the case:
Make a network of countries that share more than 50 city names:
Find the capital cities in the world with the smallest recorded populations:
Find the populations:
New in 6