From dad7d2050e4ee2b9478c383c10c018a8ee841387 Mon Sep 17 00:00:00 2001 From: Fabian Date: Wed, 22 Feb 2023 13:26:17 +0100 Subject: [PATCH] build_population_layouts: replace vresutils area calculation --- scripts/build_population_layouts.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/build_population_layouts.py b/scripts/build_population_layouts.py index 7936d831..f72ced09 100644 --- a/scripts/build_population_layouts.py +++ b/scripts/build_population_layouts.py @@ -7,8 +7,6 @@ import pandas as pd import xarray as xr import geopandas as gpd -from vresutils import shapes as vshapes - if __name__ == '__main__': if 'snakemake' not in globals(): from helper import mock_snakemake @@ -46,8 +44,7 @@ if __name__ == '__main__': pop_cells = pd.Series(I.dot(nuts3['pop'])) # in km^2 - with mp.Pool(processes=snakemake.threads) as pool: - cell_areas = pd.Series(pool.map(vshapes.area, grid_cells)) / 1e6 + cell_areas = grid_cells.to_crs(3035).area / 1e6 # pop per km^2 density_cells = pop_cells / cell_areas