Exemplo n.º 1
0
 def overlay(self, csv_file):
     if (str(self.outFileType.currentText()) == 'CSV'):
         seperator = ","
     else:
         seperator = "\t"
     loc_df = map_locations.locations_df(csv_file, sep=seperator, output_dir=str(self.outputLine.text()), \
                                         df_column=str(self.comboBox.currentText()))
     loc_gdf = generate_maps.get_loc_gdf(loc_df)
     text = str(self.typeBox.currentText())
     if (text == "Heatmap"):
         hmap = heatmap.heatmap(loc_gdf,
                                output_dir=str(self.outputLine.text()))
     elif (text == "Choropleth"):
         gdf = choropleth.choropleth_map(loc_gdf,
                                         shp_path=str(
                                             self.shapeLine.text()))
         plot = choropleth.plot_map(gdf,
                                    output_dir=str(self.outputLine.text()))
     elif (text == "Overlay Locations Map"):
         gdf, loc_gdf = generate_maps.generate_overlay_gdf(
             loc_df, shp_path=str(self.shapeLine.text()))
         plot = generate_maps.plot_gdf(gdf,
                                       loc_gdf,
                                       output_dir=str(
                                           self.outputLine.text()))
Exemplo n.º 2
0
def generate_map(csv_file):
    if (str(p1.outFileType.currentText()) == 'CSV'):
        seperator = ","
    else:
        seperator = "\t"
    loc_df = pd.read_csv(csv_file, sep=seperator)
    loc_gdf = generate_maps.get_loc_gdf(loc_df,
                                        column_name=str(
                                            p2.columnBox.currentText()))
    text = str(p2.typeBox.currentText())
    if (text == "Heatmap"):
        hmap = heatmap.heatmap(loc_gdf, output_dir=str(p1.outputLine.text()))
    elif (text == "Choropleth"):
        gdf = choropleth.choropleth_map(loc_gdf,
                                        shp_path=str(p2.shapeLine.text()))
        plot = choropleth.plot_map(gdf, output_dir=str(p1.outputLine.text()))
    elif (text == "Map of Locations Overlay onto Shapefile"):
        gdf, loc_gdf = generate_maps.generate_overlay_gdf(
            loc_df, shp_path=str(p2.shapeLine.text()))
        plot = generate_maps.plot_gdf(gdf,
                                      loc_gdf,
                                      output_dir=str(p1.outputLine.text()))