My Platform: Ubuntu 10.04 (Lucid) LTS
I found a lot of information on the internet, but a lot of it is old and often links are not working which didn't make my task any easier.
I followed several approaches, but they didn't work out. I'm a newbe to this, but I think installing and configuration can't be that difficult.
My question: How can I install OTP on my server and configure it ready for using the API?
See below.
=========================== Approach by Github:
// STEP 1:
sudo apt-get update
sudo apt-get install tomcat6 maven2 subversion default-jdk wget iptables tomcat6-examples tomcat6-admin
sudo apt-get install git// STEP 2:
git clone https://github.com/opentripplanner/OpenTripPlanner
cd OpenTripPlanner
git checkout stable==> The below alternative didn't work: (error: branch cannot be found)
git clone https://github.com/opentripplanner/OpenTripPlanner.git
git checkout mmri-rt (for mmri-rt branch)
mvn package -DskipTests// STEP 3: cd root
mkdir graph (upload changed config file "graph-config.xml", I used ftp)// STEP 4:
mvn package -DskipTests
cd opentripplanner-graph-builder/target (error: /target not found)
java -Xmx2048M -jar graph-builder.jar /root/graph/graph-config.xml==> The below also didn't work:
mvn package -DskipTests
./build-old /root/graph/graph-config.xml=========================== Approach by Opentripplanner.org:
STEP 1:
cd root
mkdir otp
wget http://maven.conveyal.com.s3.amazonaws.com/org/opentripplanner/otp/0.19.0/otp-0.19.0-shaded.jar
wget http://maven.conveyal.com.s3.amazonaws.com/org/opentripplanner/otp/maven-metadata.xml
wget http://maven.conveyal.com.s3.amazonaws.com/org/opentripplanner/otp/0.19.0/otp-0.19.0.pomSTEP 2:
apt-get install maven2
mvn install:install-file -Dfile=otp-0.19.0-shaded.jar -DpomFile=otp-0.19.0.pomSTEP 3:
cd root/.m2/repository/org/opentripplanner/otp/0.19.0
java -jar otp-0.19.0.jar==> error:
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/opentripplanner/standalone/OTPMain : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: org.opentripplanner.standalone.OTPMain. Program will exit.The below links provide information:
// Old github manual:
https://github.com/opentripplanner/OpenTripPlanner/wiki/SettingUpOTPServer
// Opentripplanner.org manual:
http://docs.opentripplanner.org/en/latest/Basic-Usage/#get-otp
// Build een graph file:
https://github.com/opentripplanner/OpenTripPlanner/wiki/GraphBuilder
// Run the webapp in Tomcat:
https://github.com/opentripplanner/OpenTripPlanner/wiki/RunningTheWebappInTomcat
// About realtime planner branch:
https://groups.google.com/forum/#!msg/transit-developers/MbGRNM9keJ8/vYmSKLQRKsQJ
// API DOC:
http://dev.opentripplanner.org/apidoc/0.15.0/
// Java doc:
http://dev.opentripplanner.org/javadoc/0.19.0/
// Issues with OTP
https://github.com/opentripplanner/OpenTripPlanner/issues/2193
// running webap in tomcat:
https://github.com/opentripplanner/OpenTripPlanner/wiki/RunningTheWebappInTomcat
// posts:
https://groups.google.com/forum/#!forum/opentripplanner-dev
Further question: On the site ( https://groups.google.com/forum/#!msg/transit-developers/MbGRNM9keJ8/vYmSKLQRKsQJ ) I read that a "graph-builder.xml" file is not used anymore in newer versions. Configuration should take place using the command line. But how can you safe a number of settings? As a backup for example to restore.
--
You received this message because you are subscribed to the Google Groups "Transit Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to transit-develop...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I hope it is helpful
for other newbies, the below steps allowed me to install OTP on my Ubuntu 14.04
server:
=> Create directory:
cd /home
mkdir planner
cd planner
mkdir otp
cd otp
=> Download gtfs and
OSM:
wget "http://developer.trimet.org/schedule/gtfs.zip" -0
trimet.gtfs.zip
wget https://s3.amazonaws.com/metro-extracts.mapzen.com/portland_oregon.osm.pbf
=> Get java 1.8 or
higher:
sudo apt-get update
sudo apt-get install default-jre
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
=> Download
opentripplanner:
wget
http://maven.conveyal.com.s3.amazonaws.com/org/opentripplanner/otp/0.19.0/otp-0.19.0-shaded.jar
=> Run the
standalone executable:
java -Xmx4G -jar otp-0.19.0-shaded.jar
I found that the following configuration files can be used:
Please find summarized the settings I was able to find for each file:
// otp-config.json
{
}
// build-config.json
{
subwayAccessTime: 2.5,
stationTransfers: true,
fetchElevationUS: true,
"elevationBucket" : {
"accessKey" : "your-aws-access-key",
"secretKey" : "corresponding-aws-secret-key",
"bucketName" : "ned13"
},
// Select the custom fare "seattle"
fares: "seattle",
// OR this alternative form that could allow additional configuration
fares: {
type: "seattle"
},
fares: {
// Combine two fares by simply adding them
combinationStrategy: "additive",
// First fare to combine
fare0: "new-york",
// Second fare to combine
fare1: {
type: "bike-rental-time-based",
currency: "USD",
prices: {
// For trip shorter than 30', $4 fare
"30": 4.00,
// For trip shorter than 1h, $6 fare
"1:00": 6.00
}
}
},
osmNaming: "portland"
}
// build-config.json
{
routingDefaults: {
walkSpeed: 2.0,
stairsReluctance: 4.0,
carDropoffTime: 240
},
boardTimes: {
AIRPLANE: 2700
},
alightTimes: {
AIRPLANE: 1200
},
timeouts: [5, 4, 3, 1],
// Routing defaults are any public field or setter in the Java class
// org.opentripplanner.routing.core.RoutingRequest
routingDefaults: {
numItineraries: 6,
walkSpeed: 2.0,
stairsReluctance: 4.0,
carDropoffTime: 240
},
updaters: [
// GTFS-RT service alerts (frequent polling)
{
type: "real-time-alerts",
frequencySec: 30,
url: "http://developer.trimet.org/ws/V1/FeedSpecAlerts/appID/0123456789ABCDEF",
feedId: "TriMet"
},
// Polling bike rental updater.
// sourceType can be: jcdecaux, b-cycle, bixi, keolis-rennes, ov-fiets,
// city-bikes, citi-bike-nyc, next-bike, vcub, kml
{
type: "bike-rental",
frequencySec: 300,
sourceType: "city-bikes",
url: "http://host.domain.tld"
},
<!--- San Francisco Bay Area bike share -->
{
"type": "bike-rental",
"frequencySec": 300,
"sourceType": "sf-bay-area",
"url": "http://www.bayareabikeshare.com/stations/json"
}
// Polling bike rental updater for DC bikeshare (a Bixi system)
// Negative update frequency means to run once and then stop updating (essentially static data)
{
type: "bike-rental",
sourceType: "bixi",
url: "https://www.capitalbikeshare.com/data/stations/bikeStations.xml",
frequencySec: -1
},
// Bike parking availability
{
type: "bike-park"
}
// Polling for GTFS-RT TripUpdates)
{
type: "stop-time-updater",
frequencySec: 60,
// this is either http or file... shouldn't it default to http or guess from the presence of a URL?
sourceType: "gtfs-http",
url: "http://developer.trimet.org/ws/V1/TripUpdate/appID/0123456789ABCDEF",
feedId: "TriMet"
},
// Streaming differential GTFS-RT TripUpdates over websockets
{
type: "websocket-gtfs-rt-updater"
},
// OpenTraffic data
{
"type": "opentraffic-updater",
"frequencySec": -1,
// relative to OTP's working directory, where is traffic data stored.
// Should have subdirectories z/x/y.traffic.pbf (i.e. a tile tree of traffic tiles)
"tileDirectory": "traffic"
}
]
}
Bicycle rental systems, the following settings can be used:
<?xml version="1.0" encoding="utf-8" ?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document id="root_doc">
<Schema name="citybikes" id="citybikes">
<SimpleField name="ID" type="int"></SimpleField>
</Schema>
<Placemark>
<name>A Bike Station</name>
<ExtendedData><SchemaData schemaUrl="#citybikes">
<SimpleData name="ID">0</SimpleData>
</SchemaData></ExtendedData>
<Point><coordinates>24.950682884886643,60.155923430488102</coordinates></Point>
</Placemark>
</Document></kml>
This is the latest API documentation I found:
http://dev.opentripplanner.org/apidoc/0.15.0/
With regards to the above I have the following Questions:
Best regards,
Bastiaan
Hi Bastiaan,
To unsubscribe from this group and stop receiving emails from it, send an email to transit-developers+unsub...@googlegroups.com.