StorageConfig Data Type

Configure paths to each individual file resource. Use URIs to specify paths. If a parameter is specified, it override any local files, and the local file is NOT loaded.

Local file access is supported. Use the following URI format:

     file:/a/b/c/filename.ext                    -- Absolute URI
     ../street/streetGraph.obj                   -- Relative URI (to OTP base path)
     graph-${otp.serialization.version.id}.obj   -- Relative path with property substitution
 
Google Cloud Storage(GCS) access is supported. Use the following URI format:
     gs://bucket-name/a/b/c/blobname.ext
 

Example build-config.json:

 {
     osmWayPropertySet: "norway",
     storage: {
         gsCredentials: "${OTP_GOOGLE_SERVICE_ACCOUNT}",
         osm: [ "gs://otp-test-bucket/a/b/osm-oslo-mini.pbf" ],
         dem: [ "file:/public/dem/norway.dem.tif" ],
         gtfs: ["gs://otp-bucket/rut-gtfs.zip", "gs://otp-bucket/vy-gtfs.zip"],
         buildReportDir: "gs://otp-bucket/build-report"
     }
  }
 
In the example above, the Google cloud service credentials file resolved using an environment variable. The OSM and GTFS data is streamed from Google Cloud Storage, the elevation data is fetched from the local file system and the build report is stored in the cloud. All other artifacts like the loaded graph, saved graph and NeTEx files are loaded and written from/to the local base directory - it they exist.

Properties
name data type constraints description
gsCredentials string   Local file system path to Google Cloud Platform service accounts credentials file. The credentials is used to access GCS urls. When using GCS from outside of the bucket cluster you need to provide a path the the service credentials. Environment variables in the path is resolved.

Example: "credentialsFile" : "${MY_GOC_SERVICE"} or {@code "app-1-3983f9f66728.json" : "~/"}

This is a path to a file on the local file system, not an URI.

This parameter is optional. Default is null.

streetGraph string   URI to the street graph object file for reading and writing. The file is created or overwritten if OTP saves the graph to the file.

Example: "streetGraph" : "file:///Users/kelvin/otp/streetGraph.obj"

This parameter is optional. Default is null.

graph string   URI to the graph object file for reading and writing. The file is created or overwritten if OTP saves the graph to the file.

Example: "graph" : "gs://my-bucket/otp/graph.obj"

This parameter is optional. Default is null.

osm array of string   Array of URIs to the open street map pbf files (the pbf format is the only one supported).

Example: "osm" : [ "file:///Users/kelvin/otp/norway-osm.pbf" ]

This parameter is optional.

dem array of string   Array of URIs to elevation data files.

Example: "osm" : [ "file:///Users/kelvin/otp/norway-dem.tif" ]

This parameter is optional.

gtfs array of string required Array of URIs to GTFS data files .

Example: "transit" : [ "file:///Users/kelvin/otp/gtfs.zip", "gs://my-bucket/gtfs.zip" ]"

This parameter is optional.

netex array of string required Array of URIs to Netex data files.

Example: "transit" : [ "file:///Users/kelvin/otp/netex.zip", "gs://my-bucket/netex.zip" ]"

This parameter is optional.

buildReportDir string   URI to the directory where the graph build report should be written to. The html report is written into this directory. If the directory exist, any existing files are deleted. If it does not exist, it is created.

Example: "osm" : "file:///Users/kelvin/otp/buildReport"

This parameter is optional. Default is null in which case the report is skipped.

localFileNamePatterns LocalFilenamePatterns   Configure patterns for auto-detection of input files in the local base directory. Resolving input files is only provided for files in the base directory not for any external resources.

Example

{
  "gsCredentials" : "...",
  "streetGraph" : "...",
  "graph" : "...",
  "osm" : [ "...", "..." ],
  "dem" : [ "...", "..." ],
  "gtfs" : [ "...", "..." ],
  "netex" : [ "...", "..." ],
  "buildReportDir" : "...",
  "localFileNamePatterns" : {
    "gtfs" : { },
    "netex" : { },
    "osm" : { },
    "dem" : { }
  }
}