pypsa-meets-earth / earth-osm

Export infrastructure data from OpenStreetMap using Python
https://pypsa-meets-earth.github.io/earth-osm/
MIT License
23 stars 12 forks source link

Error when downloading all elements contained in a feature #14

Closed DeniseGiub closed 1 year ago

DeniseGiub commented 2 years ago

Describe the bug

Currently it is not possible to download everything contained inside a primary feature, without specifying the subfeatures.

To Reproduce

Steps to reproduce the described behavior:

  1. Go to 'earth_osm/config.py'
  2. Modify primary_feature_element this way: primary_feature_element = { "feature": { True : "node", }
  3. Run the workflow

Expected behavior You will run into the following error:

Traceback (most recent call last): File "../bin/earth_osm", line 33, in sys.exit(load_entry_point('earth-osm', 'console_scripts', 'earth_osm')()) File "..earth-osm/earth_osm/args.py", line 119, in main f'Sub Features: {" - ".join(feature_list)}', TypeError: sequence item 0: expected str instance, bool found

Desktop

davide-f commented 1 year ago

@mnm-matin could you please add some comments on how you think it would be best handled this issue? I think it would be interesting to have the guideline so that this issue could be addressed. Many thanks :)

mnm-matin commented 1 year ago

I've been working on that commit for a while now, and have only picked it up again a few days ago. In particular the data pipeline needs to be modified so that it can handle: Node (Towers), Way (Lines and Cables), Area (Substations and Generators). There is some detection that needs to occur if something is a way or an area. More info on ways from OSM. Ways are converted to LineStrings while Areas are converted to Polygons. Currently all Nodes are converted to Points which is wrong and would cause problems with buildings etc. relevant code from osmnx here.

As a checklist:

davide-f commented 1 year ago

Mmm that sounds some work... But do you think all of that is needed for buildings only? The question here may not be download all "power", which indeed falls in all those troubles, but what about "buildings"? What do you think is the procedure?