Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 310
Paul Cezanne Avatar asked Oct 22 '25 16:10

Paul Cezanne


2 Answers

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.

like image 58
Chris Broadfoot Avatar answered Oct 27 '25 02:10

Chris Broadfoot


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

like image 45
kexx Avatar answered Oct 27 '25 02:10

kexx



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!