Example #1
0
# To search efficiently
from sklearn.neighbors import KDTree

# To connect to databases
from helperFunctions import Graph
from helperFunctions import connectZEO
from helperFunctions import connectMySQL
from helperFunctions import connectMongo
from helperFunctions import containerWait
from helperFunctions import managementUpdate
from helperFunctions import managementCompare

##### Run Program

# Wait for the MySQL server to start
containerWait()

try:

    # Connect to ZODB
    root = connectZEO()

    # Connect to MongoDb
    cluster, db_mongo, collection = connectMongo(collection='shortest')

    # Connect to MySQL and get cursor
    db_mysql, cur = connectMySQL()

    ##### Iterate Over All Cities And Download OSM-Graph

    # Iterate over all cities
Example #2
0
import os

# To connect to databases
from helperFunctions import connectMySQL
from helperFunctions import containerWait
from helperFunctions import managementUpdate

##### Setup Program

# Folder for the data files to load
folder_data = 'data'

##### Run Program

# Wait for the MySQL server to start
containerWait(sleep=20)

try:

    # Connect to MySQL and get cursor
    db_mysql, cur = connectMySQL()

    ##### Check If Update Is Needed

    # Get last insert-timestamp
    sql_query = 'SELECT last_location_insert FROM management WHERE id=1'
    cur.execute(sql_query)
    time_insert = cur.fetchone()

    # Get last file-timestamp
    time_files = max([