transportChain, every intermediate stopping point is represented as a HUB with its own location.
See the logistics hubs guide for modelling transfer activity and hub emissions at these stopping points.
What a location identifies
Where locations appear
origin and destination fields.
Use the same location object inside transportChain hub elements for intermediate stops.Location types
Every location has a requiredtype.
The type tells TerraTwin what kind of resolved point you want back.
It can be used with any supported way of identifying a location.
PLACE
AIRPORT
iataCode is provided, that airport is used directly.
Otherwise TerraTwin selects a nearby eligible airport from the supplied coordinates, address, city, postcode, or other reference point.RAIL_YARD
HARBOR
unLoCode is provided, that harbor is used directly.
Otherwise TerraTwin selects a nearby eligible harbor from the supplied coordinates, address, city, postcode, IATA airport code, or other reference point.type do not need to match.When the identifier already points to the requested type, TerraTwin resolves that location directly. For example, an iataCode with type: "AIRPORT" identifies that airport.When the identifier points to a different type, TerraTwin treats it as a reference point and finds the closest suitable location of the requested type. For example, an iataCode with type: "HARBOR" finds the closest suitable harbor to that airport. A unLoCode with type: "AIRPORT" finds the closest suitable airport to that harbor.Ways to define a location
TerraTwin accepts several location shapes. Choose the most precise information you have.Coordinates
Use decimal WGS 84 coordinates: the same latitude and longitude format used by tools such as Google Maps. Coordinates are sufficient by themselves to identify a location.IATA airport code
Use a three-letteriataCode for airports.
An IATA code is sufficient by itself to identify an airport.
Codes are case-insensitive and normalized to uppercase.
UN/LOCODE
UseunLoCode for locations represented by UN/LOCODE.
For harbors, a full five-character UN/LOCODE directly identifies the harbor.
Codes are case-insensitive and normalized to uppercase.
countryCode.
TerraTwin combines them into the full five-character code.
Structured address
Use structured address fields when you have them. Structured addresses usually produce better matches than freeform addresses and are tolerant of minor data-entry issues. A full structured address usesstreet, postcode, city, and countryCode.
region can improve matching when other fields are missing or ambiguous.
countryCode accepts ISO 3166-1 alpha-2, alpha-3, and numeric country codes, such as GB, GBR, or 826.Partial structured address
When you do not have a full street address, TerraTwin can still geocode less precise locations. For partial structured addresses,countryCode is always required. This applies whether you provide a street without a postcode, a postcode without a city, a city-only location, or any other incomplete combination of structured address fields.
Freeform address
Useaddress when the address is available as one unstructured string.
Matching and selection behavior
When you provide a transport facility directly, TerraTwin uses that explicit facility. For example,type: "AIRPORT" with iataCode: "LHR" uses Heathrow directly.
Likewise, type: "HARBOR" with unLoCode: "GBSOU" uses Southampton directly.
When you provide a reference point instead, TerraTwin selects an appropriate facility near that point.
That selection can consider operational constraints from the transport operation.
Airport from freeform address
AMS].Harbor from a partial structured address
NOOSL] will likely be selected.- Proximity to the supplied location — closer facilities are generally preferred.
- Customs-border crossings — facilities that require crossing a customs border to reach are heavily penalized in the selection score.
- Runway suitability — airport selection considers whether the runways can accommodate the selected aircraft.
- Harbor compatibility — harbor selection considers the vessel type and capacity used by the associated
WATERtransport operation. - Rail network availability — rail-yard selection considers whether the facility is connected to a suitable rail network.
CAMTR] than to any US container terminal. However, because using Montreal would require crossing the US-Canada customs border, TerraTwin will instead select the port of Portland [USPWM].
Portland [USPWM] chosen over Montreal [CAMTR] to avoid unnecessary border crossing
Multiple inputs on the same location
When several location properties are supplied together, TerraTwin resolves the location using a priority order that depends on the requestedtype.
PLACE, but not for every location type. For example, an AIRPORT location with both iataCode and coordinates will resolve from the IATA code first, while a HARBOR location with both unLoCode and coordinates will resolve from the UN/LOCODE first.AIRPORT, HARBOR, and RAIL_YARD, lower-priority inputs can still be useful as reference points when the highest-priority identifier is not supplied. For example, you can provide coordinates with type: "HARBOR" to ask TerraTwin to find the closest suitable harbor to those coordinates.
Examples
1. Simple origin and destination
Use post code levelorigin and destination for the shipment endpoints.
Postcode SW1A 1AA London to postcode 1049 Belgium
2. Airport to airport transport
Use IATA codes when you already know the airports.Madrid-Barajas [IATA:MAD] airport to Miami International Airport [IATA:MIA]
3. Harbor to harbor
Usetype: "HARBOR" when you want the route to start and/or end at maritime ports. A full UN/LOCODE is enough to identify each harbor directly.
- Southhampton harbor
- Southampton harbor to Kiel harbor
- Kiel harbor
Port of Southhampton [GBSOU] to Port of Kiel [DEKEL]
4. Structured address to airport transport
This asks TerraTwin to start at an address and end at a specific airport. For the air segment, TerraTwin will automatically add a first mile road connection from the address to the selected airport.- Madrid First mile
- Madrid Palace to Rome Fiumicino Airport
- Fiumicino Airport
Flight from Adolfo Suárez Madrid–Barajas Airport [IATA:MAD] to Rome Fiumicino Airport [IATA:FCO]
5. Free form addresses to identify places
Use freeform addresses when you have a human readable address instead of structured information. Always includecountryCode so TerraTwin can geocode the address unambiguously.
Memphis, Tennessee to Wall Street, New York
6. Coordinate to coordinate
Use coordinates when you already know the exact origin and destination points. Coordinates are sufficient by themselves, so no address fields or country codes are needed.51°30'10.80"N 00°07'37.20"W (London) to 50°56'27.60"N 06°57'28.80"E (Cologne)
7. Intermediate transfer point
Use aHUB element for intermediate transfer points in a transportChain.
The hub has its own location and can be a place, airport, rail yard, or harbor.
- Rottendam transfer
- Copenhagen to Bucharest
- Constanța transfer
Copenhagen to Bucharest
hubType.
With automatic hub insertion enabled, TerraTwin selects a default from the surrounding ROAD to WATER transition.
With options.hubInsertion: "MANUAL", the hub remains a location boundary but does not contribute hub emissions.
See How a hub type is selected.Recommendations
Always provide a location type
type on every origin, destination, and hub location. Use PLACE for general geographic points, or AIRPORT, HARBOR, and RAIL_YARD when you want TerraTwin to resolve a specific facility type.Use the most precise identifier you have
iataCode for known airports, unLoCode for known harbors, and structured address fields when address components are available.Include country codes for addresses
countryCode with structured, partial structured, and freeform addresses. Also include it when using a three-letter unLoCode so TerraTwin can construct the full five character code.Be explicit when you want a facility
AIRPORT, HARBOR, or RAIL_YARD when the route should pass through a transport facility. Use PLACE when you want the shipment endpoint itself and TerraTwin will add first-mile or last-mile connections as needed.Use hubs for known transfer points
HUB elements in transportChain, and give each hub its own location. This is the right way to force a specific airport, harbor, rail yard, or transfer place into the route.Common mistakes
- Omitting
typefrom a location. - Using
addressor structured address fields withoutcountryCode. - Sending degrees/minutes/seconds instead of decimal WGS 84 coordinates.
- Using a three-letter
unLoCodewithoutcountryCode. - Expecting
type: "PLACE"to select an airport, harbor, or rail yard. UseAIRPORT,HARBOR, orRAIL_YARDwhen you want a facility.