Regions of England in the Google Maps API

I have a latitude / longitude list that points to some cities in England. For each of these coordinates, I want to get the area they belong to.

By area, I mean one of them: https://en.wikipedia.org/wiki/Regions_of_England

For example: for coordinates (53.38112, -1.47008), i.e. Sheffield, I need to find Yorkshire and the Humber .

To achieve this, I tried using the Google Reverse Geocoding API:

https://maps.googleapis.com/maps/api/geocode/json?latlng=53.38112,-1.47008&key=

Then Google tells me that:

  • country UK
  • administrator_area_level_1 England , which is a state (or species)
  • administrator_area_level_2 South Yorkshire which is the county seat
  • administrator_area_level_3 Sheffield district , which is the district

So Google returns me the correct state, county, and county. However, the region is missing. Is there a way to get it?

+3


source to share


2 answers


Looking at the documentation I don't think the google API returns such information.



An alternative way to get around this would be to build a list of which environments belong to which of the 9 regions, and then search for a region based on the county name. Obviously it will be a little work on your part translating all the county names into the list.

+2


source


Until this answers directly to your request, you can use a set of polygons that track areas and a point in the polygon algorithm (this example is in PHP, but the algorithm exists in many languages) that will allow you to check which of the areas has latitude and longitude in



+2


source







All Articles