|
| 1 | +> Build :innocent: using Google Geocoding :joy: API for Visualizing data on Google Map. :mag: |
1 | 2 |
|
2 |
| -Language Used-python. |
3 |
| -API Used- Google Geocoding. |
4 | 3 |
|
5 |
| - |
6 | 4 |
|
| 5 | +### Description |
7 | 6 |
|
8 |
| -Using the Google Geocoding API with a Database and Visualizing data on Google Map. |
9 |
| -In this project, we are using the Google geocoding API to clean up some user-entered geographic locations of |
10 |
| -university names and then placing the data on a Google Map. |
| 7 | +* In this project, we are using the Google geocoding API to clean up some user-entered geographic locations of |
| 8 | + university names and then placing the data on a Google Map. (Where.data contains user-entered Data !). |
| 9 | + |
| 10 | +### Installation Instructions :grey_exclamation: |
11 | 11 |
|
12 |
| -The first problem to solve is that the Google geocoding API is rate limited to 2500 requests per day. |
13 |
| -So if you have a lot of data you might need to stop and restart the lookup process several times. So we break the problem into two |
14 |
| -phases. |
| 12 | +* clone or download the repo. into any fresh temporary folder. |
15 | 13 |
|
16 |
| -In the first phase we take our input data in the file (where.data) and read it one line at a time, and retreive the |
17 |
| -geocoded response and store it in a database (geodata.sqlite).Before we use the geocoding API, we simply check to see |
18 |
| -if we already have the data for that particular line of input.You can re-start the process at any time by removing the file |
19 |
| -geodata.sqlite. |
20 |
| -Run the geoload.py program.This program will read the input lines in where.data and for each line check to see if it is already |
21 |
| -in the database and if we don't have the data for the location,call the geocoding API to retrieve the data and store it in |
22 |
| -the database. |
23 |
| -The geoload.py can be stopped at any time, and there is a counter that you can use to limit the number of calls to the geocoding |
24 |
| -API for each run. |
25 |
| -Once you have some data loaded into geodata.sqlite, you can visualize the data using the (geodump.py) program. This |
26 |
| -program reads the database and writes tile file (where.js) with the location, latitude, and longitude in the form of |
27 |
| -executable JavaScript code. |
| 14 | +* cd into that root folder you just cloned locally. |
28 | 15 |
|
29 |
| -A run of the geodump.py program records written to where.js Open where.html to view the data in a browser |
30 |
| -The file (where.html) consists of HTML and JavaScript to visualize a Google Map. It reads the most recent data in where.js to get |
31 |
| -the data to be visualized. |
| 16 | +* if you want to enter user defined data then please enter it in where.data file just add the name of the place,institution you want to visualize on the map. |
32 | 17 |
|
33 |
| -This is a JavaScript list of lists. The syntax for JavaScript list constants is very similar to Python so the syntax should |
34 |
| -be familiar to you. |
| 18 | +* Run geodump.py to read the data from the database so you can visualize it on a map. |
35 | 19 |
|
36 |
| -Simply open where.html in a browser to see the locations. You can hover over each map pin to find the location that the |
37 |
| -gecoding API returned for the user-entered input. If you cannot see any data when you open the where.html file, you might |
38 |
| -want to check the JavaScript or developer console for your browser. |
| 20 | +* Run geoload.py to write records to where.js. |
| 21 | + |
| 22 | +* Open where.html to view the data in a browser. |
| 23 | + |
| 24 | +### How it Works ! |
| 25 | + |
| 26 | +* In the first phase we take our input data in the file (where.data) and read it one line at a time, and retreive the |
| 27 | + geocoded response and store it in a database (geodata.sqlite).Before we use the geocoding API, we simply check to see |
| 28 | + if we already have the data for that particular line of input.You can re-start the process at any time by removing the file |
| 29 | + geodata.sqlite. |
| 30 | + |
| 31 | +* Run the geoload.py program.This program will read the input lines in where.data and for each line check to see if it is already in the database and if we don't have the data for the location,call the geocoding API to retrieve the data and store it in the database. |
| 32 | + |
| 33 | +* The geoload.py can be stopped at any time, and there is a counter that you can use to limit the number of calls to the geocoding API for each run.Once you have some data loaded into geodata.sqlite, you can visualize the data using the (geodump.py) program. This program reads the database and writes tile file (where.js) with the location, latitude, and longitude in the form of executable JavaScript code. |
| 34 | + |
| 35 | +* A run of the geodump.py program records written to where.js Open where.html to view the data in a browser The file (where.html) consists of HTML and JavaScript to visualize a Google Map. It reads the most recent data in where.js to get |
| 36 | + the data to be visualize. |
| 37 | + |
| 38 | +* This is a JavaScript list of lists. The syntax for JavaScript list constants is very similar to Python so the syntax should be familiar to you. |
| 39 | + |
| 40 | +* Simply open where.html in a browser to see the locations. You can hover over each map pin to find the location that the gecoding API returned for the user-entered input. If you cannot see any data when you open the where.html file, you might |
| 41 | + want to check the JavaScript or developer console for your browser. |
| 42 | + |
| 43 | + |
| 44 | +* I have attached screenshots below depicting various features of applicationIn the first phase we take our input data in the file (where.data) and read it one line at a time, and retreive the |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | +### Examples ! |
| 49 | + |
| 50 | + |
39 | 51 |
|
40 | 52 |
|
0 commit comments