예제 #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/')
예제 #2
0
def import_country_osm_grid():
    exec_sql_from_file("country_osm_grid.sql", cwd="{}/sql/".format(settings.get("DATA_DIR")))
예제 #3
0
def set_street_attributes_by_nearest_street():
    exec_sql_from_file("set_street_attributes_by_nearest_street.sql", cwd=SQL_DIR)
예제 #4
0
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)
예제 #5
0
def merge_corresponding_linestrings():
    exec_sql_from_file("merge_corresponding_linestrings.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
예제 #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()
예제 #7
0
def create_custom_columns():
    exec_sql_from_file("create_custom_columns.sql", cwd=os.path.dirname(__file__))
예제 #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()
예제 #9
0
def set_parent_ids():
    exec_sql_from_file("set_parent_ids.sql", cwd=SQL_DIR)
    vacuum_database()
예제 #10
0
def cluster_geometries():
    exec_sql_from_file("cluster_geometries.sql", cwd=SQL_DIR)
    vacuum_database()
예제 #11
0
def set_geometry_centers():
    exec_sql_from_file("set_geometry_centers.sql", cwd=SQL_DIR)
    vacuum_database()
예제 #12
0
def create_geonames_view():
    exec_sql_from_file("create_geonames_view.sql", cwd=os.path.dirname(__file__))
예제 #13
0
def create_housenumbers_view():
    exec_sql_from_file("create_housenumbers_view.sql", cwd=os.path.dirname(__file__))
예제 #14
0
def create_merged_linestrings_view():
    exec_sql_from_file("create_merged_linestrings_view.sql", cwd=os.path.dirname(__file__))
예제 #15
0
def set_names_from_tags():
    exec_sql_from_file("set_names_from_tags.sql", cwd=SQL_DIR)
예제 #16
0
def set_tables_unlogged():
    exec_sql_from_file("set_tables_unlogged.sql",
                       cwd=os.path.dirname(__file__),
                       parallelize=True)
예제 #17
0
def set_geometry_centers():
    exec_sql_from_file("set_geometry_centers.sql", cwd=SQL_DIR)
    vacuum_database()
예제 #18
0
def set_polygon_types():
    exec_sql_from_file("set_polygon_types.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
예제 #19
0
def cluster_geometries():
    exec_sql_from_file("cluster_geometries.sql", cwd=SQL_DIR)
    vacuum_database()
예제 #20
0
def delete_unusable_entries():
    exec_sql_from_file("delete_unusable_entries.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
예제 #21
0
def set_parent_ids():
    exec_sql_from_file("set_parent_ids.sql", cwd=SQL_DIR)
    vacuum_database()
예제 #22
0
def set_place_parentInfo():
    exec_sql_from_file("set_place_parentInfo.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
예제 #23
0
def create_custom_columns():
    exec_sql_from_file("create_custom_columns.sql", cwd=os.path.dirname(__file__))
예제 #24
0
def create_custom_types():
    exec_sql_from_file("create_custom_types.sql",
                       cwd=os.path.dirname(__file__),
                       user="******")
예제 #25
0
def set_linestring_centers():
    exec_sql_from_file("set_linestring_centers.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
예제 #26
0
def create_functions():
    exec_sql_from_file("functions.sql", cwd=os.path.dirname(__file__))
예제 #27
0
def delete_unusable_entries():
    exec_sql_from_file("delete_unusable_entries.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
예제 #28
0
def sanitize_housenumbers():
    exec_sql_from_file("sanitize_housenumbers.sql", cwd=SQL_DIR)
예제 #29
0
def set_place_ranks():
    exec_sql_from_file("set_place_ranks.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
예제 #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()
예제 #31
0
def determine_linked_places():
    exec_sql_from_file("determine_linked_places.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
예제 #32
0
def set_linestring_names_from_relations():
    exec_sql_from_file("set_linestring_names_from_relations.sql", cwd=SQL_DIR)
예제 #33
0
def merge_corresponding_linestrings():
    exec_sql_from_file("merge_corresponding_linestrings.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
예제 #34
0
def create_helper_functions():
    exec_sql_from_file("create_helper_functions.sql",
                       cwd=os.path.dirname(__file__),
                       parallelize=True)
예제 #35
0
def create_functions():
    exec_sql_from_file("functions.sql", cwd=os.path.dirname(__file__))
예제 #36
0
def delete_nameless_entries():
    exec_sql_from_file("delete_nameless_entries.sql",
                       cwd=os.path.dirname(__file__),
                       parallelize=True)
    vacuum_database()
예제 #37
0
def create_merged_linestrings_view():
    exec_sql_from_file("create_merged_linestrings_view.sql",
                       cwd=os.path.dirname(__file__))
예제 #38
0
def follow_wikipedia_redirects():
    exec_sql_from_file("follow_wikipedia_redirects.sql",
                       cwd=os.path.dirname(__file__))
    vacuum_database()
예제 #39
0
def create_housenumbers_view():
    exec_sql_from_file("create_housenumbers_view.sql",
                       cwd=os.path.dirname(__file__))
예제 #40
0
def set_linestring_centers():
    exec_sql_from_file("set_linestring_centers.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
예제 #41
0
def create_geonames_view():
    exec_sql_from_file("create_geonames_view.sql",
                       cwd=os.path.dirname(__file__))
예제 #42
0
def set_place_ranks():
    exec_sql_from_file("set_place_ranks.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
예제 #43
0
def merge_nodes_linked_by_relation():
    exec_sql_from_file("merge_nodes_linked_by_relation.sql", cwd=SQL_DIR)
    vacuum_database()
예제 #44
0
def determine_linked_places():
    exec_sql_from_file("determine_linked_places.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
예제 #45
0
def set_street_attributes_by_street_relation_members():
    exec_sql_from_file("set_street_attributes_by_street_relation_members.sql", cwd=SQL_DIR)
예제 #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()
예제 #47
0
def set_street_names_by_relation_attributes():
    exec_sql_from_file("set_street_names_by_relation_attributes.sql", cwd=SQL_DIR)
예제 #48
0
def remove_duplicate_entries():
    exec_sql_from_file("remove_duplicate_entries.sql", cwd=os.path.dirname(__file__))
    vacuum_database()
예제 #49
0
def normalize_street_names():
    exec_sql_from_file("normalize_street_names.sql", cwd=SQL_DIR)
예제 #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()
예제 #51
0
def set_street_ids_by_street_name():
    exec_sql_from_file("set_street_ids_by_street_name.sql", cwd=SQL_DIR)
예제 #52
0
def import_country_osm_grid():
    exec_sql_from_file("country_osm_grid.sql",
                       cwd="{}/sql/".format(settings.get("DATA_DIR")))
예제 #53
0
def create_custom_types():
    exec_sql_from_file("create_custom_types.sql", cwd=os.path.dirname(__file__), user="******")