Pathfinder_GIS_steps

Module: Pathfinder_GIS_steps

A module that contains the GIS functions for Pathfinder_processing_steps It creates the target files (from un-electrified), creates the weights for road and grid, and identify an origin as close as possible to the center of the cell ———————————————————————————————————————————————————————————-

Module author: Nandi Moksnes <nandi@kth.se>

Functions

convert_zero_to_one(file)

This function converts the inputed “file” 0 to 1 in a column called “dijkstra” and saves it to a shapefile.

highway_weights(path_grid, path)

This function adds the weight to where the grid (0.01 weight) is located as well as road (0.5 weight) to column weight :param path_grid: :param path: :return:

make_origin_numpyarray(file, s)

This function creates the origin file, which indicates where the network needs to start.

make_raster(pathfinder, s)

make_target_numpyarray(file, s)

This function converts the unelectrified raster (containing ones) to a numpy array.

make_weight_numpyarray(file, s)

The weight from road and grid is converted to a numpy array (from raster).

masking(shape, tif_file, s)

This function masks the raster data (tif-file) with the GADM Admin 0 boundaries (admin) :param bounds: :param tif_file: :return: tif_file

merge_grid(proj_path)

This function concatinates the shapefiles which contains the keyword ‘33kV’ and ‘66kV’ :param proj_path: :return:

merge_raster(transmission_raster, highway_raster)

This function merge the transmission and roads together into one raster with transmission overriding roads incase overlap.

rasterize_elec(file, proj_path)

This function converts the shapefile that has the ones for targets in the column “dijkstra” to a raster :param file: :param proj_path: :return:

rasterize_road(file, proj_path)

This function rasterize the shapefiel roads to a raster.

rasterize_transmission(file, proj_path)

This function rasterize the merged transmission shapefile.

removing_grid(elec_path, weights)