pypsa-meets-earth / pypsa-earth

PyPSA-Earth: A flexible Python-based open optimisation model to study energy system futures around the world.
https://pypsa-earth.readthedocs.io/en/latest/
218 stars 173 forks source link

On missing country areas and off_shore shapes in build_bus_regions #99

Closed davide-f closed 2 years ago

davide-f commented 2 years ago

As discussed with @pz-max , it is well known that the build_bus_regions appear to have wide blank ares, mainly related to Somalina, Ciad, Central African Republic, South Sudan and Somalia. For Somalia, there are really no data, but for the other countries there are only few data (1-5 lines/buses), so that when the voronoi cells are calculated, vast areas of the countries become blank.

My feeling is that this issue depends on the implementation of voronoi_partition_pts which limits the size of each voronoi cell. When the number of points is large and widespread all over the region this is ok, but in our case where in some countries we have 1-3 points very close each other, the above does not work.

I see two options:

The version (a) may be faster

Regarding the off_shore areas, the same problem may apply also there, however, some countries may not have off shore buses. I am not sure whether we should introduce fake nodes and lines to do so at this stage. Maybe we should tackle that issue when we will address the "under_construction" lines or similar.

davide-f commented 2 years ago

As a clarification for the above, see the image below (reproduceable by the build_bus_regions_verifybuseslines notebook) image

davide-f commented 2 years ago

@pz-max do you like it? XD

The only thing left is the off_shore regions of countries where no offshore bus is in place. For the moment, I think we could move on with this implementation. They will become important when we consider optimal planning purposes including the development of new bus.

Probably, we have now other priorities, so maybe it could be a good idea to close this issue and leave the issue on the off_shore areas just as a reminder. Anyway the issue about installing new buses could be relevant also for onshore areas of countries with very limited number of buses.

image

pz-max commented 2 years ago

missing countries

Looks good! FYI, for the other readers: Senegal, Gambia and West-Sahara are excluded for now. See issue #88

voronoi_partition_pts

I think it's fine to implement a temporary function for the Voronoi partition and wait until the new code is pushed into FRENSA code.

missing offshore shapes

We have to review how the offshore buses are defined and fix that

davide-f commented 2 years ago

The issue on Senegal/Gambia and West Sahara were of secondary priority. It will be the next issue I'll be tackling and it will involve a restructuring of osm download. I will work on a separate branch and propose the output. Unfortunately the empty regions involved solving three very weird problems: (1) Namibia that was tackled as NaN, (b) errors in the allocation of ending buses and lines and their cleaning and (c) the empty zones All the above was spread across several files but has been fixed in these commits