List of Countries, cities
Hi,
I would appreciate any help that I can receive, basically I need to be able to generate a list of cities (maybe even towns, if possible) along with the respective countries to provide as selectable options in an application.
I am aware that Java provides the 'Locale' API, but unfortunately this only returns a list of countries and nothing further.
Is there anything else that I can use, instead of hard coding these in.... ?
Once again, I would appreciate any pointers that I get.
Thanks....
[536 byte] By [
ibn_aziza] at [2007-11-27 11:30:57]

# 2
Thanks for the reply,
If there is nothing available I guess it will have to be hardcoded, but....
I am actually quite surprised that something like this has not been pre-compiled already. I mean if they can provide a list of countries, then why can't a list of cities be generated as well ?
In anycase..... perhaps there libraries out there, which provide a list of cities ?
Again... I would appreciate any help that I can get.
# 5
> If there is nothing available I guess it will have to
> be hardcoded, but....
>
No, don't hardcode such things.
Having a hardcoded list of countries is bad enough, but cities?
Why not a hardcoded list of all the people on the world?
> I am actually quite surprised that something like
> this has not been pre-compiled already. I mean if
> they can provide a list of countries, then why can't
> a list of cities be generated as well ?
>
Countries change names, get created and disappear.
Cities do so too, only more often.
It's bad enough you rely on some list of countries that's probably way out of date, but cities too?
What's next, a hardcoded list of all streets and addresses in all cities, complete with the names, date of birth, job description, and phone numbers of everyone who lives there?
> In anycase..... perhaps there libraries out there,
> which provide a list of cities ?
>
Yes. Any library that has a reasonably recent atlas should provide you with such a list in its index.
All you have to do is type it in.