tif_path,
            'w',
            driver='GTiff',
            height=arr.shape[0],
            width=arr.shape[1],
            count=1,
            dtype=arr.dtype,
            crs=crs,
            transform=transform,
            nodata=-999.0
        ) as ds:
        ds.write(arr, 1)


if __name__ == '__main__':
    base_path = load_config()["base_path"]

    try:
        csv_path = sys.argv[1]
    except:
        # CSV input
        csv_path = os.path.join(
            base_path, 'results', 'proximity_results',
            'population_gha_2019-07-01_proximity.csv')

    try:
        value_col = sys.argv[2]
    except:
        # Column
        value_col = 'length_km'
Exemple #2
0
"""Generate darthmouth events
"""
import os
import sys
import configparser
import pandas as pd
import geopandas as gpd
import subprocess
import numpy as np
from shapely.geometry import Point
import igraph as ig
import ghaa.config as config
import ghaa.analysis.spatial_and_network_functions as spnf
from tqdm import tqdm

BASE_PATH = config.load_config()['base_path']
tqdm.pandas()

def kind_of_access(x):
    if x.nearest_hc_r_node == x.nearest_pop_r_node:
        return 1
    elif x.length_km > 0:
        return 2
    else:
        return 0 

def main():
    crs = {'init': 'epsg:4326'} # Set the projection system
    data_path = os.path.join(BASE_PATH,'data')
    incoming_path = os.path.join(BASE_PATH,'incoming')
    result_path = os.path.join(BASE_PATH,'results')