PyPSA / pypsa-eur

PyPSA-Eur: A Sector-Coupled Open Optimisation Model of the European Energy System
https://pypsa-eur.readthedocs.io/
316 stars 220 forks source link

Add crs to config to make code less error prone #393

Open pz-max opened 2 years ago

pz-max commented 2 years ago

Describe the feature you'd like to see

In PyPSA-Africa/Earth we define the crs system (coordinate reference system) in the config.

# definition of the Coordinate Reference Systems
crs:
  geo_crs: EPSG:4326  # general geographic projection, not used for metric measures. "EPSG:4326" is the standard used by OSM and google maps
  distance_crs: EPSG:3857  # projection for distance measurements only. Possible recommended values are "EPSG:3857" (used by OSM and Google Maps)
  area_crs: ESRI:54009  # projection for area measurements only. Possible recommended values are Global Mollweide "ESRI:54009"

These values are then important by scripts & functions as shown here: https://github.com/pypsa-meets-africa/pypsa-africa/blob/4d7174ae5e75ba62fb2a9981c27b45a45873be52/scripts/clean_osm_data.py#L782-L836

This could be also adapted in PyPSA-Eur making the code less error-prone. Maybe someone wants to implement this?

fneum commented 1 year ago

I like this idea!

pz-max commented 1 year ago

Cool! Not an urgent task but I hope we find someone to integrate it (nice exercise for new contributors). All credits to @davide-f who had the idea