make stops sources configurable
This commit is contained in:
parent
21629aa377
commit
8b720fd8a9
|
|
@ -9,21 +9,15 @@ from amarillo.plugins.enhancer.services import stops
|
||||||
from amarillo.plugins.enhancer.services import trips
|
from amarillo.plugins.enhancer.services import trips
|
||||||
from amarillo.plugins.enhancer.services.carpools import CarpoolService
|
from amarillo.plugins.enhancer.services.carpools import CarpoolService
|
||||||
from amarillo.plugins.enhancer.services import gtfs_generator
|
from amarillo.plugins.enhancer.services import gtfs_generator
|
||||||
|
from amarillo.services.config import config
|
||||||
from amarillo.configuration import configure_services
|
from amarillo.configuration import configure_services
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
def configure_container():
|
||||||
def configure_enhancer_services():
|
|
||||||
configure_services()
|
|
||||||
|
|
||||||
logger.info("Load stops...")
|
logger.info("Load stops...")
|
||||||
stop_sources = [
|
with open(config.stop_sources_file) as stop_sources_file:
|
||||||
{"url": "https://datahub.bbnavi.de/export/rideshare_points.geojson", "vicinity": 50},
|
stop_sources = json.load(stop_sources_file)
|
||||||
{"url": "https://data.mfdz.de/mfdz/stops/stops_zhv.csv", "vicinity": 50},
|
|
||||||
{"url": "https://data.mfdz.de/mfdz/stops/parkings_osm.csv", "vicinity": 500},
|
|
||||||
]
|
|
||||||
stop_store = stops.StopsStore(stop_sources)
|
stop_store = stops.StopsStore(stop_sources)
|
||||||
|
|
||||||
stop_store.load_stop_sources()
|
stop_store.load_stop_sources()
|
||||||
|
|
@ -31,6 +25,10 @@ def configure_enhancer_services():
|
||||||
container['trips_store'] = trips.TripStore(stop_store)
|
container['trips_store'] = trips.TripStore(stop_store)
|
||||||
container['carpools'] = CarpoolService(container['trips_store'])
|
container['carpools'] = CarpoolService(container['trips_store'])
|
||||||
|
|
||||||
|
def configure_enhancer_services():
|
||||||
|
configure_services()
|
||||||
|
configure_container()
|
||||||
|
|
||||||
logger.info("Restore carpools...")
|
logger.info("Restore carpools...")
|
||||||
|
|
||||||
for agency_id in container['agencies'].agencies:
|
for agency_id in container['agencies'].agencies:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue