Beispiel #1
0
def _init_and_clear_database():
    # creates database if necessary
    init_database()

    exec_sql("DROP OWNED BY osm_test")

    # prepare schema for tests
    current_directory = os.path.dirname(os.path.realpath(__file__))
    exec_sql_from_file('helpers/schema.sql.dump', cwd=current_directory)
    exec_sql_from_file('helpers/functions.sql', cwd=current_directory)
    export_osmnames.create_functions()

    # necessary for export tests
    if not os.path.exists('/tmp/osmnames/export/'):
        os.makedirs('/tmp/osmnames/export/')
Beispiel #2
0
def import_country_osm_grid():
    exec_sql_from_file("country_osm_grid.sql", cwd="{}/sql/".format(settings.get("DATA_DIR")))
def set_street_attributes_by_nearest_street():
    exec_sql_from_file("set_street_attributes_by_nearest_street.sql", cwd=SQL_DIR)
def schema(engine):
    current_directory = os.path.dirname(os.path.realpath(__file__))
    exec_sql_from_file('fixtures/test_prepare_imported_data.sql.dump',
                       cwd=current_directory)
Beispiel #5
0
def merge_corresponding_linestrings():
    exec_sql_from_file("merge_corresponding_linestrings.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
Beispiel #6
0
def set_country_codes():
    exec_sql_from_file("set_country_codes.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
    consistency_check.missing_country_codes()
Beispiel #7
0
def create_custom_columns():
    exec_sql_from_file("create_custom_columns.sql", cwd=os.path.dirname(__file__))
Beispiel #8
0
def merge_linked_nodes():
    exec_sql_from_file("merge_linked_nodes/merge_nodes_linked_by_relation.sql",
                       cwd=os.path.dirname(__file__))
    vacuum_database()
def set_parent_ids():
    exec_sql_from_file("set_parent_ids.sql", cwd=SQL_DIR)
    vacuum_database()
Beispiel #10
0
def cluster_geometries():
    exec_sql_from_file("cluster_geometries.sql", cwd=SQL_DIR)
    vacuum_database()
Beispiel #11
0
def set_geometry_centers():
    exec_sql_from_file("set_geometry_centers.sql", cwd=SQL_DIR)
    vacuum_database()
Beispiel #12
0
def create_geonames_view():
    exec_sql_from_file("create_geonames_view.sql", cwd=os.path.dirname(__file__))
Beispiel #13
0
def create_housenumbers_view():
    exec_sql_from_file("create_housenumbers_view.sql", cwd=os.path.dirname(__file__))
Beispiel #14
0
def create_merged_linestrings_view():
    exec_sql_from_file("create_merged_linestrings_view.sql", cwd=os.path.dirname(__file__))
Beispiel #15
0
def set_names_from_tags():
    exec_sql_from_file("set_names_from_tags.sql", cwd=SQL_DIR)
Beispiel #16
0
def set_tables_unlogged():
    exec_sql_from_file("set_tables_unlogged.sql",
                       cwd=os.path.dirname(__file__),
                       parallelize=True)
Beispiel #17
0
def set_geometry_centers():
    exec_sql_from_file("set_geometry_centers.sql", cwd=SQL_DIR)
    vacuum_database()
Beispiel #18
0
def set_polygon_types():
    exec_sql_from_file("set_polygon_types.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
Beispiel #19
0
def cluster_geometries():
    exec_sql_from_file("cluster_geometries.sql", cwd=SQL_DIR)
    vacuum_database()
Beispiel #20
0
def delete_unusable_entries():
    exec_sql_from_file("delete_unusable_entries.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
Beispiel #21
0
def set_parent_ids():
    exec_sql_from_file("set_parent_ids.sql", cwd=SQL_DIR)
    vacuum_database()
Beispiel #22
0
def set_place_parentInfo():
    exec_sql_from_file("set_place_parentInfo.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
Beispiel #23
0
def create_custom_columns():
    exec_sql_from_file("create_custom_columns.sql", cwd=os.path.dirname(__file__))
Beispiel #24
0
def create_custom_types():
    exec_sql_from_file("create_custom_types.sql",
                       cwd=os.path.dirname(__file__),
                       user="******")
Beispiel #25
0
def set_linestring_centers():
    exec_sql_from_file("set_linestring_centers.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
Beispiel #26
0
def create_functions():
    exec_sql_from_file("functions.sql", cwd=os.path.dirname(__file__))
Beispiel #27
0
def delete_unusable_entries():
    exec_sql_from_file("delete_unusable_entries.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
def sanitize_housenumbers():
    exec_sql_from_file("sanitize_housenumbers.sql", cwd=SQL_DIR)
Beispiel #29
0
def set_place_ranks():
    exec_sql_from_file("set_place_ranks.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
Beispiel #30
0
def set_country_codes():
    exec_sql_from_file("set_country_codes.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
    consistency_check.missing_country_codes()
Beispiel #31
0
def determine_linked_places():
    exec_sql_from_file("determine_linked_places.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
Beispiel #32
0
def set_linestring_names_from_relations():
    exec_sql_from_file("set_linestring_names_from_relations.sql", cwd=SQL_DIR)
Beispiel #33
0
def merge_corresponding_linestrings():
    exec_sql_from_file("merge_corresponding_linestrings.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
Beispiel #34
0
def create_helper_functions():
    exec_sql_from_file("create_helper_functions.sql",
                       cwd=os.path.dirname(__file__),
                       parallelize=True)
def create_functions():
    exec_sql_from_file("functions.sql", cwd=os.path.dirname(__file__))
Beispiel #36
0
def delete_nameless_entries():
    exec_sql_from_file("delete_nameless_entries.sql",
                       cwd=os.path.dirname(__file__),
                       parallelize=True)
    vacuum_database()
def create_merged_linestrings_view():
    exec_sql_from_file("create_merged_linestrings_view.sql",
                       cwd=os.path.dirname(__file__))
Beispiel #38
0
def follow_wikipedia_redirects():
    exec_sql_from_file("follow_wikipedia_redirects.sql",
                       cwd=os.path.dirname(__file__))
    vacuum_database()
def create_housenumbers_view():
    exec_sql_from_file("create_housenumbers_view.sql",
                       cwd=os.path.dirname(__file__))
Beispiel #40
0
def set_linestring_centers():
    exec_sql_from_file("set_linestring_centers.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
def create_geonames_view():
    exec_sql_from_file("create_geonames_view.sql",
                       cwd=os.path.dirname(__file__))
Beispiel #42
0
def set_place_ranks():
    exec_sql_from_file("set_place_ranks.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
def merge_nodes_linked_by_relation():
    exec_sql_from_file("merge_nodes_linked_by_relation.sql", cwd=SQL_DIR)
    vacuum_database()
Beispiel #44
0
def determine_linked_places():
    exec_sql_from_file("determine_linked_places.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
def set_street_attributes_by_street_relation_members():
    exec_sql_from_file("set_street_attributes_by_street_relation_members.sql", cwd=SQL_DIR)
Beispiel #46
0
def add_missing_streetnames_postcodes_cities():
    exec_sql_from_file("add_missing_streetnames_postcodes_cities.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
def set_street_names_by_relation_attributes():
    exec_sql_from_file("set_street_names_by_relation_attributes.sql", cwd=SQL_DIR)
Beispiel #48
0
def remove_duplicate_entries():
    exec_sql_from_file("remove_duplicate_entries.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
def normalize_street_names():
    exec_sql_from_file("normalize_street_names.sql", cwd=SQL_DIR)
Beispiel #50
0
def schema(engine):
    current_directory = os.path.dirname(os.path.realpath(__file__))
    exec_sql_from_file('fixtures/test_export_osmnames.sql.dump', cwd=current_directory)
    create_functions()
def set_street_ids_by_street_name():
    exec_sql_from_file("set_street_ids_by_street_name.sql", cwd=SQL_DIR)
Beispiel #52
0
def import_country_osm_grid():
    exec_sql_from_file("country_osm_grid.sql",
                       cwd="{}/sql/".format(settings.get("DATA_DIR")))
Beispiel #53
0
def create_custom_types():
    exec_sql_from_file("create_custom_types.sql", cwd=os.path.dirname(__file__), user="******")