GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
hierarchy data and parents for all areas/places  XML
Forum Index -> FAQ - frequently asked questions
Author Message

Joined: 11/02/2017 20:41:32
Messages: 10

Hello All

I am just starting with GeoNames and trying to work it into the format we need.
(i am using the data in MySQL)

I need to be able to get the parent of every/any area (fclass = P) (and all direct children of an area too).

from initial looks, it seems i would need to do this by looping over admin areas (and country). Am i correct in thinking this?

I note from the hierarchy.txt file that this does not include all parents (or children) .
E.G SELECT * FROM hierarchy where childId = 2643620 (Longton)
this gives no results, but should give 2636841 as the parent (Stoke-on-Trent)

So that my SQL is fast, i dont think looping over the admin areas will do for what we need (feel free to correct me if i am wrong and it will be very fast!).

Any ideas?
would i be better writing an export script to make an updated hierarchy table, to include all the parents and children i need? or am i getting confused and not seeing the obvious method? (if the export script is what i need, does anyone already have a script they would like to share or is there a .txt file with the full hierarchy data already in it?)
Or does the premium data have anything like this?

on a side note: i am also going to need a "predictive text search" so will likely need to re-arrange the data to make this "as fast as a user can type". Again any ideas or information on the best found method of doing this?

Hopefully i am not being too silly in my initial confusion at the geoNames data (kudos to putting this together, it is great but confusing to get my head around. i am glad you wrote it and not me )

If anyone can point me in the right direction or offer their experience with this, i would be very grateful.

Forum Index -> FAQ - frequently asked questions
Go to:   
Powered by JForum 2.1.5 © JForum Team