I want to create a list of all world cities named "Alexandria", along with their populations. Can a search engine do that? What could the query look like?
-
1Have you tried geonames.org?– user5676May 15, 2013 at 20:26
-
@barrycarter Yes, thanks. Even though it does not show population for all cities, it's still valuable. Thank you.– Hosam AlyJun 4, 2013 at 21:48
-
You might want to play around with a db I created from the geonames.org data. Sample query: 69d09f284af2d9321d9a6863d0defa2d.geonames.db.barrycarter.info This isn't very detailed, includes cities whose alternate name is Alexandria, and exposes a duplicate in the geonames.org database.– user5676Jun 6, 2013 at 4:10
2 Answers
Mathematica could answer this with CityData:
data=CityData["Alexandria"];
Table[{data[[i]],CityData[data[[i]],"Population"]},{i,1,Length[data]}]
Giving the following output:
{
{{Alexandria,Alexandria,Egypt},4230569},
{{Alexandria,Virginia,UnitedStates},139966},
{{Alexandria,Piemonte,Italy},90446},
{{Alexandria,Kirovograd,Ukraine},88916},
{{Alexandria,Teleorman,Romania},51737},
{{Alexandria,Louisiana,UnitedStates},47723},
{{Alexandria,Imathia,Greece},13665},
{{Alexandria,WestDunbartonshire,UnitedKingdom},13480},
{{Alexandria,Minnesota,UnitedStates},11070},
{{Alexandria,RioGrandeDoNorte,Brazil},9769},
{{Alexandria,Kentucky,UnitedStates},8477},
{{Alexandria,Indiana,UnitedStates},5145},
{{Alexandria,NewYork,UnitedStates},4061},
{{Alexandria,Alabama,UnitedStates},3917},
{{Alexandria,Ontario,Canada},3559},
{{Alexandria,SaintAnn,Jamaica},1927},
{{Alexandria,NewHampshire,UnitedStates},1613},
{{Alexandria,Tennessee,UnitedStates},966},
{{Alexandria,SouthDakota,UnitedStates},615},
{{Alexandria,Ohio,UnitedStates},517},
{{Alexandria,Pennsylvania,UnitedStates},346},
{{Alexandria,Nebraska,UnitedStates},177},
{{Alexandria,Missouri,UnitedStates},159}
}
But unfortunately the list of outputs, accessible by CityData["Alexandria"]
in Mathematica isn't available in Wolfram|alpha at the moment.
A search enging would not be an effective way to accomplish what you want since it would not distinguish between different Alexandrias. Instead, see Wikipedia's article on Alexandria http://en.wikipedia.org/wiki/Alexandria_(disambiguation) and click on the links in the article to see the population for each place.
-
Thanks for your answer. I was hoping there would be a way to use something like Wolfram Alpha to generate that data, but it seems I'll have to do it manually for now. Mar 12, 2013 at 18:09