GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Getting Country, State, City List  XML
Forum Index -> General
Author Message
krish.343



Joined: 16/03/2010 10:33:15
Messages: 1
Offline

Hi

Is there any way to Get Countries List?
Is there any ways to Get States List based on Selected Country?
Is there any way to Get Cities List Based on Selected State?


I'm trying to create a registration page in ASP.Net 2005, Where i need to place 3 combo boxes (Country, State, City).

On page Load function it should pull the Countries list and bind in combo box.

When user chosen a country, states combo box should be populated and
when State is chosen, Cities need to be populated..

How to do with geoname webservices?


Anybody Help me????

Thanks in Advance
marc



Joined: 08/12/2005 07:39:47
Messages: 4412
Offline

check out the documentation of the search service and the hierarchy service.


Marc

[WWW]
wonster



Joined: 13/04/2010 08:54:33
Messages: 1
Offline

I've been trying to do with by getting the database dump from the site. I have been able to load the main table, GeoNames, AlternateNames, Hierarchy, and CountryInfo.

I'm trying to see what Hierarchy table does? Can anyone comment on this table?

I understand from other posts that admin1 - 4 defines hierarchy. To make this efficient, are users indexing these fields? It looks like I may need to create a new table(s) to store this information for fast lookups. Anyone who has had success implementing this in a heavy production env? I'm using SQL 2008.

I'd like to bascially achieve what the following WS is doing.
http://www.geonames.org/export/place-hierarchy.html

Thanks
dik_voormekaar



Joined: 23/12/2009 09:40:39
Messages: 22
Offline

I see that there is the file hierarchy.zip on the download server. Is that a new file?
There is no description for it in the readme.txt
Can that be added?
marc



Joined: 08/12/2005 07:39:47
Messages: 4412
Offline

it is a new file and documentation will be added in due time.

Best

Marc

[WWW]
dik_voormekaar



Joined: 23/12/2009 09:40:39
Messages: 22
Offline

Ok, thanks a lot.
singh321654



Joined: 28/04/2010 23:00:09
Messages: 1
Offline

Wow, thanks for the post.

I was also suffering from the same problem and got the solution as soon as I joined the forum.

My pleasure to join the community.

Regards,
[WWW]
dzinerdu



Joined: 19/08/2010 02:19:39
Messages: 11
Offline

Subject: Re:Getting Country, State, City List

http://du.somee.com/combo.asp
dzinerdu



Joined: 19/08/2010 02:19:39
Messages: 11
Offline

dzinerdu wrote:
Subject: Re:Getting Country, State, City List

http://du.somee.com/combo.asp  
yankoff



Joined: 25/08/2010 05:24:55
Messages: 4
Offline

This script http://du.somee.com/combo.asp doesn't work properly. For example if you choose US, then state Californie it will populate you a list of counties and not the list of cities. I came across the same problem.

So the question would be: how to get a list of the cities from hierarchy based on region and skip counties?
marc



Joined: 08/12/2005 07:39:47
Messages: 4412
Offline

a script only on region wouldn't make much sense as you would end up with drop down lists of 10000 and more records. Technically it can easily be implemented with just looking at the admincode1. Beware of cities that are missing admin codes.

Marc

[WWW]
yankoff



Joined: 25/08/2010 05:24:55
Messages: 4
Offline

Got it.

http://ws.geonames.org/search?q=California

And as far as I understand cities have fcode PPL or PPLA?
dzinerdu



Joined: 19/08/2010 02:19:39
Messages: 11
Offline

So friend, good day, a service check of all world cities that lists 100% efficiency will be hard to find, as I just said I took the geonames API to do this search via XMLHHTPS, did not download any file from the webservice only consume, as an example the state has not FRANCE, only cities, and some countries of Africa rsrsrsr my good, has no way to list it 100%, on CALIFORNIA packed there something, go back http://du.somee.com/combooo.asp?uf=5332921&pf=6252001&estado=6252001 more you can not put in alphabetical order.
mcupryk



Joined: 22/02/2011 05:04:53
Messages: 4
Offline

Hi everyone,

I need to get a list of cities.

I do have a file that has weird characters.

I would appreciate any help.

Is there a place I can redownload this file.
marc



Joined: 08/12/2005 07:39:47
Messages: 4412
Offline

Hmm, did you look at the download section of this website?

Marc

[WWW]
mcupryk



Joined: 22/02/2011 05:04:53
Messages: 4
Offline

not sure where to find it in the download section.
kbjayapal


[Avatar]

Joined: 12/04/2011 08:37:16
Messages: 1
Location: India
Offline

I had been working with this for a while and i have created a snippet for myself. Here it is. You can copy the complete page and you can work it out for further usage. This applies to anybody who lands this page.

http://vikku.info/programming/geodata/geonames-get-country-state-city-hierarchy.htm

Just view source that page and download all the includes in script tag. Thats it. I am further expanding my description so in due course of time there will be more information.

http://vikku.info
Todays Beautiful Moments are Tomorrow's Beautiful Memories.
[WWW]
heyholetsgo



Joined: 13/03/2014 14:40:46
Messages: 1
Offline

hello,

i need all infos about:

Continents, Countrys, States/Regions, Cities, Currencys, latitude/longitude, Flags, Laguage, time zones, calling codes, Country Code

Any can help?

Thanks!
gjoshi20



Joined: 18/04/2019 18:39:23
Messages: 2
Offline



hello,

I need to save all Country, State, City List data in my local database.
Can any one help me on this I am not able to dump load data to mysql database.
gjoshi20



Joined: 18/04/2019 18:39:23
Messages: 2
Offline

HI,

I got success to import geoname data in geoname table and hierarchy table and able to get country state and counties information using below mentioned sql queries but still facing issue with city selection please help me on this.

/* Get Countries */
Select * FROM geoname WHERE fCode in ('PCLI') and country='US' and fclass='A'

/* Get all states for US {6252001 } */
Select * from geoname G inner join hierarchy H on H.childid=G.geonameid where G.fcode='ADM1' and h.parentid= 6252001 and G.fclass='A' order by G.name Asc

/* Get all counties for Alabama state {4829764 } */
Select * from geoname G inner join hierarchy H on H.childid=G.geonameid where G.fcode='ADM2' and h.parentid= 4829764 and G.fclass='A' order by G.name Asc

/* Get all City for Autauga County {4830868 } */
Select * from geoname G inner join hierarchy H on H.childid=G.geonameid where h.parentid= 4830868 and G.fclass='P' order by G.name Asc -- G.fcode='PPL' and


 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team