grote/osm2gtfs

Error runing osm2gtfs

jaullo opened this issue · 5 comments

Hello to all!

I´m trying to run osm2gtfs using ubuntu 14 64 bits.

Steps i have made:

  1. Installed Python Version 2.7.6
  2. Installed PIP (apt-get install python-pip)
  3. Clone osm2gtfs git repository to /opt
  4. cd into osm2gtfs folder and run pip install -e . the following message appears

**Obtaining file:///opt/osm2gtfs
Running setup.py (path:/opt/osm2gtfs/setup.py) egg_info for package from file:///opt/osm2gtfs

Downloading/unpacking overpy>=0.4 (from osm2gtfs==0.0.1)
Downloading overpy-0.4.tar.gz (41kB): 41kB downloaded
Running setup.py (path:/tmp/pip_build_root/overpy/setup.py) egg_info for package overpy
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
your setuptools is too old (<12)
setuptools_scm functionality is degraded
zip_safe flag not set; analyzing archive contents...

Installed /tmp/pip_build_root/overpy/pytest_runner-3.0-py2.7.egg

warning: no files found matching 'docs.Makefile'

Downloading/unpacking transitfeed (from osm2gtfs==0.0.1)
Downloading transitfeed-1.2.14.tar.gz (347kB): 347kB downloaded
Running setup.py (path:/tmp/pip_build_root/transitfeed/setup.py) egg_info for package transitfeed

Installing collected packages: overpy, transitfeed, osm2gtfs
Running setup.py install for overpy

warning: no files found matching 'docs.Makefile'

Running setup.py install for transitfeed
changing mode of build/scripts-2.7/feedvalidator.py from 644 to 755
changing mode of build/scripts-2.7/schedule_viewer.py from 644 to 755
changing mode of build/scripts-2.7/kmlparser.py from 644 to 755
changing mode of build/scripts-2.7/kmlwriter.py from 644 to 755
changing mode of build/scripts-2.7/merge.py from 644 to 755
changing mode of build/scripts-2.7/unusual_trip_filter.py from 644 to 755
changing mode of build/scripts-2.7/location_editor.py from 644 to 755
changing mode of build/scripts-2.7/feedvalidator_googletransit.py from 644 to 755
changing mode of build/scripts-2.7/shape_importer.py from 644 to 755

changing mode of /usr/local/bin/feedvalidator.py to 755
changing mode of /usr/local/bin/kmlparser.py to 755
changing mode of /usr/local/bin/schedule_viewer.py to 755
changing mode of /usr/local/bin/location_editor.py to 755
changing mode of /usr/local/bin/shape_importer.py to 755
changing mode of /usr/local/bin/feedvalidator_googletransit.py to 755
changing mode of /usr/local/bin/unusual_trip_filter.py to 755
changing mode of /usr/local/bin/kmlwriter.py to 755
changing mode of /usr/local/bin/merge.py to 755

Running setup.py develop for osm2gtfs

Creating /usr/local/lib/python2.7/dist-packages/osm2gtfs.egg-link (link to .)
Adding osm2gtfs 0.0.1 to easy-install.pth file
Installing osm2gtfs script to /usr/local/bin

Installed /opt/osm2gtfs

Successfully installed overpy transitfeed osm2gtfs
Cleaning up...**

  1. Check if transitfeed is installed
    pip install transitfeed
    Requirement already satisfied (use --upgrade to upgrade): transitfeed in /usr/local/lib/python2.7/dist-packages

  2. Check if overpy is installed
    pip install overpy
    Requirement already satisfied (use --upgrade to upgrade): overpy in /usr/local/lib/python2.7/dist-packages

  3. Finally i run osm2gtfs command
    osm2gtfs --config incofer.json --output testinconfer

But i get an error

Traceback (most recent call last):
File "/usr/local/bin/osm2gtfs", line 9, in
load_entry_point('osm2gtfs==0.0.1', 'console_scripts', 'osm2gtfs')()
File "/opt/osm2gtfs/osm2gtfs/osm2gtfs.py", line 35, in main
config = Configuration(args)
File "/opt/osm2gtfs/osm2gtfs/core/configuration.py", line 32, in init
self._prepare_dates()
File "/opt/osm2gtfs/osm2gtfs/core/configuration.py", line 98, in _prepare_dates
if 'start_date' in config['feed_info']:
KeyError: 'feed_info'

What i doing wrong? Some one knows how to solve it?

Thanks

grote commented

Sounds like your configuration is missing feed_info

Hi grote thank you. I have reviewed osm2gtfs/creators/incofer/

And... this is what i have

{
"query": {
"bbox": {
"n": "10.0365",
"s": "9.8346",
"e": "-83.8507",
"w": "-84.2418"
},
"tags": {
"route": "train",
"network": "Tren Urbano",
"operator": "Incofer"
}
},
"stops": {
"name_without": "Parada sin nombre",
"name_auto": "yes"
},
"agency": {
"agency_id": "CR-Incofer",
"agency_name": "Incofer",
"agency_url": "http://www.incofer.go.cr",
"agency_timezone": "America/Costa_Rica",
"agency_lang": "ES",
"agency_phone": "506 25425800",
"agency_fare_url": ""
},
"feed_info": {
"publisher_name": "Laboratorio Experimental",
"publisher_url": "http://ic-itcr.ac.cr/~jgutierrez/incofer/",
"version": "0.1",
"start_date" : "20171101",
"end_date": "20171231"
},
"output_file": "/opt/cr-incofer.zip",
"selector": "incofer"
}

Updated the end and start date but same error

grote commented

If I run the following in the root project directory, everything works just fine:

pip2 install -e .
osm2gtfs -c osm2gtfs/creators/incofer/incofer.json

It is working fine for me too, @jaullo you are still having errors?

grote commented

No response from poster for some month. Time to close this.