Get only IATA code with geocoding

后端 未结 3 1035
囚心锁ツ
囚心锁ツ 2021-02-13 20:49

How can I have just the IATA codes with Google Maps? I just found out how to get the address and city, but I need to grab just the IATA code, like NYC or JFK etc. How can I do t

3条回答
  •  耶瑟儿~
    2021-02-13 21:26

    The Google geocoder will not return the IATA code if you reverse geocode a location. It does return a location if you give it an IATA code.

    You can geocode KJFK at https://google-developers.appspot.com/maps/documentation/javascript/examples/geocoding-simple (it places a marker at 40.64384360,-73.78230350).

    If you reverse-geocode that location with https://developers.google.com/maps/documentation/javascript/examples/geocoding-reverse you get lots of data but neither three-letter nor four-letter code are included. (The formatted address includes "JFK" but that can't be guaranteed: you would need it as an identifiable data item)

    If you want to find an IATA code for a particular location, you will need to use another resource.

提交回复
热议问题