The project can do a brand or a category nearby search for specific locations, and get the Geodata into an excel document as tabular format. For example, you want to know how many fast-food restaurants (includes addresses) within 5 miles of Ivy League schools.
This was created and tested using Python3.7 and using some libraries including openpyxl, googlemaps, prettyprinter, urllib3. These libraries are needed. To install with pip:
pip install openpyxl
pip install googlemaps
pip install urllib3
pip install prettyprinter
The project also requires Google Map API Key. Please register and fill your API Key into the program.
api_key = 'Enter your Google Map API HERE'
if api_key is False:
print("API is False")
else:
serviceurl = 'https://maps.googleapis.com/maps/api/geocode/json?'
Download my repository
https://github.com/nathanliu100/googlemap/releases/tag/v1.0
- Download the new release file
- Go to the 'py' folder and you will see 'ingeneral_Geotargeting.py' file
- Open the file and execute the code, you will see this as follow
Create a Workbook As:
*15 miles = 24140 meters
*10 miles = 16093 meters
*5 miles = 8047 meters
The maximum of the radius: 50,000 meters
Set the Store Name:
Set the Store's Type:
Set the radius (meters):
Enter file name:
! After seeing this as follows, which means you successfully run the program
! After that, check your py folder, and you will see a demo1.xlsx
! The excel doc looks like this
! If you clean up the data as the following format, you will able to do some data analysis
! Also attached an example, the chart demonstrates a list of how many individual fast-food stores within 5 miles of Ivy League schools
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request