def test_seaside_roadways(client): trns_brdg_dataset_id = "5ee7af50772cf80008577ae3" trns_brdg_dataset = Dataset.from_data_service(trns_brdg_dataset_id, DataService(client)) viz.plot_map(trns_brdg_dataset, column=None, category=False, basemap=True) assert True
def test_seaside_bridges(client): trns_brdg_dataset_id = "5d251172b9219c0692cd7523" trns_brdg_dataset = Dataset.from_data_service(trns_brdg_dataset_id, DataService(client)) viz.plot_map(trns_brdg_dataset, column=None, category=False, basemap=True) assert True
def test_choropleth_sinlge_dataset(client): social_vulnerability_census_block_group = '5a284f57c7d30d13bc08254c' dataset = Dataset.from_data_service( social_vulnerability_census_block_group, DataService(client)) viz.plot_choropleth_multiple_fields_from_single_dataset( dataset, ['tot_hh', 'totpop']) assert True
def test_visualize_network(client): centerville_epn_network_id = "5d25fb355648c40482a80e1c" dataset = Dataset.from_data_service(centerville_epn_network_id, DataService(client)) network_dataset = NetworkDataset(dataset) viz.plot_network_dataset(network_dataset) assert True
def test_visualize_earthquake(client): eq_hazard_id = "5b902cb273c3371e1236b36b" eq_metadata = HazardService(client).get_earthquake_hazard_metadata( eq_hazard_id) eq_dataset_id = eq_metadata['rasterDataset']['datasetId'] eq_dataset = Dataset.from_data_service(eq_dataset_id, DataService(client)) viz.plot_earthquake(eq_hazard_id, client) assert True
def test_choropleth_multiple_dataset(client): social_vulnerability_census_block_group = '5a284f57c7d30d13bc08254c' dislocation_census_block_group = '5a284f58c7d30d13bc082566' dataset1 = Dataset.from_data_service( social_vulnerability_census_block_group, DataService(client)) dataset2 = Dataset.from_data_service(dislocation_census_block_group, DataService(client)) viz.plot_choropleth_multiple_dataset([dataset1, dataset2], ['tot_hh', 'p_16pyr']) assert True
def test_multiple_vector_visualization(client): centerville_model_tornado = '60c917b498a93232884f367d' centerville_epn_link = '5b1fdc2db1cf3e336d7cecc9' tornado_metadata = HazardService(client).get_tornado_hazard_metadata( centerville_model_tornado) dataset1 = Dataset.from_data_service(centerville_epn_link, DataService(client)) dataset2 = Dataset.from_data_service(tornado_metadata["datasetId"], DataService(client)) viz.plot_multiple_vector_dataset([dataset1, dataset2]) assert True
def test_plot_map_table_dataset(client): building_damage_id = '5a296b53c7d30d4af5378cd5' dataset = Dataset.from_data_service(building_damage_id, DataService(client)) map = viz.plot_table_dataset(dataset, client, 'meandamage') assert True
def test_visualize_raster_file(client): galvaston_wave_height_id = '5f11e503feef2d758c4df6db' dataset = Dataset.from_data_service(galvaston_wave_height_id, DataService(client)) map = viz.plot_raster_from_path(dataset.get_file_path('tif')) assert True
def test_heatmap(client): shelby_hospital_inv_id = "5a284f0bc7d30d13bc081a28" dataset = Dataset.from_data_service(shelby_hospital_inv_id, DataService(client)) map = viz.plot_heatmap(dataset, "str_prob") assert True
def test_plot_table_dataset_list_from_single_source(client): seaside_building_polygon_id = '5f7c95d681c8dd4d309d5a46' dataset_id_list = ['5f7c9b4f81c8dd4d309d5b62', '5f7c9af781c8dd4d309d5b5e'] dataset_list = [] for dataset_id in dataset_id_list: dataset_list.append( Dataset.from_data_service(dataset_id, DataService(client))) map = viz.plot_table_dataset_list_from_single_source( client, dataset_list, 'failure_probability', seaside_building_polygon_id) assert True
def test_plot_map_dataset_list(client): galveston_roadway_id = '5f0dd5ecb922f96f4e962caf' galvaston_wave_height_id = '5f11e503feef2d758c4df6db' shelvy_building_damage_id = '5a296b53c7d30d4af5378cd5' dataset_id_list = [ galveston_roadway_id, galvaston_wave_height_id, shelvy_building_damage_id ] dataset_list = [] for dataset_id in dataset_id_list: dataset_list.append( Dataset.from_data_service(dataset_id, DataService(client))) # table dataset plot map map = viz.plot_maps_dataset_list(dataset_list, client) assert True
def test_visualize_inventory(client): shelby_hospital_inv_id = "5a284f0bc7d30d13bc081a28" shelby_road_id = "5a284f2bc7d30d13bc081eb6" # get shelvy building inventory and road sh_bldg_inv = Dataset.from_data_service(shelby_hospital_inv_id, DataService(client)) sh_road = Dataset.from_data_service(shelby_road_id, DataService(client)) # visualize building inventory viz.plot_map(sh_bldg_inv, column="struct_typ", category=False, basemap=True) # visualize building inventory from geoserver viz.get_wms_map([sh_bldg_inv, sh_road]) viz.get_gdf_map([sh_bldg_inv, sh_road]) viz.get_gdf_wms_map([sh_bldg_inv], [sh_road]) assert True
def test_visualize_joplin_tornado_building(client): # testing datasets tornado_hazard_id = "5dfa32bbc0601200080893fb" joplin_bldg_inv_id = "5df7d0de425e0b00092d0082" viz.plot_tornado(tornado_hazard_id, client, basemap=False) tornado_dataset_id = HazardService(client).get_tornado_hazard_metadata( tornado_hazard_id)['datasetId'] tornado_dataset = Dataset.from_data_service(tornado_dataset_id, DataService(client)) viz.get_gdf_map([tornado_dataset]) # get joplin building inventory joplin_bldg_inv = Dataset.from_data_service(joplin_bldg_inv_id, DataService(client)) # using wms layer for joplin building inv. gdf will crash the browser viz.get_gdf_wms_map([tornado_dataset], [joplin_bldg_inv]) assert True
def test_visualize_model_earthquake(client): eq_hazard_id = "5b902cb273c3371e1236b36b" viz.plot_earthquake(eq_hazard_id, client) assert True
def test_visualize_dataset_earthquake(client): eq_hazard_id = "5ba8ed5cec23090435209069" viz.plot_earthquake(eq_hazard_id, client) assert True
def test_visualize_dataset_earthquake_with_demand(client): eq_hazard_id = "5ba8ed5cec23090435209069" viz.plot_earthquake(eq_hazard_id, client, "0.4 SA") assert True
def test_plot_raster_dataset(client): galveston_deterministic_hurricane = "5f10837ab922f96f4e9ffb86" viz.plot_raster_dataset(galveston_deterministic_hurricane, client) assert True