Answered step by step
Verified Expert Solution
Question
1 Approved Answer
import my_overpass api = my_overpass.API() qs = my_overpass.MapQuery(38.799, -77.041, 38.801, -77.039) features = api.Get(qs) for feat in features: print(feat) the guidelines the sample output: In
import my_overpass api = my_overpass.API() qs = my_overpass.MapQuery(38.799, -77.041, 38.801, -77.039) features = api.Get(qs) for feat in features: print(feat)
the guidelines
the sample output:
In the specified bounding box surrounding (38.8,-77.04): + There are 1 water sources:
river + There are 45 buildings, named buildings include:
Robinson Terminal + There are 2 places of leisure, named areas include:
Windmill Hill Park Shipyard Park
In the specified bounding box surrounding (39.167,-78.156): + There are no water sources: + There are 6 buildings, named buildings include:
Campus Maintenance Wilkins Administration Bldg Goodson Chapel & Recital Hall Aikens Athletic Center Maintenance Shop Shingleton Hall
+ There are 4 places of leisure, named areas include: Harry W Aikens Field Aikens Athletic Center
Programming language: Python, need help coding this question, especially the three functions and the user input.
OSM Parsing. This assignment will query OpenStreetMap (OSM) using a lightweight python wrapper named Overpass: github link. Prerequisites: In order to painlessly install this module you will need to use pip package manager (Follow the directions in the course material page for installing). Then in the command-line you can just type 'pip install overpass You can verify the install by running python, and in script mode >>> import overpass If no error! then it is installed! Yay! OSM Learning Goals 1. Use a PyPl module - successfully load and execute a query on OSM 2. Create at least 3 custom functions getWaterFeatures(feats) getBuilding Features(feats) getPlacesOfLeiesure(feats) 3. For each of the above functions: Iterate through features to count the features of each type: ['Water','Building','Leisure'l and extract any feature that is named... Should return a number and a list of names. Takes as parameter the list of features from a bounding box. 4. Put together a program that asks the user for a latitude and longitude (how to input is up to you so long as the Ul is clear) 5. Call overpass functions and your functions to provide appropriate output, and format it to match the examples at the end... 6. When calling MapQuery use a small bounding box as shown on the next slide (2 thousandths of a degree) Below is an example of using overpass: A >>> import overpass >>> api = overpass.API() > qs = overpass.MapQuery (38.799, -77.041, 38.801, -77.039) >>> response = api.Get (as) >>> feats = response [' features'] >>> print (type (feats))Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started