| Author |
Message |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 10/04/2007 14:20:00
|
szymon
Joined: 10/04/2007 14:13:53
Messages: 7
Offline
|
Hi there,
I ran a forum search before asking, both for IATA (found the cities thread) and for JSON, but I found nothing that seemed relevant; please point me at the thread if I missed it
I'm trying to use JSON calls to ws.geonames.org to pick up geographical locations of airports by IATA airport code. I have things working fine, but there seem to be a couple of anomalies:
1. ORD, the IATA code for Chicago international airport, seems to also find "Ord Mountain Heliport":
http://ws.geonames.org/searchJSON?name=ORD&fcode=AIRP&callback=blah
This one is tricky, because both of them have an fcodeName as "airport", and an fcode of "AIRP". Is there a specific way of searching just for IATA coded airports?
2. Tokyo doesn't exist:
http://ws.geonames.org/searchJSON?name=TYO&fcode=AIRP&callback=blah
I haven't tried all of the IATA codes, but this one happened to come up - it's a valid code but returns no results
Sorry to be a complainer on my first post! If it's something I'm doing wrong on the request, please let me know.
Many thanks,
-simon
|
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 10/04/2007 15:03:58
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4501
Offline
|
Hi Simon
1. You can use the 'name_equals' parameter instead of the 'name' parameter to get the IATA name :
http://ws.geonames.org/searchJSON?name_equals=ORD&fcode=AIRP&callback=blah&formatted=tr
If this is not enough for your needs we will have to use a new service to access directly a toponym with a third party Id.
2. Which airport in Tokyo has the IATA code TYO? "Tokyo International Airport" has the IATA code HND and "Narita International Airport" has the code NRT.
Cheers
Marc
|
 |
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 10/04/2007 17:58:04
|
szymon
Joined: 10/04/2007 14:13:53
Messages: 7
Offline
|
Hi Marc,
Ooh, looks like name_equals should do what I need
Regarding TYO, it seems that this is my bad. It appears that TYO is the Tokyo Metropolitan Area Airport Code, covering both Narita International Airport and Haneda Domestic Airport, like LON is for LHR LGW and LCY. I guess I'm just used to it working in other flight related applications
Many thanks for the help and the prompt replies!
-simon
marc wrote:
Hi Simon
1. You can use the 'name_equals' parameter instead of the 'name' parameter to get the IATA name :
http://ws.geonames.org/searchJSON?name_equals=ORD&fcode=AIRP&callback=blah&formatted=tr
If this is not enough for your needs we will have to use a new service to access directly a toponym with a third party Id.
2. Which airport in Tokyo has the IATA code TYO? "Tokyo International Airport" has the IATA code HND and "Narita International Airport" has the code NRT.
Cheers
Marc
|
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 10/04/2007 20:54:11
|
szymon
Joined: 10/04/2007 14:13:53
Messages: 7
Offline
|
Marc,
Thanks for your help thusfar. One more quick question - is your intention to cover all IATA codes? I'll stop posting about missing ones if not
MSN is meant to be Dane County Regional airport, according to http://www.airlinecodes.co.uk/aptcoderes.asp but it doesn't seem to exist on geonames:
http://ws.geonames.org/searchJSON?name_equals=MSN&fcode=AIRP&callback=blah&formatted=tr
Incidentally, here is a link to what I'm playing with:
http://www.kapadia.pl/itinmap.html
It's just a very simple mapping of complex itineraries for people on the flyertalk forum,
http://www.flyertalk.com/forum/showthread.php?p=7558772
when doing huge "mileage runs" (complex multi-destination flights to get somewhere gaining a large amount of miles).
-simon
|
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 10/04/2007 21:20:27
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4501
Offline
|
Hi Simon
Dane County Regional airport was already in our database but the iata code was missing :
http://www.geonames.org/5250078/dane-county-regional-airport-truax-field.html
Please feel free to add missing codes or airports. For the code just add them as alternate names with the language codes 'iata' or 'icao'.
Cheers
Marc
|
 |
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 10/04/2007 22:33:52
|
szymon
Joined: 10/04/2007 14:13:53
Messages: 7
Offline
|
Many thanks for the explanation. I've also added YYZ for Toronto, and will modify any others if people report them to me
-simon
|
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 11/04/2007 08:24:34
|
szymon
Joined: 10/04/2007 14:13:53
Messages: 7
Offline
|
Hullo again,
Well, it looks like I've found one for which name_equals isn't enough MAN should bring back Manchester Airport, England, but it also (very legitimately) brings back MAN Airport on the Ivory Coast (which is iata MJC).
http://ws.geonames.org/searchJSON?name_equals=MAN&fcode=AIRP&callback=blah&formatted=tr
Is there any way we could add the alternate names into the json output for the Web Service? That way I could filter on them and know which record to use? Alternatively, how much pain is it to do what you suggested earlier and create a new service to access directly a toponym with a third party ID?
Thanks,
-simon
|
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 11/04/2007 08:34:37
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4501
Offline
|
Hi Simon
If you don't need the airport name you can add the lang parameter to ask for the pseudo language IATA. The service will then return the name in the requested language and you can filter the one you need.
http://ws.geonames.org/searchJSON?name_equals=MAN&fcode=AIRP&formatted=tr&lang=iata
The service based on the id would not be too much work. (an hour or two)
Cheers
Marc
|
 |
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 11/04/2007 09:13:54
|
szymon
Joined: 10/04/2007 14:13:53
Messages: 7
Offline
|
Hmm, ok I understand how that works. The trouble is I'm using the long name as a display. I suppose I could make two calls - one to make sure I'm getting the right record by cross-referencing the IATA name, then a second one to get the "real" name, and cross-reference the IDs. But this means two sets of callbacks per airport, meaning a much slower end user experience, and twice as much load on the servers, which disturbs my sense of peace in the world.
Is there any way you could "tweak" the existing service to optionally return the results in more than one language? I can see that this might also be useful for multi-lingual web sites (get the result in both English and French, for instance), so perhaps it's not just an isolated piece of work!
Cheers,
-simon
|
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 11/04/2007 18:19:00
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4501
Offline
|
Hi Simon
You can now add the paramter style=FULL to get the alternate names :
http://ws.geonames.org/searchJSON?name_equals=MAN&fcode=AIRP&formatted=tr&lang=iata&style=full
Cheers
Marc
|
 |
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 11/04/2007 19:47:19
|
szymon
Joined: 10/04/2007 14:13:53
Messages: 7
Offline
|
Marc,
You totally rock. Thanks
-simon
|
|
|
 |
|
|