CityData
✖
CityData
Details



- The full specification of a city is {"city","region","country"}, where "region" is a state, province or other administrative division.
- Names of cities, regions, and countries are given in standard forms, such as "NewYork", "BritishColumbia", and "UnitedStates".
- CityData["city"] gives a list of all available cities worldwide that use the name "city", sorted in order of decreasing population.
- CityData[{"city","country"}] gives the full specifications for all available cities in the specified country that use the name "city". The results are sorted in order of decreasing population.
- CityData[{"city","country"},"property"] gives the value of "property" for the city with the largest population in the given country that has the specified name.
- CityData[{"city","region","country"},"property"] gives the value of "property" for the particular city represented by the full city specification {"city","region","country"}.
- 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.
- CityData[] or CityData[All] gives a list of all available cities in the world.
- 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. "New York, New York") "Name" primary short English name (e.g. "New York") "Region" state, province, or other administrative division "RegionName" English or local name for region - CityData["name","property","ann"] gives various annotations associated with a property. Typical annotations include:
-
"Date" date to which the data refers "Description" the description of the property "Units" units in which the value is given "UnitsName" English name for the units used "UnitsNotation" notation for the units used "UnitsStandardName" Wolfram Language standard name for the units used
Examples
open allclose allBasic Examples (6)Summary of the most common use cases
Find all available cities in the world named London, sorted by decreasing population:

https://wolfram.com/xid/0b8cs0z09e-cdkbux

Find the population of London, England:

https://wolfram.com/xid/0b8cs0z09e-txj1p

Find the population of London, Ontario:

https://wolfram.com/xid/0b8cs0z09e-j7ar5y

Find the latitude and longitude of the center of London, England:

https://wolfram.com/xid/0b8cs0z09e-bbdo98

Give English names for a city:

https://wolfram.com/xid/0b8cs0z09e-jifpds


https://wolfram.com/xid/0b8cs0z09e-efd4px

Large cities (of over 100,000) in Ireland:

https://wolfram.com/xid/0b8cs0z09e-mfh9cb


https://wolfram.com/xid/0b8cs0z09e-nnya57

Find all available cities in Vanuatu:

https://wolfram.com/xid/0b8cs0z09e-mo9or8

Scope (13)Survey of the scope of standard use cases
City Names & Identification (6)
Standard Wolfram Language names omit all spaces:

https://wolfram.com/xid/0b8cs0z09e-bcio19

Cities can be requested using names that contain spaces:

https://wolfram.com/xid/0b8cs0z09e-blq9gn

The "Name" property gives traditional names, with spaces:

https://wolfram.com/xid/0b8cs0z09e-cp5zaz

Specify the Los Angeles in Chile:

https://wolfram.com/xid/0b8cs0z09e-b3e9ri

All available cities named Fresno in the world:

https://wolfram.com/xid/0b8cs0z09e-hwra94

Cities in the U.S. named Fresno:

https://wolfram.com/xid/0b8cs0z09e-ha84g


https://wolfram.com/xid/0b8cs0z09e-b09g1b

Multiple cities with the same name in a state are identified by county or other information:

https://wolfram.com/xid/0b8cs0z09e-drxdmh


https://wolfram.com/xid/0b8cs0z09e-qd25b

The full names of the smaller cities contain county information:

https://wolfram.com/xid/0b8cs0z09e-d6kpc8

Find alternate names for Beijing:

https://wolfram.com/xid/0b8cs0z09e-ftrtgf

There is no known city with the name Frog anywhere in the world:

https://wolfram.com/xid/0b8cs0z09e-ijg9zm

Collections of Cities (3)
Find all available cities in Tuvalu:

https://wolfram.com/xid/0b8cs0z09e-b1m74r

Find large cities (population above 100,000) in Belgium:

https://wolfram.com/xid/0b8cs0z09e-kunr6


https://wolfram.com/xid/0b8cs0z09e-dx7al6

Find all available cities in the state of Illinois:

https://wolfram.com/xid/0b8cs0z09e-dj8f7j

City Information (4)
The coordinates of the center of Chicago:

