public class OtpsEntryPoint extends Object
OtpsRouter
,
OtpsPopulation
Constructor and Description |
---|
OtpsEntryPoint(OTPServer otpServer) |
Modifier and Type | Method and Description |
---|---|
OtpsCsvOutput |
createCSVOutput() |
OtpsPopulation |
createEmptyPopulation() |
OtpsPopulation |
createGridPopulation(double top,
double bottom,
double left,
double right,
int rows,
int cols)
Create a grid of evently spaced points in a rectangle.
|
OtpsRoutingRequest |
createRequest() |
static OtpsEntryPoint |
fromArgs() |
static OtpsEntryPoint |
fromArgs(String[] args)
Create an OTP scripting entry point using the same command-line parameters as used by the OTP
application.
|
Object |
getRetval() |
OtpsRouter |
getRouter() |
OtpsRouter |
getRouter(String routerId) |
OtpsPopulation |
loadCSVPopulation(String filename,
String latColName,
String lonColName)
Load a population from a CSV file.
|
OtpsPopulation |
loadRasterPopulation(String filename)
Load a population from a raster (GeoTIFF) file.
|
void |
setRetval(Object retval) |
public OtpsEntryPoint(OTPServer otpServer)
public static OtpsEntryPoint fromArgs(String[] args) throws Exception
#!/usr/bin/jython from org.opentripplanner.scripting.api import OtpsEntryPoint otp = OtpsEntryPoint.fromArgs([ "-g", "." ]) ...One can then run jython with:
CLASSPATH=otp.jar jython myscript.py
args
- Command-line arguments, as used by the application.Exception
public static OtpsEntryPoint fromArgs() throws Exception
Exception
public OtpsRouter getRouter()
public OtpsRouter getRouter(String routerId)
routerId
- The ID of the router to request.public OtpsRoutingRequest createRequest()
public OtpsPopulation createEmptyPopulation()
public OtpsPopulation createGridPopulation(double top, double bottom, double left, double right, int rows, int cols)
top
- bottom
- left
- right
- rows
- cols
- public OtpsPopulation loadCSVPopulation(String filename, String latColName, String lonColName) throws IOException
filename
- The filename to load data from.latColName
- The name of the latitude column header.lonColName
- The name of the longitude column header.IOException
- If something bad happens (file not found, invalid format...)public OtpsPopulation loadRasterPopulation(String filename)
filename
- The filename to load data from.public OtpsCsvOutput createCSVOutput()
public void setRetval(Object retval)
retval
- Set the return value of the script, which will be returned in web mode. For
command-line mode, the return value is not used (for now).public Object getRetval()
Copyright © 2018. All rights reserved.