mirror of
https://github.com/DerTyp7/local-analyzer-python.git
synced 2025-10-29 12:32:10 +01:00
get shops
This commit is contained in:
18
main.py
18
main.py
@@ -1,9 +1,14 @@
|
||||
from osm import OSM
|
||||
from places import Shops
|
||||
from publicTransport import PublicTransportAccessibility
|
||||
import requests
|
||||
|
||||
# 52.9152386,,15.96z
|
||||
# bhv 53.51500036203292, 8.603602165157444
|
||||
lon = 8.603602165157444 # 8.6039883
|
||||
lat = 53.51500036203292 # 52.51608
|
||||
|
||||
# TODO Get User input
|
||||
lon = 8.8285578 # 8.6039883
|
||||
lat = 52.9152386 # 52.51608
|
||||
|
||||
# TODO Get real value based on a metric radius
|
||||
areaHeightRadius = 0.01 # 0.01
|
||||
@@ -21,18 +26,19 @@ requestsUrlParams = f"?bbox={minLon},{minLat},{maxLon},{maxLat}"
|
||||
print(requestUrl + requestsUrlParams)
|
||||
|
||||
print("Downloading OSM-File...")
|
||||
# TODO Check if banned from overpass-api
|
||||
# TODO Check if banned from overpass-api MAYBE get alternative API then
|
||||
r = requests.get(requestUrl + requestsUrlParams, headers={'Content-Type': 'application/xml'})
|
||||
print("Done: Downloading OSM-File")
|
||||
|
||||
|
||||
|
||||
osm = OSM(r.text)
|
||||
pta = PublicTransportAccessibility(osm)
|
||||
shops = Shops(osm)
|
||||
|
||||
print("Bus:" + str(pta.isBusAccessible()))
|
||||
print("Tram:" + str(pta.isTramAccessible()))
|
||||
print("Light Rail:" + str(pta.isLightRailAccessible()))
|
||||
print("Subway:" + str(pta.isSubwayAccessible()))
|
||||
print("Train:" + str(pta.isTrainAccessible()))
|
||||
print("Monorail:" + str(pta.isMonorailAccessible()))
|
||||
print("Monorail:" + str(pta.isMonorailAccessible()))
|
||||
|
||||
print(shops.countOfShops())
|
||||
|
||||
Reference in New Issue
Block a user