https://wolfram.com/xid/0b8cs0z09e-j13w60

The elevation of Chicago in meters:

https://wolfram.com/xid/0b8cs0z09e-frbdaj

A link to a web-based map of the city:

https://wolfram.com/xid/0b8cs0z09e-pykl8r

The region in which Chicago lies:

https://wolfram.com/xid/0b8cs0z09e-omvlt8

Applications (9)Sample problems that can be solved with this function
Create a function to find the nearest large cities to a given position in the U.S.:

https://wolfram.com/xid/0b8cs0z09e-fglms9

Find the three large cities nearest Champaign, Illinois:

https://wolfram.com/xid/0b8cs0z09e-fwrb3y

Plot the positions of all available cities in Japan:

https://wolfram.com/xid/0b8cs0z09e-cjut9r

Find city names that occur in both Germany and Belgium:

https://wolfram.com/xid/0b8cs0z09e-gtkavi

Make a rank plot of the populations of cities in several U.S. states:

https://wolfram.com/xid/0b8cs0z09e-dmfvdl

Plot the large cities in Australia, with tooltips for their names:

https://wolfram.com/xid/0b8cs0z09e-mmsrv2

Plot larger cities with larger, transparent disks:

https://wolfram.com/xid/0b8cs0z09e-eu9aw

Find a traveling salesman tour of the large cities in Germany:

https://wolfram.com/xid/0b8cs0z09e-df6i7a

Make a 3D contour map of Colorado based on the elevations of its cities:

https://wolfram.com/xid/0b8cs0z09e-vnaf1

Make a scatter plot of population versus elevation for cities in Colorado:

https://wolfram.com/xid/0b8cs0z09e-3g2gt

Properties & Relations (2)Properties of the function, and connections to other functions
CityData gives cities listed in order of decreasing population:

https://wolfram.com/xid/0b8cs0z09e-ioex55

CountryData can give the largest cities in a country:

https://wolfram.com/xid/0b8cs0z09e-fod5nv

Make a Lambert azimuthal projection map, centered on New York City:

https://wolfram.com/xid/0b8cs0z09e-icwj9p

Possible Issues (3)Common pitfalls and unexpected behavior
CityData includes only complete cities, not parts of cities:

https://wolfram.com/xid/0b8cs0z09e-bkt8es

Sometimes the name of a city, region and country can all be the same:

https://wolfram.com/xid/0b8cs0z09e-f7done

There can be multiple cities in one state with the same name:

https://wolfram.com/xid/0b8cs0z09e-1ufjf

The smaller ones have county or other identifying information:

https://wolfram.com/xid/0b8cs0z09e-n4d0ca

Neat Examples (2)Surprising or curious use cases
Find the 10 most common city names in the world:

https://wolfram.com/xid/0b8cs0z09e-i2z189

Find the countries where cities named San Jose exist:

https://wolfram.com/xid/0b8cs0z09e-boeaa3

Find the capital cities in the world with the smallest recorded populations:

https://wolfram.com/xid/0b8cs0z09e-hppy8


https://wolfram.com/xid/0b8cs0z09e-gl9iz0

Wolfram Research (2007), CityData, Wolfram Language function, https://reference.wolfram.com/language/ref/CityData.html (updated 2014).
Text
Wolfram Research (2007), CityData, Wolfram Language function, https://reference.wolfram.com/language/ref/CityData.html (updated 2014).
Wolfram Research (2007), CityData, Wolfram Language function, https://reference.wolfram.com/language/ref/CityData.html (updated 2014).
CMS
Wolfram Language. 2007. "CityData." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/CityData.html.
Wolfram Language. 2007. "CityData." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/CityData.html.
APA
Wolfram Language. (2007). CityData. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CityData.html
Wolfram Language. (2007). CityData. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CityData.html
BibTeX
@misc{reference.wolfram_2025_citydata, author="Wolfram Research", title="{CityData}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/CityData.html}", note=[Accessed: 25-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_citydata, organization={Wolfram Research}, title={CityData}, year={2014}, url={https://reference.wolfram.com/language/ref/CityData.html}, note=[Accessed: 25-March-2025
]}