Get only IATA code with geocoding

大城市里の小女人 提交于 2019-12-05 14:16:50

问题


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 that?

Thanks for your help.


回答1:


You could use the Global Airport Database. It has GPS coordinates.




回答2:


You can try use this service:

GET Request Params: http://iatageo.com/getCode/{lat}/{lng}

GET Request Example: http://iatageo.com/getCode/-15.4343434/-47.323232

This will return a JSON, for example:

{
  "code": "BSB",
  "distance_meters": "127763.232556459"
}
      



回答3:


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.



来源:https://stackoverflow.com/questions/10872154/get-only-iata-code-with-geocoding

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!