Skip to content

Instantly share code, notes, and snippets.

@mattwigway
Created February 29, 2012 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattwigway/1936826 to your computer and use it in GitHub Desktop.
Save mattwigway/1936826 to your computer and use it in GitHub Desktop.
SF Graph Builder Config
<?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="graphBundle" class="org.opentripplanner.model.GraphBundle">
<property name="path" value="/var/otp/graphs/sf/" />
</bean>
<bean id="gtfsBuilder" class="org.opentripplanner.graph_builder.impl.GtfsGraphBuilderImpl">
<property name="gtfsBundles">
<bean id="gtfsBundles" class="org.opentripplanner.graph_builder.model.GtfsBundles">
<property name="bundles">
<list>
<!-- SF Muni -->
<bean class="org.opentripplanner.graph_builder.model.GtfsBundle">
<property name="url" value="file:///otp/gtfs/sfmta.zip" />
<property name="defaultAgencyId" value="Muni" />
<!-- By default, bikes may only be taken along on transit trips if the GTFS data allows them to be.
If the GTFS data doesn't contain appropriate data, but the actual transit trips do allows bikes
to be taken along, a defaultBikesAllowed property may be specified to allow bikes.
-->
<property name="defaultBikesAllowed" value="true" />
</bean>
<!-- BART -->
<bean class="org.opentripplanner.graph_builder.model.GtfsBundle">
<property name="url" value="http://bart.gov/dev/schedules/google_transit.zip" />
<property name="defaultAgencyId" value="BART" />
<property name="defaultBikesAllowed" value="true" />
</bean>
<!--
<bean class="org.opentripplanner.graph_builder.model.GtfsBundle">
<property name="url" value="http://www.actransit.org/wp-content/plugins/download-monitor/download.php?id=5" />
<property name="defaultAgencyId" value="ACTransit" />
<property name="defaultBikesAllowed" value="true" />
</bean>
-->
<!-- Explicitly leaving out SamTrans, GG. AC Transit might be useful. -->
</list>
</property>
</bean>
</property>
</bean>
<bean id="nedBuilder" class="org.opentripplanner.graph_builder.impl.ned.NEDGraphBuilderImpl">
<property name="gridCoverageFactory">
<bean class="org.opentripplanner.graph_builder.impl.ned.NEDGridCoverageFactoryImpl">
<property name="cacheDirectory" value="/otp/cache/ned" />
</bean>
</property>
</bean>
<bean id="osmBuilder" class="org.opentripplanner.graph_builder.impl.osm.OpenStreetMapGraphBuilderImpl">
<!-- Use an OSM provider that reads street data from an .osm file -->
<property name="provider">
<bean class="org.opentripplanner.graph_builder.impl.osm.AnyFileBasedOpenStreetMapProviderImpl">
<property name="path" value="/otp/osm/san-francisco.osm.pbf" />
</bean>
</property>
<!-- NOTE: the tutorial uses a single OSM document for the streets of Portland, Oregon.
To use OSM streets data for a GTFS feed that's outside of the Portland area, uncomment the following
section below (and comment the provider section above that uses the file /otp/cache/osm/or-wa.osm).
-->
<!-- Use an OSM provider that will download OSM data based on the stops locations (extent of agency) in the GTFS data -->
<!--
<property name="provider">
<bean class="org.opentripplanner.graph_builder.impl.osm.RegionBasedOpenStreetMapProviderImpl">
<property name="downloader">
<bean class="org.opentripplanner.graph_builder.impl.osm.OSMDownloader">
<property name="apiBaseUrl" value="http://developer.mapquest.com/web/products/open/xapi/" />
</bean>
</property>
<property name="regionsSource">
<bean class="org.opentripplanner.graph_builder.impl.TransitStopsRegionsSourceImpl" />
</property>
<property name="cacheDirectory" value="/otp/cache/osm" />
</bean>
</property>
-->
<!-- Street Traversal Permisssion and Biking weighting is configurable, but we'll use the defaults for OSM...
Street Traversal Permisssion: what modes are allowed on certain road/surface types (e.g., no cars on bike lanes, etc...)
Bike weighting: the planner is using a 'shortest path' algorithm to choose one route from another. To prefer certain paths
for biking (e.g., bike lanes), we can make the theoretical lenght of a street type shorter or longer, thus
more or less attractive to the routing engine. Weights of > 1.0 make a road type shorter (more attactive)
@see http://wiki.openstreetmap.org/wiki/OSM_tags_for_routing/Access-Restrictions
@see https://github.com/openplans/OpenTripPlanner/blob/master/opentripplanner-graph-builder/src/main/java/org/opentripplanner/graph_builder/impl/osm/DefaultWayPropertySetSource.java
-->
<property name="defaultWayPropertySetSource">
<bean class="org.opentripplanner.graph_builder.impl.osm.DefaultWayPropertySetSource" />
</property>
</bean>
<bean id="transitStreetLink" class="org.opentripplanner.graph_builder.impl.TransitToStreetNetworkGraphBuilderImpl" />
<bean id="optimizeTransit" class="org.opentripplanner.graph_builder.impl.OptimizeTransitGraphBuilderImpl" />
<bean id="graphBuilderTask" class="org.opentripplanner.graph_builder.GraphBuilderTask">
<!-- contraction hierarchies -->
<!-- commented out
<property name="modes">
<list>
<bean class="org.opentripplanner.routing.core.TraverseOptions">
<property name="mode" value="BICYCLE" />
<property name="optimize" value="QUICK" />
</bean>
<bean class="org.opentripplanner.routing.core.TraverseOptions">
<property name="mode" value="BICYCLE" />
<property name="optimize" value="SAFE" />
</bean>
<bean class="org.opentripplanner.routing.core.TraverseOptions">
<property name="mode" value="WALK" />
<property name="optimize" value="QUICK" />
</bean>
</list>
</property>
<property name="contractionFactor" value="0.992" />
-->
<!-- typical config -->
<property name="graphBundle" ref="graphBundle" />
<property name="graphBuilders">
<list>
<ref bean="gtfsBuilder" />
<ref bean="osmBuilder" />
<ref bean="transitStreetLink" />
<!-- <ref bean="nedBuilder" /> -->
<ref bean="optimizeTransit" />
</list>
</property>
</bean>
</beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment