mapaction / osm2mapaction

Conversion of OSM data to the MapAction Data Naming Convention
GNU General Public License v3.0
6 stars 3 forks source link

Feature/pbf to osm use argparse #6

Closed stringfellow closed 9 years ago

stringfellow commented 9 years ago

This is pretty basic but could easily be improved. Might be good to add the xls file to the repo since it seems to be a requirement.

stringfellow commented 9 years ago

Oh I've just seen the XLS file! Cool.

stringfellow commented 9 years ago

@andrewphilipsmith I ran this against a PBF from geofabrik.de but it died on Excel read:

Traceback (most recent call last):
  File "osm2mapaction.py", line 73, in <module>
    main(args)
  File "osm2mapaction.py", line 42, in main
    output_dir
  File "osm2mapaction.py", line 50, in convert
    _raw_conf = raw_config_from_file(raw_config_path)
  File "/Users/spike/Documents/MapAction/Code/osm2mapaction/osm2ma/raw_config_loader.py", line 52, in raw_config_from_file
    return _excel.get_raw_config()
  File "/Users/spike/Documents/MapAction/Code/osm2mapaction/osm2ma/raw_config_loader.py", line 39, in get_raw_config
    return namedrange.area2d(clipped=True)
  File "/Users/spike/.virtualenvs/osm2ma/lib/python2.7/site-packages/xlrd/book.py", line 288, in area2d
    self.dump(self.book.logfile,
AttributeError: 'NoneType' object has no attribute 'logfile'

I guess maybe because this is an xlsx? There's a lib called OpenPyXL which deals with xlsx files pretty well.

stringfellow commented 9 years ago

(PS- merging #5 first will make this changeset much more succinct)