-
Notifications
You must be signed in to change notification settings - Fork 1
Multiple Agencies
Quyen Tran edited this page Oct 24, 2015
·
7 revisions
- Set up the OneBusAway environment with onebusaway.war and the the GTFS files.
- Create the bundle.xml file.
- Generate the combined bundle file.
- Run the onebusaway.jar web app.
- Add the mobile app API keys.
- Follow the instructions at Home through step "3. Downloading Miami-Dade Transit GTFS file".
- Download any other GTFS zip file such as miami.zip and broward.zip.
- Go to http://developer.onebusaway.org/modules/onebusaway-application-modules/1.1.11/guides/transit-data-bundle-guide.html for a reference of the instructions.
- Create a bundle.xml file in the same directory as onebusaway.war with the following contents:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<bean id="gtfs-bundles" class="org.onebusaway.transit_data_federation.bundle.model.GtfsBundles">
<property name="bundles">
<list>
<ref bean="gtfsA" />
<ref bean="gtfsB" />
<!-- References to other GTFS feeds could go here -->
</list>
</property>
</bean>
<bean id="gtfsA" class="org.onebusaway.transit_data_federation.bundle.model.GtfsBundle">
<property name="path" value="miami.zip" />
<property name="defaultAgencyId" value="1" />
<property name="agencyIdMappings">
<map>
<!-- Map GTFS Agency IDs to their APTA Agency Id -->
<entry key="MDT" value="1" />
</map>
</property>
</bean>
<bean id="gtfsB" class="org.onebusaway.transit_data_federation.bundle.model.GtfsBundle">
<property name="path" value="broward.zip" />
<property name="defaultAgencyId" value="2" />
<property name="agencyIdMappings">
<map>
<!-- Map GTFS Agency IDs to their APTA Agency Id -->
<entry key="BCT" value="2" />
</map>
</property>
</bean>
</beans>For each agency's GTFS zip file, create a "bean" section. Note the file "miami.zip" is specified.
<bean id="gtfsA" class="org.onebusaway.transit_data_federation.bundle.model.GtfsBundle">
<property name="path" value="miami.zip" />
<property name="defaultAgencyId" value="1" />
<property name="agencyIdMappings">
<map>
<!-- Map GTFS Agency IDs to their APTA Agency Id -->
<entry key="MDT" value="1" />
</map>
</property>
</bean>Remember to reference each bean in the "list" section
<ref bean="gtfsA" />
<ref bean="gtfsB" />- Use the following command to generate the bundle directory:
java -server -Xmx1G -jar onebusaway.war -build -P tripEntriesFactory.throwExceptionOnInvalidStopToShapeMappingException=false -P distanceAlongShapeLibrary.localMinimumThreshold=50 -P distanceAlongShapeLibrary.maxDistanceFromStopToShapePoint=1000 bundle.xml combinedbundle
- After the bundle is generated, go to the 'combinedbundle' directory and check that it is about 111MB.
- Run the following command:
java -Xmx1G -server -jar onebusaway.war
- Note that the -server option allows more memory to be allocated.
- Specify the bundle directory when prompted. Ex: "C:\oba\combinedbundle"
- When the web app runs, access it at the server's IP address. Ex: "http://52.11.122.22:8080"
- Using the web interface, login using the admin account (admin/password). Ex: "http://52.11.122.22:8080/login.action"
- Add the following API keys for Android and iOS with interval of 0:
- v1_BktoDJ2gJlu6nLM6LsT9H8IUbWc=cGF1bGN3YXR0c0BnbWFpbC5jb20=
- org.onebusaway.iphone
- Use the mobile app and set the "OneBusAway API Server" to the IP address and port. Ex: "52.11.122.22:8080"
- Zoom in to street level to see the bus stops.