filmov
tv
Get Geographical Coordinates from Google Maps API for any Address. Real Python example.

Показать описание
Python is very flexible tool to get any available data from Google Maps API server to your working data structure (as Pandas Dataframe).
Google Maps API provide a wide range of data about requested records by returning a dictionary of data back to your project.
In this example I use just random addresses of real estate properties from Zoopla for get geographical coordinates (as latitudes and longitudes) for them. This is how you can convert any address or name of location to geographical coordinates by API service.
This video contained of 3 parts: the first one is how to get Google Maps API key and second one - how to write Python code to get latitudes and longitudes for the properties. And the 3rd part demonstrates how result of geocoding is looking.
The content of the video:
Part 1. Get Google Maps API key for using. 0:03
# 1. 0:07 Go to Google Console page
# 2. 0:14 Create a new API project if do not have it yet
# 3. 0:24 Create a new API key for API project
# 4. 0:35 Give a name for API key for identification
# 5. 0:42 Check restrictions for API. There should be None.
# 6. 0:56 Give access to Google Maps API for geocoding (press Enable there!)
Part 2: Write python code for create data structure by including latitudes and longitudes from Google server.
In this part we will use Pandas module for manipulating records of data.
# Task of project: 1:18
# 1. 1:25 Import googlemaps module to the project
# 2. 1:33 Set Google Maps API key from Google Console API page
# 3. 1:50 Copy key from Google Console API page and paste it to Python code
# 4. 2:04 Create Geocode object. This is full dataset for an object from Google server
# 5. 2:09 Create empty columns in Pandas Dataframe that will store dat for Latitudes and Longitudes.
# 6. 2:23 Go through all objects and get Latitudes and Longitudes for them.
# 3:10 Get the value of latitude from result of request to Google API.
# 3:52 Write values to Pandas dataset (to LAT and LON columns)
# 4:27 Tell the model what to do if the request return False.
# 4:39 Testing the project.
# 4:59 Part 3. What is result of geocoding?
You can get much more data Google Maps API results.
Google Maps API provide a wide range of data about requested records by returning a dictionary of data back to your project.
In this example I use just random addresses of real estate properties from Zoopla for get geographical coordinates (as latitudes and longitudes) for them. This is how you can convert any address or name of location to geographical coordinates by API service.
This video contained of 3 parts: the first one is how to get Google Maps API key and second one - how to write Python code to get latitudes and longitudes for the properties. And the 3rd part demonstrates how result of geocoding is looking.
The content of the video:
Part 1. Get Google Maps API key for using. 0:03
# 1. 0:07 Go to Google Console page
# 2. 0:14 Create a new API project if do not have it yet
# 3. 0:24 Create a new API key for API project
# 4. 0:35 Give a name for API key for identification
# 5. 0:42 Check restrictions for API. There should be None.
# 6. 0:56 Give access to Google Maps API for geocoding (press Enable there!)
Part 2: Write python code for create data structure by including latitudes and longitudes from Google server.
In this part we will use Pandas module for manipulating records of data.
# Task of project: 1:18
# 1. 1:25 Import googlemaps module to the project
# 2. 1:33 Set Google Maps API key from Google Console API page
# 3. 1:50 Copy key from Google Console API page and paste it to Python code
# 4. 2:04 Create Geocode object. This is full dataset for an object from Google server
# 5. 2:09 Create empty columns in Pandas Dataframe that will store dat for Latitudes and Longitudes.
# 6. 2:23 Go through all objects and get Latitudes and Longitudes for them.
# 3:10 Get the value of latitude from result of request to Google API.
# 3:52 Write values to Pandas dataset (to LAT and LON columns)
# 4:27 Tell the model what to do if the request return False.
# 4:39 Testing the project.
# 4:59 Part 3. What is result of geocoding?
You can get much more data Google Maps API results.
Комментарии