xLocate.findCombinedTransportByLocation search parameters
xLocate.findCombinedTransportByLocation search parameters
Dear Bernd,
We've started implementing the xLocate.findCombinedTransportByLocation endpoint for searching for train stations (piggyback)
This endpoint has a "options SearchOptionBase[] Additional search options." parameter.
However I couldn't find anywhere in the documentation nor the forum the concrete search options for this one.
Could you help me where to find it / or send me some examples?
com.ptvag.xserver.xlocate.XLocate.findCombinedTransportByLocation
Thank you in advance!
Peter
We've started implementing the xLocate.findCombinedTransportByLocation endpoint for searching for train stations (piggyback)
This endpoint has a "options SearchOptionBase[] Additional search options." parameter.
However I couldn't find anywhere in the documentation nor the forum the concrete search options for this one.
Could you help me where to find it / or send me some examples?
com.ptvag.xserver.xlocate.XLocate.findCombinedTransportByLocation
Thank you in advance!
Peter
- Bernd Welter
- Site Admin
- Posts: 2695
- Joined: Mon Apr 14, 2014 10:28 am
- Contact:
Re: xLocate.findCombinedTransportByLocation search parameter
Hello Peter,
the class "SearchOption" is a base class from which several other classes derive their specific properties. This is visible in this diagram.
You can find som additional info in the additional usecases documentation
That paragraph mentions some meaningful ReverseSearchOptions (Parameters):
Bernd
the class "SearchOption" is a base class from which several other classes derive their specific properties. This is visible in this diagram.
You can find som additional info in the additional usecases documentation
That paragraph mentions some meaningful ReverseSearchOptions (Parameters):
- ENGINE_TOLERANCE
- ENGINE_TARGETSIZE
- ENGINE_SEARCHRANGE
- LANGUAGE_CODE
Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany
Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning...
Technical Partner Manager Developer Components
PTV Logistics - Germany
Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning...
Re: xLocate.findCombinedTransportByLocation search parameter
Dear Bernd,
I'm not quite sure how to pass the search params.
We've tried different ways to pass the search options you've mentioned, but it just won't work.
We're using the API with curl, addig the params json_encoded.
The original, working code was:
We've tried sg like this:
or this:
How should we set the options param in JSON/CURL?
Thank you,
Peter
I'm not quite sure how to pass the search params.
We've tried different ways to pass the search options you've mentioned, but it just won't work.
We're using the API with curl, addig the params json_encoded.
The original, working code was:
Code: Select all
$params = [
'location' => [
'coordinate' => [
'point' => [
'x' => $xCoord,
'y' => $yCoord,
],
],
],
'callerContext' => [
'properties' => [
[
'key' => 'CoordFormat',
'value' => 'OG_GEODECIMAL',
],
],
],
];
Code: Select all
$params = [
'location' => [
'coordinate' => [
'point' => [
'x' => $xCoord,
'y' => $yCoord,
],
],
],
'options' => [
'$type': "SearchOption",
'value': "-1",
'param': 'ENGINE_SEARCHRANGE',
],
'callerContext' => [
'properties' => [
[
'key' => 'CoordFormat',
'value' => 'OG_GEODECIMAL',
],
],
],
];
Code: Select all
$params = [
'location' => [
'coordinate' => [
'point' => [
'x' => $xCoord,
'y' => $yCoord,
],
],
],
'options' => [
'ENGINE_TOLERANCE' => '160',
'ENGINE_TARGETSIZE' => '20',
'ENGINE_FILTERMODE' => '-1',
'ENGINE_SEARCHRANGE' => '-1',
],
'callerContext' => [
'properties' => [
[
'key' => 'CoordFormat',
'value' => 'OG_GEODECIMAL',
],
],
],
];
Thank you,
Peter
- Bernd Welter
- Site Admin
- Posts: 2695
- Joined: Mon Apr 14, 2014 10:28 am
- Contact:
Re: xLocate.findCombinedTransportByLocation search parameter
Hello Peter,
here comes a sample - I gues you have to qualify the class name with the proper type... the ReverseSearchOption
Bernd
here comes a sample - I gues you have to qualify the class name with the proper type... the ReverseSearchOption
Code: Select all
{
"location": {
"coordinate": {
"point": {
"x": 10.13224,
"y": 54.32325
}
}
},
"options": [
{
"$type":"ReverseSearchOption",
"param":"ENGINE_SEARCHRANGE",
"value":"700"
}
],
"callerContext": {
"properties": [
{
"key": "CoordFormat",
"value": "OG_GEODECIMAL"
}
]
}
}
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany
Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning...
Technical Partner Manager Developer Components
PTV Logistics - Germany
Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning...
Re: xLocate.findCombinedTransportByLocation search parameter
Hello Bernd,
Thank you! It's working this way:
One last question, which we couldn't figure out:
- all of the results are ferrys (type -> 1)
- which options do we need to set to also get back piggyback train connections?
Thank you,
Peter
Thank you! It's working this way:
Code: Select all
'options' => [
[
'$type' => 'ReverseSearchOption',
'value' => '-1',
'param' => 'ENGINE_SEARCHRANGE',
],
[
'$type' => 'ReverseSearchOption',
'value' => '-1',
'param' => 'ENGINE_FILTERMODE',
],
[
'$type' => 'ReverseSearchOption',
'value' => '1600',
'param' => 'ENGINE_TOLERANCE',
],
[
'$type' => 'ReverseSearchOption',
'value' => '200',
'param' => 'ENGINE_TARGETSIZE',
]
],
- all of the results are ferrys (type -> 1)
- which options do we need to set to also get back piggyback train connections?
Thank you,
Peter
- Bernd Welter
- Site Admin
- Posts: 2695
- Joined: Mon Apr 14, 2014 10:28 am
- Contact:
Re: xLocate.findCombinedTransportByLocation search parameter
Hi Peter,
here's a sample that returns a train connection: the Sylt Shuttle from Niebüll
So you should be able to locate the train connections without further parameters. The challenge is more to identify whether this is a train or a ferry
Bernd
here's a sample that returns a train connection: the Sylt Shuttle from Niebüll
Code: Select all
{
"location": {
"coordinate": {
"point": {
"x": 8.82716,
"y": 54.78669
}
}
},
"options": [
{
"$type":"ReverseSearchOption",
"param":"ENGINE_SEARCHRANGE",
"value":"7000"
}
],
"callerContext": {
"properties": [
{
"key": "CoordFormat",
"value": "OG_GEODECIMAL"
}
]
}
}
Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany
Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning...
Technical Partner Manager Developer Components
PTV Logistics - Germany
Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning...
- Bernd Welter
- Site Admin
- Posts: 2695
- Joined: Mon Apr 14, 2014 10:28 am
- Contact:
Re: xLocate.findCombinedTransportByLocation search parameter
and here comes the Channel tunnel:
Code: Select all
{
"location": {
"coordinate": {
"point": {
"x": 1.17795,
"y": 51.08447
}
}
},
"options": [
{
"$type":"ReverseSearchOption",
"param":"ENGINE_SEARCHRANGE",
"value":"7000"
}
],
"callerContext": {
"properties": [
{
"key": "CoordFormat",
"value": "OG_GEODECIMAL"
}
]
}
}
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany
Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning...
Technical Partner Manager Developer Components
PTV Logistics - Germany
Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning...
Re: xLocate.findCombinedTransportByLocation search parameter
You can check the type attribute to see if something is a ferry or a piggyback (== api term for rail shuttle).The challenge is more to identify whether this is a train or a ferry
See https://xserver.ptvgroup.com/fileadmin/ ... dTransport
If i run Bernd Niebüll sample: the resulting type is 2, which according to the documentation means it is a piggyback.
Code: Select all
{
"errorCode": 0,
"errorDescription": "",
"resultList": [
{
"id": "VjEoNDk7MTEyNjQ1NTEzNjsxNzI7MjEwOzApKDQ5OzExMjMzMDk0Mjg7MTI3OzE5MDswKU5pZWLDvGxsIC0gV2VzdGVybGFuZA==",
"name": "Niebüll - Westerland",
"duration": 3401,
"distance": 1089.407079898105,
"type": 2,
"start": {
"coordinate": {
"$type": "Point",
"point": {
"$type": "PlainPoint",
"x": 8.8404412179,
"y": 54.780580254
}
},
"country": "D",
"name": "Niebüll"
},
"destination": {
"coordinate": {
"$type": "Point",
"point": {
"$type": "PlainPoint",
"x": 8.3111510833,
"y": 54.906602861
}
},
"country": "D",
"name": "Westerland"
},
"combinedTransportFields": []
}
]
}
Joost Claessen
Senior Technical Consultant
PTV Benelux
Senior Technical Consultant
PTV Benelux
Re: xLocate.findCombinedTransportByLocation search parameter
Hi Bernd, Hi Joost,
Thank you! It's ok now. Your examples are valid.
We just need to channel these ids to the routing engine.
Thank you for the help!
Peter
Thank you! It's ok now. Your examples are valid.
We just need to channel these ids to the routing engine.
Thank you for the help!
Peter