NDD Transit GeneratorTransit Generator
Overview
A transit generator provides the mechanism to link a vehicle class to transit data (distance or time matrices). A transit generator can either reference a cached transit set from a previous request, or provide an inline transit set directly. When neither is provided, the API generates a transit set from the road network using the geocodes on the locations in the model.
Applicable models
- NDD
ndd-cmibu6krtqja
TransitGenerator
Schema definition
message TransitGenerator {
required string id = 1;
optional string requestId = 2;
optional TransitSet transitSet = 3;
}Fields
- id
- A unique identifier for this transit generator, referenced by vehicle class attributes.
- requestId
- An optional request identifier used to recover a cached transit set from a previous solve. This avoids recomputing transit data when solving variations of the same model.
- transitSet
- An optional inline transit set providing custom transit values. If both
requestIdandtransitSetare omitted, the API generates transit data from the road network.
Examples
A transit generator that uses road-network-generated data (the most common usage):
id: "road-time"A transit generator using a cached transit set from a previous request:
id: "road-time"
requestId: "abc123-def456-ghi789"A transit generator with an inline transit set:
id: "custom-time"
transitSet {
transits { fromId: "loc-A" toId: "loc-B" value: 15.5 }
transits { fromId: "loc-B" toId: "loc-A" value: 16.2 }
}Notes
- When no
requestIdortransitSetis specified, all locations must have valid geocodes for road network matrix generation. - Reusing a
requestIdfrom a previous solve can significantly reduce solve times by avoiding redundant matrix computation.