Getting traffic forecast
A traffic forecast is produced by the simulation engine. The simulation engine uses the link network for its calculation. Therefore you can retrieve the forecast results of Optima only on the link network or on streets that belong to the link network.
The endpoint generally provides huge XML responses.
Important: You can adopt the HTTP header Accept-Encoding:gzip to ask the server to provide gzipped data. This is particularly useful to save bandwidth, and also using the RLIN module.
If you have installed the RLIN module (see → Installing pre-computed RLIN module) and you make a query based only on the strt location, with an empty request payload, you can get a pre-computed and quicker response associated to the latest base simulation.
More generally, you can make:
- a query based only on the strt location, with an empty request payload, also if RLIN module is not available (with a slower response time).
- a query based on any other combination of parameters, with an empty request payload.
- a query based on any other combination of parameters, with a request payload.
Authentication phase
Before using the endpoint, you must run the authentication phase (→ Login).
After the authentication, a session opens and a valid session token persists until:
- The end of the session time-out, that is set through the parameter sessionTimeout (→ OptimaWSI configuration > OptimaAuth node).
- An explicit Logout call (→ Logout).
Request
GET
https://<OPTIMA_HOST_IP_ADDRESS>:<PORT_NUMBER>/datex-interface/orca2/rlin/{location}
Request resource
| Resource | Description |
|---|---|
|
{location} |
Supported locations are:
For more details, please see → Basics on locations. |
Request parameters
| Parameter | Required | Description |
|---|---|---|
|
startTime |
NO |
Start of the time interval used to compute the forecast results. You must either specify both startTime and endTime, or neither. If startTime=endTime=null, both are set to the values of the last simulation. The format is ISO 8601 with or without timezone. |
|
endTime |
NO |
End of the time interval used to compute the forecast results. You must either specify both startTime and endTime, or neither. If startTime=endTime=null, both are set to the values of the last simulation. The format is ISO 8601 with or without timezone. |
|
tsys |
NO |
It specifies the transport system for which forecast results are provided. You can ask for the results of more than one transport system. Results are returned if all of these transport systems are valid transport systems. If this parameter is not specified, the forecast results refer to the equivalent transport system. |
|
simulationtype |
NO |
String type. Tip: The tables involved are all the tables characterized by the indexes from -N to 2 as indicated in the node <linkResultsDataInterface> of the file optima-configuration.xml. Example:
The table associated to the index -N is related to the Nth day before the current day. Important: After the installation, only tables from 0 to 2 are configured. The tables with negative indexes are dependent on the customer context. You can specify these values:
The main possible cases are: |
|
idno |
NO |
Integer type. Available only when using the strt location and in conjunction with the parameter fromnode. ID of the street for which results are queried. |
|
fromnode |
NO |
Integer type. Available only when using the strt location and in conjunction with the parameter idno. ID of the start node of the street for which results are queried. |
|
code |
NO |
String type. Available only when using the openlr location. This is the OpenLR code of the street, or streets, for which results are queried. |
|
type |
NO |
String type. Mandatory when using the ploc location. Optionally, it can be used in conjunction with the parameters pril and secl. It is the type of the alternative graph for which results are queried. Important: The type depends on the specific project, there is no enumeration of all possible types. An example of a type commonly used is TMC. For further specifications about alternative graphs managed by Optima: → Transportation Data Exchange (TDE). |
|
pril |
NO |
String type. Predefined primary location ID (to node). You can specify a value for pril only when you query for ploc-type locations. Furthermore, for ploc locations, you have to either specify both pril and secl (thus selecting a single location), or none of the two. This is part of the key of the street for which results are queried. For further specifications about alternative graphs managed by Optima: → Transportation Data Exchange (TDE). |
|
secl |
NO |
String type. Predefined secondary location ID (from node). You can specify a value for secl only when you query for ploc-type locations. Furthermore, for ploc locations, you have to either specify both pril and secl (thus selecting a single location), or none of the two. This is part of the key of the street for which results are queried. For further specifications about alternative graphs managed by Optima: → Transportation Data Exchange (TDE). |
|
fore |
NO |
Integer type. The fore parameter is used to define the distance in seconds between the simulation instant and the instant when the request is sent. The distance provides how far in the future you want the result with respect to the NOW simulation time, and fully depends on the time of the request. The fore value can be negative, representing a moment in the past. Please note that the request parameter fore is returned as it is in the homonym field in the response. Important: If in the response of the query is returned as a fore value different from the value of the input parameter, it is not meaningful and MUST be ignored. Important: The valuer of the input parameter fore IS NOT correlated with the column table.fore of the DB tables rlin_tsys_tre* |
|
simid |
NO |
Integer type. Simulation ID of the simulation for which results are queried. |
Request content-type
application/xml
Request body (payload)
You can specify - only for {location}=strt - a list of streets in the body (see → Example: Latest forecast results for a specific subset of streets).
Response status
| HTTP status | Description |
|---|---|
|
200 OK |
Result of the processed request. |
|
304 Not modified |
If the RLIN module is installed and you make a request based only on the strt location, with an empty request payload. The code 304 is indicative of a request using the if-modified-since HTTP header (see Mozilla HTTP Header) when there is not newer version of the forecast than the date supplied in the header. |
|
400 Bad request |
Several conditions can be classified under this code. Generally, when the API has been called with wrong arguments. In some cases the error message contains more specific information. For example, an ill-formed body such as this: street:55233519,65166505&street:55233519,65166506 ... Is handled by a response 400 with the following error details: These streets were wrongly declared: '55233519,65166505&street:55233519,65166506'
|
|
404 Not found |
Result of the processed request. For example, in case of a missing street or a missing link. If the RLIN module is installed and you make a request based only on the strt location, with an empty request payload, code 404 is indicating the recomputing of the results. |
|
500 Internal server error |
Endpoint instance is not found. |
Response content-type
application/xml
Response output
XML message describing a forecast result as defined in orca2.xsd.
Request
https://<OPTIMA_HOST_IP_ADDRESS>:<PORT_NUMBER>/datex-interface/orca2/rlin/strt
Response status
| HTTP status | Description |
|---|---|
|
200 OK |
Result of the processed request. |
Response output
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Orca2Model xmlns="http://sistemaits.com/orca2/1">
<exchange>
<provider>PTV-OPTIMA</provider>
</exchange>
<payloadPublication xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ForecastPublication" publicationTime="2016-02-09T14:29:01.165Europe/Rome">
<MetaInfo>
<LocationUsed xsi:type="LocationUsedTDE" type="Street"/>
<timezone>Europe/Rome</timezone>
</MetaInfo>
<forecastData>
<trafficElement xsi:type="StreetTraffic" strt="55192980" fsnd="65688430" sped="52.845" fore="0" flow="101.08" dens="1.913" time="7.069" iflw="101.113" oflw="101.064" o
uca="5100.0" quel="0.0" quen="0.294" esta="0" nveh="0.082" stor="51.426" queu="0.024" ista="0" baseSpeed="52.845" startTime="2016-02-09T14:00:00" endTime="2016-02
-09T14:15:00"/>
<trafficElement xsi:type="StreetTraffic" strt="55192980" fsnd="65688430" sped="52.831" fore="900" flow="109.023" dens="2.064" time="7.07" iflw="109.152" oflw="108.96"
ouca="5100.0" quel="0.001" quen="0.294" esta="0" nveh="0.089" stor="51.413" queu="0.026" ista="0" baseSpeed="52.831" startTime="2016-02-09T14:15:00” endTime="2016
-02-09T14:30:00"/>
<trafficElement xsi:type="StreetTraffic" strt="55192980" fsnd="65688430" sped="52.837" fore="1800" flow="112.271" dens="2.125" time="7.07" iflw="112.278" oflw="112.267
" ouca="5100.0" quel="0.001" quen="0.294" esta="0" nveh="0.091" stor="51.407" queu="0.027" ista="0" baseSpeed="52.837" startTime="2016-02-09T14:30:00” endTime="20
16-02-09T14:45:00”/>
<trafficElement xsi:type="StreetTraffic" strt="55192980" fsnd="65688430" sped="52.837" fore="2700" flow="112.87" dens="2.136" time="7.07" iflw="112.877" oflw="112.866"
ouca="5100.0" quel="0.001" quen="0.294" esta="0" nveh="0.092" stor="51.406" queu="0.027" ista="0" baseSpeed="52.837" startTime="2016-02-09T14:45:00" endTime="201
6-02-09T15:00:00"/>
<trafficElement xsi:type="StreetTraffic" strt="55192980" fsnd="65688430" sped="52.839" fore="3600" flow="112.182" dens="2.123" time="7.07" iflw="112.167" oflw="112.19"
ouca="5100.0" quel="0.001" quen="0.294" esta="0" nveh="0.091" stor="51.407" queu="0.027" ista="0" baseSpeed="52.839" startTime="2016-02-09T15:00:00" endTime="201
6-02-09T15:15:00"/>
<trafficElement xsi:type="StreetTraffic" strt="55192980" fsnd="65688430" sped="52.834" fore="4500" flow="113.651" dens="2.151" time="7.07" iflw="113.683" oflw="113.636
" ouca="5100.0" quel="0.001" quen="0.294" esta="0" nveh="0.092" stor="51.405" queu="0.027" ista="0" baseSpeed="52.834" startTime="2016-02-09T15:15:00" endTime="20
16-02-09T15:30:00"/>
…
</forecastData>
</payloadPublication>
</Orca2Model>
In case of {location}=strt, you can also specify a body (payload) where there can be indicated a specific list of streets.
The body must be encoded according to the format x-www-form-urlencoded.
The format is raw string, where each street element is separated by an ampersand & and defined by a pair of values (idno, fromnode) separated by a comma:
street=idno_1,fromnode_1&street=idno_2,fromnode_2&...&street=idno_k,fromnode_k&...
Example of a body with three streets:
street=50,4501&street=127,3154&street=2345,3674
Request
https://<OPTIMA_HOST_IP_ADDRESS>:<PORT_NUMBER>/datex-interface/orca2/rlin/strt
Request body (payload)
street=50,4501&street=127,3152
Important: The response is based on a subset of these two streets only.
Response status
| HTTP status | Description |
|---|---|
|
200 OK |
Result of the processed request. |
|
400 Bad request |
Several conditions can be classified under this code. Generally, when the API has been called with wrong arguments. |
|
404 Not found |
Result of the processed request. For example, in case of a missing street or a missing link. |
Response output
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Orca2Model xmlns="http://sistemaits.com/orca2/1" xmlns:ns2="http://datex2.eu/schema/2/2_0">
<exchange>
<provider>PTV-OPTIMA</provider>
</exchange>
<payloadPublication xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ForecastPublication" publicationTime="2019-10-07T16:54:33.848">
<MetaInfo>
<LocationUsed xsi:type="LocationUsedTDE" type="Street"/>
<timezone>Europe/Berlin</timezone>
</MetaInfo>
<forecastData simulationId="35835" applicationName="TRE_tattico" base="true" simulationStartTime="2015-12-24T14:45:00" simulationEndTime="2015-12-24T14:45:00" simulationPeriodStartTime="2015-12-24T14:45:00" simulationPeriodEndTime="2015-12-24T15:30:00" creationTime="2015-12-24T14:45:00">
<trafficElement xsi:type="StreetTraffic" strt="50" fsnd="4501" sped="80.0" fore="-900" flow="0.0" dens="0.0" time="3.69" iflw="0.0" oflw="0.0" ouca="5500.0" quel="0.0" quen="0.0" esta="0" nveh="0.0" stor="32.8" queu="0.0" ista="0" baseSpeed="50.0" startTime="2015-12-24T14:45:00" endTime="2015-12-24T15:00:00"/>
<trafficElement xsi:type="StreetTraffic" strt="50" fsnd="4501" sped="80.0" fore="0" flow="379.098" dens="4.739" time="3.69" iflw="380.929" oflw="377.267" ouca="5500.0" quel="0.0" quen="0.0" esta="0" nveh="0.389" stor="33.189" queu="0.0" ista="0" baseSpeed="50.0" startTime="2015-12-24T15:00:00" endTime="2015-12-24T15:15:00"/>
<trafficElement xsi:type="StreetTraffic" strt="50" fsnd="4501" sped="80.0" fore="900" flow="786.332" dens="9.829" time="3.69" iflw="787.28" oflw="785.384" ouca="5500.0" quel="0.0" quen="0.0" esta="0" nveh="0.806" stor="30.234" queu="0.0" ista="0" baseSpeed="50.0" startTime="2015-12-24T15:15:00" endTime="2015-12-24T15:30:00"/>
<trafficElement xsi:type="StreetTraffic" strt="127" fsnd="3152" sped="80.0" fore="900" flow="786.332" dens="9.829" time="3.69" iflw="787.28" oflw="785.384" ouca="5500.0" quel="0.0" quen="0.0" esta="0" nveh="0.806" stor="30.234" queu="0.0" ista="0" baseSpeed="50.0" startTime="2015-12-24T15:15:00" endTime="2015-12-24T15:30:00"/>
</forecastData>
</payloadPublication>
</Orca2Model>
Additional Notes
When a body is specified, the parameters idno and fromnode must not be set, otherwise a code 400 is returned. In case of any missing street or any missing links for any street, a code 404 is returned.
A default value for the maximum number of streets to be queried can be specified in optima-configuration.xml under the configuration node <datex-interface>.
<datex-interface>
....
<maxStreetsNum>20000</maxStreetsNum>
....
</datex-interface>
The default value is 20000.
Tip: This value has been tested to get high performances.
Request
https://<OPTIMA_HOST_IP_ADDRESS>:<PORT_NUMBER>/datex-interface/orca2/rlin/ploc?type=TMC
Response status
| HTTP status | Description |
|---|---|
|
200 OK |
Result of the processed request. |
Response output
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Orca2Model xmlns="http://sistemaits.com/orca2/1" xmlns:ns2="http://datex2.eu/schema/2/2_0">
<exchange>
<provider>PTV-OPTIMA</provider>
</exchange>
<payloadPublication xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ForecastPublication" publicationTime="2022-09-08T17:33:59.06797">
<MetaInfo>
<LocationUsed xsi:type="LocationUsedPredefined" type="TMC"/>
<timezone>Europe/Rome</timezone>
</MetaInfo>
<forecastData simulationId="813" applicationName="TRE_tattico" base="true" simulationStartTime="2022-09-08T11:15:00.039" simulationEndTime="2022-09-08T11:16:38" simulationPeriodStartTime="2022-09-08T11:00:00" simulationPeriodEndTime="2022-09-08T12:30:00" creationTime="2022-09-08T11:16:38">
<trafficElement xsi:type="PLOCTraffic" pril="16223" secl="16224" fprg="3343.2563" tprg="3405.7012" sped="45.561" fore="-900" flow="550.082" dens="12.073" time="4.985" iflw="546.9842035667012" oflw="552.2757944286441" ouca="1700.0" quel="0.0" quen="0.0" esta="0" nveh="0.7485555309025304" stor="11.024" queu="0.0" ista="0" baseSpeed="50.0" startTime="2022-09-08T10:45:00" endTime="2022-09-08T11:00:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="16224" secl="16223" fprg="0.0" tprg="62.44484" sped="51.434" fore="-900" flow="832.238" dens="16.181" time="4.302" iflw="830.1618051223886" oflw="828.3209865299013" ouca="1700.0" quel="0.0" quen="0.0" esta="0" nveh="1.0032094004176062" stor="10.35" queu="0.0" ista="0" baseSpeed="60.0" startTime="2022-09-08T10:45:00" endTime="2022-09-08T11:00:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="16223" secl="16224" fprg="3405.7012" tprg="3496.1328" sped="52.656" fore="-900" flow="554.808" dens="10.536" time="6.183" iflw="552.2757944286441" oflw="555.9111344879584" ouca="3400.0" quel="0.0" quen="0.0" esta="0" nveh="0.9482738531221212" stor="34.002" queu="0.0" ista="0" baseSpeed="55.0" startTime="2022-09-08T10:45:00" endTime="2022-09-08T11:00:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="16223" secl="16222" fprg="2035.2052" tprg="2125.6367" sped="51.4" fore="-900" flow="831.878" dens="16.184" time="6.284" iflw="831.7207059519169" oflw="830.1618051223886" ouca="3400.0" quel="0.0" quen="0.0" esta="0" nveh="1.4565912753769694" stor="33.017" queu="0.0" ista="0" baseSpeed="55.0" startTime="2022-09-08T10:45:00" endTime="2022-09-08T11:00:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="16221" secl="16222" fprg="1242.828" tprg="1283.1094" sped="28.661" fore="-900" flow="2017.077" dens="70.377" time="5.151" iflw="2005.7101990244792" oflw="1986.0512993413868" ouca="3400.0" quel="0.0" quen="0.0" esta="0" nveh="2.815096023565239" stor="12.842" queu="0.0" ista="0" baseSpeed="35.0" startTime="2022-09-08T10:45:00" endTime="2022-09-08T11:00:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="4795" secl="4794" fprg="5049.1133" tprg="5068.7163" sped="55.247" fore="-900" flow="846.834" dens="15.328" time="278.695" iflw="921.9381013564962" oflw="951.9313120778243" ouca="3600.0" quel="0.0" quen="0.0" esta="0" nveh="65.26763239219159" stor="1564.275" queu="0.0" ista="0" baseSpeed="70.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="4795" secl="4794" fprg="3745.5725" tprg="4834.571" sped="55.247" fore="-900" flow="846.834" dens="15.328" time="278.695" iflw="921.9381013564962" oflw="951.9313120778243" ouca="3600.0" quel="0.0" quen="0.0" esta="0" nveh="65.26763239219159" stor="1564.275" queu="0.0" ista="0" baseSpeed="70.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="4962" secl="4963" fprg="596.6403" tprg="608.9739" sped="29.025" fore="-900" flow="3244.871" dens="111.796" time="1.956" iflw="3095.362513197615" oflw="2976.4718992397393" ouca="3600.0" quel="0.0" quen="0.0" esta="0" nveh="1.3415475034842834" stor="3.385" queu="0.0" ista="0" baseSpeed="70.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="4963" secl="4962" fprg="330.15308" tprg="342.48663" sped="71.633" fore="-900" flow="1852.118" dens="25.856" time="0.596" iflw="1842.6963931149003" oflw="1851.734983305687" ouca="5400.0" quel="0.0" quen="0.0" esta="0" nveh="0.3102660395943874" stor="13.504" queu="0.0" ista="0" baseSpeed="75.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="4963" secl="4962" fprg="78.30779" tprg="147.26149" sped="59.323" fore="-900" flow="1861.371" dens="31.377" time="14.568" iflw="1829.788018664607" oflw="1842.6963931149003" ouca="3600.0" quel="0.0" quen="0.0" esta="0" nveh="7.906952043892804" stor="82.092" queu="0.0" ista="0" baseSpeed="70.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="4963" secl="4962" fprg="193.10013" tprg="274.89215" sped="59.323" fore="-900" flow="1861.371" dens="31.377" time="14.568" iflw="1829.788018664607" oflw="1842.6963931149003" ouca="3600.0" quel="0.0" quen="0.0" esta="0" nveh="7.906952043892804" stor="82.092" queu="0.0" ista="0" baseSpeed="70.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="4963" secl="4962" fprg="147.26149" tprg="193.10013" sped="59.323" fore="-900" flow="1861.371" dens="31.377" time="14.568" iflw="1829.788018664607" oflw="1842.6963931149003" ouca="3600.0" quel="0.0" quen="0.0" esta="0" nveh="7.906952043892804" stor="82.092" queu="0.0" ista="0" baseSpeed="70.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="4963" secl="4962" fprg="274.89215" tprg="330.15308" sped="59.323" fore="-900" flow="1861.371" dens="31.377" time="14.568" iflw="1829.788018664607" oflw="1842.6963931149003" ouca="3600.0" quel="0.0" quen="0.0" esta="0" nveh="7.906952043892804" stor="82.092" queu="0.0" ista="0" baseSpeed="70.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="4962" secl="4963" fprg="608.9739" tprg="664.2348" sped="46.515" fore="-900" flow="3210.327" dens="69.017" time="25.92" iflw="2976.4718992397393" oflw="2908.5591953345793" ouca="3600.0" quel="0.0" quen="0.0" esta="0" nveh="17.39225994260384" stor="71.799" queu="0.0" ista="0" baseSpeed="70.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="4962" secl="4963" fprg="746.02686" tprg="791.8655" sped="46.515" fore="-900" flow="3210.327" dens="69.017" time="25.92" iflw="2976.4718992397393" oflw="2908.5591953345793" ouca="3600.0" quel="0.0" quen="0.0" esta="0" nveh="17.39225994260384" stor="71.799" queu="0.0" ista="0" baseSpeed="70.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="4962" secl="4963" fprg="791.8655" tprg="860.81915" sped="46.515" fore="-900" flow="3210.327" dens="69.017" time="25.92" iflw="2976.4718992397393" oflw="2908.5591953345793" ouca="3600.0" quel="0.0" quen="0.0" esta="0" nveh="17.39225994260384" stor="71.799" queu="0.0" ista="0" baseSpeed="70.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="4962" secl="4963" fprg="664.2348" tprg="746.02686" sped="46.515" fore="-900" flow="3210.327" dens="69.017" time="25.92" iflw="2976.4718992397393" oflw="2908.5591953345793" ouca="3600.0" quel="0.0" quen="0.0" esta="0" nveh="17.39225994260384" stor="71.799" queu="0.0" ista="0" baseSpeed="70.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="1409" secl="1408" fprg="4927.5674" tprg="5442.6694" sped="93.361" fore="-900" flow="4000.0" dens="42.844" time="2493.564" iflw="3785.415937028929" oflw="3934.9393589210604" ouca="4000.0" quel="0.0" quen="0.0" esta="0" nveh="1977.4757183527909" stor="13325.26" queu="0.0" ista="2" baseSpeed="110.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="1408" secl="1407" fprg="11030.965" tprg="11089.937" sped="93.361" fore="-900" flow="4000.0" dens="42.844" time="2493.564" iflw="3785.415937028929" oflw="3934.9393589210604" ouca="4000.0" quel="0.0" quen="0.0" esta="0" nveh="1977.4757183527909" stor="13325.26" queu="0.0" ista="2" baseSpeed="110.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="1407" secl="1406" fprg="11030.965" tprg="11089.937" sped="93.361" fore="-900" flow="4000.0" dens="42.844" time="2493.564" iflw="3785.415937028929" oflw="3934.9393589210604" ouca="4000.0" quel="0.0" quen="0.0" esta="0" nveh="1977.4757183527909" stor="13325.26" queu="0.0" ista="2" baseSpeed="110.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="1407" secl="1406" fprg="10904.083" tprg="11030.965" sped="93.361" fore="-900" flow="4000.0" dens="42.844" time="2493.564" iflw="3785.415937028929" oflw="3934.9393589210604" ouca="4000.0" quel="0.0" quen="0.0" esta="0" nveh="1977.4757183527909" stor="13325.26" queu="0.0" ista="2" baseSpeed="110.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="1408" secl="1407" fprg="10904.083" tprg="11030.965" sped="93.361" fore="-900" flow="4000.0" dens="42.844" time="2493.564" iflw="3785.415937028929" oflw="3934.9393589210604" ouca="4000.0" quel="0.0" quen="0.0" esta="0" nveh="1977.4757183527909" stor="13325.26" queu="0.0" ista="2" baseSpeed="110.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="1408" secl="1407" fprg="1033.2612" tprg="1232.3629" sped="93.361" fore="-900" flow="4000.0" dens="42.844" time="2493.564" iflw="3785.415937028929" oflw="3934.9393589210604" ouca="4000.0" quel="0.0" quen="0.0" esta="0" nveh="1977.4757183527909" stor="13325.26" queu="0.0" ista="2" baseSpeed="110.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="1407" secl="1406" fprg="1033.2612" tprg="1232.3629" sped="93.361" fore="-900" flow="4000.0" dens="42.844" time="2493.564" iflw="3785.415937028929" oflw="3934.9393589210604" ouca="4000.0" quel="0.0" quen="0.0" esta="0" nveh="1977.4757183527909" stor="13325.26" queu="0.0" ista="2" baseSpeed="110.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="1409" secl="1408" fprg="6353.3394" tprg="6436.5605" sped="93.361" fore="-900" flow="4000.0" dens="42.844" time="2493.564" iflw="3785.415937028929" oflw="3934.9393589210604" ouca="4000.0" quel="0.0" quen="0.0" esta="0" nveh="1977.4757183527909" stor="13325.26" queu="0.0" ista="2" baseSpeed="110.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="1407" secl="1406" fprg="10593.811" tprg="10783.77" sped="93.361" fore="-900" flow="4000.0" dens="42.844" time="2493.564" iflw="3785.415937028929" oflw="3934.9393589210604" ouca="4000.0" quel="0.0" quen="0.0" esta="0" nveh="1977.4757183527909" stor="13325.26" queu="0.0" ista="2" baseSpeed="110.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="1408" secl="1407" fprg="10593.811" tprg="10783.77" sped="93.361" fore="-900" flow="4000.0" dens="42.844" time="2493.564" iflw="3785.415937028929" oflw="3934.9393589210604" ouca="4000.0" quel="0.0" quen="0.0" esta="0" nveh="1977.4757183527909" stor="13325.26" queu="0.0" ista="2" baseSpeed="110.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="1406" secl="1405" fprg="11649.334" tprg="11741.241" sped="93.361" fore="-900" flow="4000.0" dens="42.844" time="2493.564" iflw="3785.415937028929" oflw="3934.9393589210604" ouca="4000.0" quel="0.0" quen="0.0" esta="0" nveh="1977.4757183527909" stor="13325.26" queu="0.0" ista="2" baseSpeed="110.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="1406" secl="1405" fprg="442.84216" tprg="1015.09357" sped="93.361" fore="-900" flow="4000.0" dens="42.844" time="2493.564" iflw="3785.415937028929" oflw="3934.9393589210604" ouca="4000.0" quel="0.0" quen="0.0" esta="0" nveh="1977.4757183527909" stor="13325.26" queu="0.0" ista="2" baseSpeed="110.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="1407" secl="1406" fprg="7631.2188" tprg="7869.6" sped="93.361" fore="-900" flow="4000.0" dens="42.844" time="2493.564" iflw="3785.415937028929" oflw="3934.9393589210604" ouca="4000.0" quel="0.0" quen="0.0" esta="0" nveh="1977.4757183527909" stor="13325.26" queu="0.0" ista="2" baseSpeed="110.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="4898" secl="4899" fprg="2604.5288" tprg="2610.5664" sped="47.603" fore="-900" flow="657.341" dens="13.809" time="0.454" iflw="656.8044251127685" oflw="655.0927393842649" ouca="3600.0" quel="0.0" quen="0.0" esta="0" nveh="0.08285356536161118" stor="2.243" queu="0.0" ista="0" baseSpeed="50.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="4898" secl="4899" fprg="2543.2698" tprg="2604.5288" sped="38.076" fore="-900" flow="659.189" dens="17.312" time="5.776" iflw="658.3832277023757" oflw="656.8044251127685" ouca="3600.0" quel="0.0" quen="0.0" esta="0" nveh="1.0560481222047164" stor="22.801" queu="0.0" ista="0" baseSpeed="40.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
<trafficElement xsi:type="PLOCTraffic" pril="4899" secl="4898" fprg="550.8596" tprg="616.3567" sped="46.803" fore="-900" flow="861.926" dens="18.416" time="5.035" iflw="859.9523654916957" oflw="860.1850836684644" ouca="3600.0" quel="0.0" quen="0.0" esta="0" nveh="1.2154657531976316" stor="24.129" queu="0.0" ista="0" baseSpeed="50.0" startTime="2022-09-08T11:00:00" endTime="2022-09-08T11:15:00"/>
</forecastData>
</payloadPublication>
</Orca2Model>
If the RLIN module is installed and you make a request based only on the strt location, with an empty request payload, you can proceed with an effective workflow to continuously fetch forecast data:
-
Begin with last_forecast_date=null
Important: last_forecast_date is the local variable of the loop.
-
Loop forever:
- Make a RLIN request to rlin strt with no options, specifying in the HTTP header if-modified-since=last_forecast_date
- If the HTTP response status is 304 or 404, jump to step 3.
-
If the HTTP response status is 200:
- Consume the data as it is needed.
- Set last_forecast_date with the value of the last modified field from the HTTP response header.
- Sleep for X seconds.
- Return to step 2.
If the server answers with a code 200, you can assume that you are receiving data that has not been processed yet.
The amount of seconds X (step 3) is mostly up to the consumer. If you need fresh data promptly, you can poll very frequently (X=10 seconds), as the server is able to give negative answers (304 or 404) very quickly.
If you prefer polling rarely, you can use the same frequency set in the STF simulation engine (→ Rolling horizon parameters > ReComputeInt).
Important: When you use the RLIN module, you don't need a session identifier (→ Login). The session identifier is necessary for security issues, for any public Optima APIs. In this case, security is provided by the hosting infrastructure. If restrictions are needed, they can be enforced by properly configuring the Apache HTTP server, which is used as a proxy.