Open pz-max opened 2 years ago
I think I know now why some shapes are weirdly combined when hovering over them and why the there is the color change. (or at least it is a puzzle piece :)
It is because the single polygons do not conterminous properly anymore. To see this, you have to zoom in a lot (maybe use QGIS to better analyse).
In the script build_shapes.py
the GADM zones are downloaded and then simplified. During this simplification holes and overlaps between the polygons can occur. (See https://github.com/pypsa-meets-earth/pypsa-earth/issues/1051)
The simplification in the script build_shapes.py
is done with shapely.simplify
To solve this problem, shared boarders of conterminous (neighbouring) polygons should not be simplified or the neighbouring polygons have to be simplified to the same line.
I did a little internet search. Maybe shapely.snap could help to solve this problem. Here is also a helpful mini thread about this phenomenon
Checklist
main
branch or the latest release. Please indicate.pypsa-africa
environment. Update viaconda env update -f envs/environment.yaml
.Describe the Bug
Summary of bugs:
gadm_regions
toonshore_regions
conversionsimplify_network
.I am running PyPSA-Africa for Nigeria with the GADM clustering option which retrieves GADM shapes also known as administrative zones. See the automatic download:
Creating the
Nevertheless, the real bug appears when running ![regions_onshore_elec_s](https://user-images.githubusercontent.com/61968949/174048077-fa09c483-1e00-45d9-a6eb-b0111d830e29.png)
regions_onshore
looks still fine. I am not sure yet what the colour change means. Maybe it is indicating an error? One bug is that black hole inside Africa!simplify_network.py
which then createsnetworks/elec_s{simpl}.nc
. As you can see, hovering over one shape, it seems that some shapes are combined.One needs to debug
simplify_network
and investigate the step where this occurs. We need to find a solution to this issue.