Skip to content

LocationInformationRequest (TRIAS 2020)

(TRIAS LocationInformationRequest)

Technical description

Location Information Request

LocationInformationRequest returns the locations matching specified criteria. Common input data are the following:

  • text input
  • constraints on returned object types
  • geographic constraints or criteria
  • other constraints

The returned result consists of a list of objects with names, geographic positions, attributes, and probabilities.

If GeoPosition, Circle, or Rectangle is provided instead of LocationName, then only objects of type=”stop” are supported.
If GeoPosition and type=”address” (in addition to LocationName) is provided, then exactly one address (street and number) is returned.

Technical aspects

TRIAS LocationInformationRequest (LIR) mimicks the LIR of the OpenJourneyPlanners (OJP). Except for the higher layers and the element names that, in the case of the OJP, usually begin with “ojp:”.

For further information, please refer to the cookbook entry about the LIR of the OpenJourneyPlanners (OJP). There you’ll find the descriptions of each element and parameter. You may find it useful to try and further explore them in the API explorer for TRIAS below.

API Explorer

IMPORTANT: first select template (Location Information Request)

Authorisation and Open Services

An API keyword is required to access this API. It can be obtained via the Developer Portal. The token must also be sent in the HTTP header as “Authorization”.

Access URL

API: https://api.opentransportdata.swiss/trias2020

Test-Key: 57c5dbbbf1fe4d000100001842c323fa9ff44fbba0b9b925f0c052d1

With the Authorization header and Content type= “text/XML” or “application/XML”

Authorization header

 

Sample requests

Search by name:

<?xml version="1.0" encoding="UTF-8"?>
<Trias version="1.1" xmlns="http://www.vdv.de/trias" xmlns:siri="http://www.siri.org.uk/siri" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vdv.de/trias ../trias-xsd-v1.1/Trias.xsd">
	<ServiceRequest>
		<siri:RequestorRef>TRIAS-Test</siri:RequestorRef>
		<siri:MessageIdentifier>9999</siri:MessageIdentifier>
		<RequestPayload>
			<LocationInformationRequest>
				<InitialInput>
					<LocationName>Chäs und Brot</LocationName>
				</InitialInput>
				<Restrictions>
					<Type>stop</Type>
				</Restrictions>
			</LocationInformationRequest>
		</RequestPayload>
	</ServiceRequest>
</Trias>

Search using geographic coordinates:

<?xml version="1.0" encoding="UTF-8"?>
<Trias version="1.1" xmlns="http://www.vdv.de/trias" xmlns:siri="http://www.siri.org.uk/siri" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vdv.de/trias ../trias-xsd-v1.1/Trias.xsd">
    <ServiceRequest>
        <siri:RequestTimestamp>2020-01-28T12:00:00Z</siri:RequestTimestamp>
        <siri:RequestorRef>TRIAS-Test</siri:RequestorRef>
        <siri:MessageIdentifier>9999</siri:MessageIdentifier>
        <RequestPayload>
            <LocationInformationRequest>
                <InitialInput>
                    <GeoPosition>
                        <Longitude>8.5545</Longitude>
                        <Latitude>47.365</Latitude>
                    </GeoPosition>
                </InitialInput>
                <Restrictions>
                    <Type>stop</Type>
                </Restrictions>
            </LocationInformationRequest>
        </RequestPayload>
    </ServiceRequest>
</Trias>

Search stop(s) within some perimeter:

<?xml version="1.0" encoding="UTF-8"?>
<Trias version="1.1" xmlns="http://www.vdv.de/trias" xmlns:siri="http://www.siri.org.uk/siri" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vdv.de/trias ../trias-xsd-v1.1/Trias.xsd">
    <ServiceRequest>
        <siri:RequestTimestamp>2020-04-24T12:00:00Z</siri:RequestTimestamp>
        <siri:RequestorRef>TRIAS-Test</siri:RequestorRef>
        <siri:MessageIdentifier>9999</siri:MessageIdentifier>
        <RequestPayload>
            <LocationInformationRequest>
                <InitialInput>
                    <GeoRestriction>
                        <Circle>
                            <Center>
                                <Longitude>8.5545</Longitude>
                                <Latitude>47.365</Latitude>
                            </Center>
                            <Radius>500</Radius>
                        </Circle>
                    </GeoRestriction>
                </InitialInput>
                <Restrictions>
                    <Type>stop</Type>
                 </Restrictions>
            </LocationInformationRequest>
        </RequestPayload>
    </ServiceRequest>
</Trias>

Response

<?xml version="1.0" encoding="UTF-8"?>
<trias:Trias xmlns:siri="http://www.siri.org.uk/siri" xmlns:trias="http://www.vdv.de/trias" xmlns:acsb="http://www.ifopt.org.uk/acsb" xmlns:ifopt="http://www.ifopt.org.uk/ifopt" xmlns:datex2="http://datex2.eu/schema/1_0/1_0" version="1.1">
    <trias:ServiceDelivery>
        <siri:ResponseTimestamp>2020-09-10T07:25:17Z</siri:ResponseTimestamp>
        <siri:ProducerRef>EFAController10.4.6.43-OJP-EFA01-P</siri:ProducerRef>
        <siri:Status>true</siri:Status>
        <trias:Language>de</trias:Language>
        <trias:CalcTime>39</trias:CalcTime>
        <trias:DeliveryPayload>
            <trias:LocationInformationResponse>
                <trias:Location>
                    <trias:Location>
                        <trias:StopPoint>
                            <trias:StopPointRef>8571439</trias:StopPointRef>
                            <trias:StopPointName>
                                <trias:Text>Oberbottigen, Chäs und Brot</trias:Text>
                                <trias:Language>de</trias:Language>
                            </trias:StopPointName>
                            <trias:LocalityRef>23006351:1</trias:LocalityRef>
                        </trias:StopPoint>
                        <trias:LocationName>
                            <trias:Text>Bern</trias:Text>
                            <trias:Language>de</trias:Language>
                        </trias:LocationName>
                        <trias:GeoPosition>
                            <trias:Longitude>7.35537</trias:Longitude>
                            <trias:Latitude>46.93565</trias:Latitude>
                        </trias:GeoPosition>
                    </trias:Location>
                    <trias:Complete>true</trias:Complete>
                    <trias:Probability>0.958999991</trias:Probability>
                </trias:Location>
            </trias:LocationInformationResponse>
        </trias:DeliveryPayload>
    </trias:ServiceDelivery>
</trias:Trias>

Further details and explanations can be found in the cookbok entry of the LIR of the OpenJourneyPlanners (OJP).