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/')
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)
def merge_corresponding_linestrings(): exec_sql_from_file("merge_corresponding_linestrings.sql", cwd=os.path.dirname(__file__)) vacuum_database()
def set_country_codes(): exec_sql_from_file("set_country_codes.sql", cwd=os.path.dirname(__file__)) vacuum_database() consistency_check.missing_country_codes()
def create_custom_columns(): exec_sql_from_file("create_custom_columns.sql", cwd=os.path.dirname(__file__))
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()
def cluster_geometries(): exec_sql_from_file("cluster_geometries.sql", cwd=SQL_DIR) vacuum_database()
def set_geometry_centers(): exec_sql_from_file("set_geometry_centers.sql", cwd=SQL_DIR) vacuum_database()
def create_geonames_view(): exec_sql_from_file("create_geonames_view.sql", cwd=os.path.dirname(__file__))
def create_housenumbers_view(): exec_sql_from_file("create_housenumbers_view.sql", cwd=os.path.dirname(__file__))
def create_merged_linestrings_view(): exec_sql_from_file("create_merged_linestrings_view.sql", cwd=os.path.dirname(__file__))
def set_names_from_tags(): exec_sql_from_file("set_names_from_tags.sql", cwd=SQL_DIR)
def set_tables_unlogged(): exec_sql_from_file("set_tables_unlogged.sql", cwd=os.path.dirname(__file__), parallelize=True)
def set_polygon_types(): exec_sql_from_file("set_polygon_types.sql", cwd=os.path.dirname(__file__)) vacuum_database()
def delete_unusable_entries(): exec_sql_from_file("delete_unusable_entries.sql", cwd=os.path.dirname(__file__)) vacuum_database()
def set_place_parentInfo(): exec_sql_from_file("set_place_parentInfo.sql", cwd=os.path.dirname(__file__)) vacuum_database()
def create_custom_types(): exec_sql_from_file("create_custom_types.sql", cwd=os.path.dirname(__file__), user="******")
def set_linestring_centers(): exec_sql_from_file("set_linestring_centers.sql", cwd=os.path.dirname(__file__)) vacuum_database()
def create_functions(): exec_sql_from_file("functions.sql", cwd=os.path.dirname(__file__))
def sanitize_housenumbers(): exec_sql_from_file("sanitize_housenumbers.sql", cwd=SQL_DIR)
def set_place_ranks(): exec_sql_from_file("set_place_ranks.sql", cwd=os.path.dirname(__file__)) vacuum_database()
def determine_linked_places(): exec_sql_from_file("determine_linked_places.sql", cwd=os.path.dirname(__file__)) vacuum_database()
def set_linestring_names_from_relations(): exec_sql_from_file("set_linestring_names_from_relations.sql", cwd=SQL_DIR)
def create_helper_functions(): exec_sql_from_file("create_helper_functions.sql", cwd=os.path.dirname(__file__), parallelize=True)
def delete_nameless_entries(): exec_sql_from_file("delete_nameless_entries.sql", cwd=os.path.dirname(__file__), parallelize=True) vacuum_database()
def follow_wikipedia_redirects(): exec_sql_from_file("follow_wikipedia_redirects.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()
def set_street_attributes_by_street_relation_members(): exec_sql_from_file("set_street_attributes_by_street_relation_members.sql", cwd=SQL_DIR)
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)
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)
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)