Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this assignment you will write a Python program somewhat similar tohttp://www.py4e.com/code3/geojson.py. The program will prompt for a location, contact a web service and retrieve

In this assignment you will write a Python program somewhat similar tohttp://www.py4e.com/code3/geojson.py. The program will prompt for a location, contact a web service and retrieve JSON for the web service and parse that data, and retrieve the firstplace_idfrom the JSON. A place ID is a textual identifier that uniquely identifies a place as within Google Maps.API End Points

To complete this assignment, you should use this API endpoint that has a static subset of the Google Data:

http://py4e-data.dr-chuck.net/json? 

This API uses the same parameter (address) as the Google API. This API also has no rate limit so you can test as often as you like. If you visit the URL with no parameters, you get "No address..." response.To call the API, you need to include akey=parameter and provide the address that you are requesting as theaddress=parameter that is properly URL encoded using theurllib.parse.urlencode()function as shown inhttp://www.py4e.com/code3/geojson.py

Make sure to check that your code is using the API endpoint is as shown above. You will getdifferentresults from thegeojsonandjsonendpoints so make sure you are using the same end point as this autograder is using.

Test Data / Sample Execution

You can test to see if your program is working with a location of "South Federal University" which will have aplace_idof "ChIJ9e_QQm0sDogRhUPatldEFxw".

$ python3 solution.py Enter location: South Federal University Retrieving http://... Retrieved 2291 characters Place id ChIJ9e_QQm0sDogRhUPatldEFxw 

Turn In

Please run your program to find theplace_idfor this location:

MSU 

Make sure to enter the name and case exactly as above and enter theplace_idand your Python code below. Hint: The first seven characters of theplace_idare "ChIJY42 ..."

Make sure to retreive the data from the URL specified above andnotthe normal Google API. Your program should work with the Google API - but theplace_idmay not match for this assignment.

place_id:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions