How do I get the name of the type of administrative_area_level_1, 2, etc

﹥>﹥吖頭↗ 提交于 2019-12-11 04:02:14

问题


I'm using the Google Maps API. I understand how to make queries and parse the JSON that comes back.

What I'd like to be able to do is get name of the administrative_area_level_1's type. For example, in the United States administrative_area_level_1 is a state, in Canada, it is a Province. (Strictly speaking, it can be a Province or a Territory, just like in the USA we have States and Territories.)

I'm looking for the word "State" or "Province" or whatever the location uses for its 1st, 2nd, and 3rd administrative areas. So this might not even be a Google Maps API question, but rather a localization question, but i think it pertains to Google Maps API, unless, of course, the API is just implementing an recognized standard.

Thanks!


回答1:


Unfortunately this is not easily accessible. Basically what is returned by the geocoder matches Google's internal representation of that geometry. The mapping between administrative_area differs for each country.




回答2:


Your best shot is to formalize the data you find on the wiki page, which is the collection of names and terms in postal addresses around the world:

https://en.wikipedia.org/wiki/Table_of_administrative_divisions_by_country



来源:https://stackoverflow.com/questions/8727981/how-do-i-get-the-name-of-the-type-of-administrative-area-level-1-2-etc

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