Post an analysis on a contraction hierarchies network

post

/chrest/v1/analysis

By passing in the Network Analysis Request in json/xml, you can run analysis on the contraction hierarchies network.

Request

Supported Media Types
Body ()
Specify operations on contraction hierarchies networks.
Root Schema : NetworkAnalysisRequest
Type: object
Show Source
Nested Schema : AlternativePathsRequest
Type: object
Show Source
Nested Schema : CostMatrixRequest
Type: object
Show Source
Nested Schema : MultiStopShortestPathRequest
Type: object
Show Source
Nested Schema : SecondaryCostRequest
Type: object
Show Source
Nested Schema : ShortestPathRequest
Type: object
Show Source
Nested Schema : TspRequest
Type: object
Show Source
Nested Schema : PointOnNets
Type: object
Show Source
Nested Schema : pointOnNet
Type: array
array of PointOnNet
Show Source
Nested Schema : PointOnNet
Type: object
Show Source
Nested Schema : endPoints
Type: array
Show Source
Nested Schema : startPoints
Type: array
Show Source
Nested Schema : waypoints
Type: array
array of multiple stops in point on net
Show Source
Nested Schema : linkIds
Type: array
array of logical sub path link id in order
Show Source
Nested Schema : nodeIds
Type: array
array of logical sub path node id in order
Show Source
Nested Schema : tspPoints
Type: array
array of point on net
Show Source
Back to Top

Response

Supported Media Types

200 Response

Analysis result in JSON/XML.
Body ()
Root Schema : NetworkAnalysisResponse
Type: object
Show Source
Nested Schema : AlternativePathsResponse
Type: object
Show Source
Nested Schema : CostMatrixResponse
Type: object
Show Source
Nested Schema : MultiStopShortestPathResponse
Type: object
Show Source
Nested Schema : SecondaryCostResponse
Type: object
Show Source
Nested Schema : ShortestPathResponse
Type: object
Show Source
  • Example: {"type":"LineString","coordinates":[[-122.44874,37.77361],[-122.44936,37.77352],[-122.44917,37.77258],[-122.4507,37.77237],[-122.45079,37.77236],[-122.45089,37.77234],[-122.45104,37.77232],[-122.45161,37.77225],[-122.45234,37.77216],[-122.45241,37.77215],[-122.45276,37.77206],[-122.45301,37.77195],[-122.45346,37.77172],[-122.45387,37.77153],[-122.45398,37.77148],[-122.45429,37.77136],[-122.4546,37.77123],[-122.45483,37.77114],[-122.4551,37.77103],[-122.4552,37.77097],[-122.45533,37.77086],[-122.45539,37.77077],[-122.45542,37.77071],[-122.45544,37.77065],[-122.45546,37.77053],[-122.45546,37.77042],[-122.4554,37.77033],[-122.45537,37.77023],[-122.45529,37.77005],[-122.45497,37.76945],[-122.45488,37.76921],[-122.45487,37.76914],[-122.45485,37.76902],[-122.45486,37.76878],[-122.45489,37.76863],[-122.45496,37.76847],[-122.45507,37.76835],[-122.45528,37.76822],[-122.45568,37.7681],[-122.45583,37.76805],[-122.45615,37.76796],[-122.45638,37.76789],[-122.45656,37.76784],[-122.45663,37.76782],[-122.45672,37.76779],[-122.45729,37.76762],[-122.45747,37.76756],[-122.45758,37.76753],[-122.45792,37.76742],[-122.45826,37.76732],[-122.45856,37.76723],[-122.45868,37.76719],[-122.45875,37.76716],[-122.45895,37.76708],[-122.45924,37.76689],[-122.45937,37.76679],[-122.45955,37.76665],[-122.45988,37.7664],[-122.46003,37.76629],[-122.46017,37.76624],[-122.46033,37.7662],[-122.46057,37.76618],[-122.46108,37.76616],[-122.46213,37.76611],[-122.46216,37.76611],[-122.46323,37.76607],[-122.4643,37.76604],[-122.46535,37.76598],[-122.46644,37.76593],[-122.4675,37.76588],[-122.46858,37.76583],[-122.4687,37.76582],[-122.46967,37.76578],[-122.47072,37.76574],[-122.4706,37.76385],[-122.4705,37.76228],[-122.47048,37.76204],[-122.47047,37.76194],[-122.47034,37.76011],[-122.47032,37.75989],[-122.47028,37.75925],[-122.47022,37.75836],[-122.47021,37.75825],[-122.47014,37.75754],[-122.47062,37.75751],[-122.47078,37.75752],[-122.47094,37.75756],[-122.47108,37.75764],[-122.47131,37.75783],[-122.47158,37.75811],[-122.47167,37.75787],[-122.47178,37.75772],[-122.47204,37.75755],[-122.47204,37.75741],[-122.47189,37.7573],[-122.4714,37.75709],[-122.47126,37.75701],[-122.47115,37.75689],[-122.47106,37.75678],[-122.47102,37.75668],[-122.47101,37.75647]]}
  • linkIds
    array of logical sub path link id in order
  • nodeIds
    array of logical sub path node id in order
Nested Schema : TspResponse
Type: object
Show Source
Nested Schema : shortestPath
Type: array
Show Source
Nested Schema : costMatrix
Type: array
Show Source
Example:
[
    [
        0,
        1835.3,
        739.5,
        985.4
    ],
    [
        2516.9,
        0,
        3021.5,
        2908.5
    ],
    [
        532.1,
        2111.8,
        0,
        1214.1
    ],
    [
        7234,
        8631.4,
        7276.2,
        0
    ]
]
Nested Schema : items
Type: array
Show Source
Nested Schema : shortestPath
Type: array
Show Source
Nested Schema : secondaryCost
Type: array
array of costType
Show Source
Nested Schema : CostType
Type: object
Show Source
Nested Schema : linkIds
Type: array
array of logical sub path link id in order
Show Source
Nested Schema : nodeIds
Type: array
array of logical sub path node id in order
Show Source
Nested Schema : order
Type: array
visiting order of input tspPoint
Show Source
Example:
[
    0,
    1,
    2,
    0
]
Nested Schema : shortestPath
Type: array
Show Source
Back to Top

Examples

The following example shows how to perform network analysis on a contraction hierarchies network by submitting a POST request on the REST resource using cURL. Depending on the operationspecified in the request body, the analysis job can be shortest path, multi stop shortest path, cost matrix, TSP, alternative paths or secondary cost.

curl -v -X POST "https://localhost:8011/chrest/v1/analysis" -H "Content-Type: application/json" -d @request_body.json 

Example of Request Body

The following example shows how to perform a shortest path analysis in the request body.

{"chName":"sample","shortestPathRequest":{"startPoints" : { "pointOnNet" : [ { "linkId" : 238135, "percentage" : 0.28 } ] }, "endPoints" : { "pointOnNet" : [ { "linkId" : 261315, "percentage" : 0.93 }] }, "geometry":false}} 

The following example shows how to perform a multi stop shortest path analysis in the request body.

{"chName":"sample","multiStopShortestPathRequest":{"waypoints" : [ {"pointOnNet" : [ {"linkId":266427,"percentage":0.5}]}, {"pointOnNet" : [ {"linkId":238135,"percentage":0.7}]}, {"pointOnNet" : [ {"linkId":106841,"percentage":0.1}]} ], "geometry":false}} 

The following example shows how to perform a cost matrix analysis in the request body.

{"chName":"sample","costMatrixRequest":{"startPoints" : [ {"pointOnNet" : [ {"linkId":266427,"percentage":0.3}]}, {"pointOnNet" : [ {"linkId":238135,"percentage":0.2}]}, {"pointOnNet" : [ {"linkId":106841,"percentage":0.7}]}, {"pointOnNet" : [ {"linkId":261315,"percentage":0.5}]}],"endPoints" : [ {"pointOnNet" : [ {"linkId":266427,"percentage":0.3}]}, {"pointOnNet" : [ {"linkId":238135,"percentage":0.2}]}, {"pointOnNet" : [ {"linkId":106841,"percentage":0.7}]}, {"pointOnNet" : [ {"linkId":261315,"percentage":0.5}]}]}} 

The following example shows how to perform a TSP analysis in the request body.

{"chName":"sample","tspRequest":{"geometry":false,"tourFlag":"CLOSED","tspPoints" : [ {"pointOnNet" : [ {"linkId":266427,"percentage":0.5} ]}, {"pointOnNet" : [ {"linkId":238135,"percentage":0.7} ]}, {"pointOnNet" : [ {"linkId":106841,"percentage":0.1} ]} ]}}		

The following example shows how to perform an alternative paths analysis in the request body.

{"chName":"sample","alternativePathsRequest":{"startPoints" : { "pointOnNet" : [ { "linkId":238135, "percentage":0.28 }] }, "endPoints" : { "pointOnNet" : [ { "linkId":261315, "percentage":0.93 }] }, "k":4,"maxCost":10000,"maxSimilarity":0.5,"geometry":false}} 

The following example shows how to perform a secondary cost query in the request body.

{"chName":"sample","secondaryCostRequest" : {"startIndex" : 0,"startPercentage" : 0.28,"endIndex" : 43,"endPercentage" : 0.93,"cost" : 2906.6,"nodeIds" : [ 42427254, 42427256, 42440356, 3350498747, 42452620, 42457292, 42444271, 42440270, 42440271, 673008453, 42440278, 42440280, 42440282, 42440284, 42440287, 42428385, 42440290, 42453943,42453952, 42430004, 42429562, 42449597, 42431611, 42445356, 42445357, 42436322, 42430571, 42430529, 42429833, 42436326, 42436327, 42436330, 42436333, 42436335, 42436336, 42424610, 1104165608, 42436308,42424408, 42436340, 42436014, 4142105822, 42424619, 42424630, 42423514 ],"linkIds" : [ 238135, 69834, 69856, 187992, 39327, 39328, 18867, 189084, 189085, 189086, 189087, 142716, 142717, 142718, 142719, 142720, 193362, 193363, 54588, 54589, 54657, 153376, 68912, 61331,61332, 177603, 177604, 177605, 177606, 177607, 106801, 96723, 96724, 96725, 96726, 65028, 176816, 176817, 65012, 65013, 65014, 65015, 261314, 261315 ]}}

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 200 OK Date: Tue, 14 Jan 2020 18:33:10 GMT Content-Type: application/json; charset=UTF-8

Example of Response Body

The following example shows the contents of the response body in JSON format of shoetest path request.

{"shortestPathResponse" : {"cost" : 2906.6,"linkIds" : [ 238135, 69834, 69856, 187992, 39327, 39328, 18867, 189084, 189085, 189086, 189087, 142716, 142717, 142718, 142719, 142720, 193362, 193363, 54588, 54589, 54657, 153376, 68912, 61331,61332, 177603, 177604, 177605, 177606, 177607, 106801, 96723, 96724, 96725, 96726, 65028, 176816, 176817, 65012, 65013, 65014, 65015, 261314, 261315 ],"nodeIds" : [ 42427254, 42427256, 42440356, 3350498747, 42452620, 42457292, 42444271, 42440270, 42440271, 673008453, 42440278, 42440280, 42440282, 42440284, 42440287, 42428385, 42440290, 42453943,42453952, 42430004, 42429562, 42449597, 42431611, 42445356, 42445357, 42436322, 42430571, 42430529, 42429833, 42436326, 42436327, 42436330, 42436333, 42436335, 42436336, 42424610, 1104165608, 42436308,42424408, 42436340, 42436014, 4142105822, 42424619, 42424630, 42423514 ],"startIndex" : 0,"startPercentage" : 0.28,"endIndex" : 43,"endPercentage" : 0.93},"unit" : "meter"} 

The following example shows the contents of the response body in JSON format of multi stop shortest path request.

{"multiStopShortestPathResponse" : {"shortestPath" : [ {"cost" : 1866.8,"linkIds" : [ 266427, 65042, 65043, 65044, 65045, 65046, 65047, 120252, 120253, 171960, 249986, 84903, 245429, 245428, 145039, 145040, 136666, 273041, 136680, 136681, 136682, 183653, 183654, 140917,140918, 239060, 239061, 239122, 238135 ],"nodeIds" : [ 42427316, 42440815, 42445484, 42445481, 42445479, 42445474, 42445469, 42445466, 42430535, 42427278, 272195272, 370705004, 2821304146, 4207802394, 2821304145, 1272562931, 42427236,42427239, 42427242, 42457311, 42430848, 42440280, 42456583, 42440345, 42433330, 42440347, 42440350, 42440353, 42427254, 42427256 ],"startIndex" : 0,"startPercentage" : 0.5,"endIndex" : 28,"endPercentage" : 0.7}, {"cost" : 2927.6,"linkIds" : [ 238135, 69834, 69856, 187992, 39327, 39328, 18867, 189084, 189085, 189086, 189087, 142716, 142717, 142718, 142719, 142720, 193362, 193363, 54588, 54589, 54657, 153376, 68912, 68913,68914, 68915, 68916, 68917, 267738, 267739, 267740, 21173, 64994, 64995, 106837, 106838, 106839, 106840, 106841 ],"nodeIds" : [ 42427254, 42427256, 42440356, 3350498747, 42452620, 42457292, 42444271, 42440270, 42440271, 673008453, 42440278, 42440280, 42440282, 42440284, 42440287, 42428385, 42440290, 42453943,42453952, 42430004, 42429562, 42449597, 42431611, 42445356, 42430550, 42429830, 42452817, 42448171, 4143851142, 42430115, 42430118, 42430122, 42430126, 42440829, 42452026, 42433574, 42452040, 42449570,42428436, 42452048 ],"startIndex" : 0,"startPercentage" : 0.7,"endIndex" : 38,"endPercentage" : 0.1} ]},"unit" : "meter"}			

The following example shows the contents of the response body in JSON format of cost matrix request.

{"costMatrixResponse" : {"costMatrix" : [ [ 0.0, 1835.3, 739.5, 985.4 ], [ 2516.9, 0.0, 3021.5, 2908.5 ], [ 532.1, 2111.8, 0.0, 1214.1 ], [ 7234.0, 8631.4, 7276.2, 0.0 ] ]},"unit" : "meter"}				

The following example shows the contents of the response body in JSON format of cost TSP request.

{"tspResponse" : {"order" : [ 0, 2, 1, 0 ],"shortestPath" : [ {"cost" : 677.1,"linkIds" : [ 266427, 266428, 243579, 243580, 243581, 189839, 106839, 106840, 106841 ],"nodeIds" : [ 42427316, 42440815, 591995273, 42428433, 42440820, 42440823, 42452040, 42449570, 42428436, 42452048 ],"startIndex" : 0,"startPercentage" : 0.5,"endIndex" : 8,"endPercentage" : 0.1}, {"cost" : 2205.7,"linkIds" : [ 106841, 106842, 65040, 65041, 65042, 65043, 65044, 65045, 65046, 65047, 120252, 120253, 171960, 249986, 84903, 245429, 245428, 145039, 145040, 136666, 273041, 136680, 136681, 136682,183653, 183654, 140917, 140918, 239060, 239061, 239122, 238135 ],"nodeIds" : [ 42428436, 42452048, 42445489, 42439580, 42440815, 42445484, 42445481, 42445479, 42445474, 42445469, 42445466, 42430535, 42427278, 272195272, 370705004, 2821304146, 4207802394, 2821304145,1272562931, 42427236, 42427239, 42427242, 42457311, 42430848, 42440280, 42456583, 42440345, 42433330, 42440347, 42440350, 42440353, 42427254, 42427256 ],"startIndex" : 0,"startPercentage" : 0.1,"endIndex" : 31,"endPercentage" : 0.7}, {"cost" : 2485.5,"linkIds" : [ 238135, 69834, 69856, 69857, 69858, 69859, 162438, 162439, 162440, 162441, 162442, 189127, 187872, 151596, 191849, 191850, 191851, 191852, 191853, 212498, 192902, 192903, 192904, 269840,4401, 4403, 4404, 4402, 174674, 266425, 266426, 266427 ],"nodeIds" : [ 42427254, 42427256, 42440356, 3350498747, 42433218, 42433243, 42438476, 278609760, 42444108, 1538237325, 42437135, 588455857, 588455858, 42452556, 42437465, 42448430, 42437755, 42435916,42433539, 42453691, 1773066054, 42437564, 541467364, 4202950100, 2481865390, 4202984490, 42440804, 4202984491, 42432246, 42435451, 42440810, 42427316, 42440815 ],"startIndex" : 0,"startPercentage" : 0.7,"endIndex" : 31,"endPercentage" : 0.5} ]},"unit" : "meter"}			

The following example shows the contents of the response body in JSON format of cost alternative paths request.

{"alternativePathsResponse" : {"shortestPath" : [ {"cost" : 2906.6,"linkIds" : [ 238135, 69834, 69856, 187992, 39327, 39328, 18867, 189084, 189085, 189086, 189087, 142716, 142717, 142718, 142719, 142720, 193362, 193363, 54588, 54589, 54657, 153376, 68912, 61331,61332, 177603, 177604, 177605, 177606, 177607, 106801, 96723, 96724, 96725, 96726, 65028, 176816, 176817, 65012, 65013, 65014, 65015, 261314, 261315 ],"nodeIds" : [ 42427254, 42427256, 42440356, 3350498747, 42452620, 42457292, 42444271, 42440270, 42440271, 673008453, 42440278, 42440280, 42440282, 42440284, 42440287, 42428385, 42440290, 42453943,42453952, 42430004, 42429562, 42449597, 42431611, 42445356, 42445357, 42436322, 42430571, 42430529, 42429833, 42436326, 42436327, 42436330, 42436333, 42436335, 42436336, 42424610, 1104165608, 42436308,42424408, 42436340, 42436014, 4142105822, 42424619, 42424630, 42423514 ],"startIndex" : 0,"startPercentage" : 0.28,"endIndex" : 43,"endPercentage" : 0.93}, {"cost" : 3500.4,"linkIds" : [ 238135, 69834, 69856, 69857, 69858, 69859, 162438, 162439, 162440, 162441, 162442, 189127, 187872, 151596, 191849, 191850, 191851, 191852, 191853, 212498, 192902, 192903, 192904, 269840,4401, 4403, 4404, 4402, 174674, 266425, 266426, 266427, 266428, 243579, 243580, 243581, 243582, 243583, 243584, 243585, 238101, 267063, 267064, 267065, 44933, 222847, 262049, 60078, 261315 ],"nodeIds" : [ 42427254, 42427256, 42440356, 3350498747, 42433218, 42433243, 42438476, 278609760, 42444108, 1538237325, 42437135, 588455857, 588455858, 42452556, 42437465, 42448430, 42437755, 42435916,42433539, 42453691, 1773066054, 42437564, 541467364, 4202950100, 2481865390, 4202984490, 42440804, 4202984491, 42432246, 42435451, 42440810, 42427316, 42440815, 591995273, 42428433, 42440820, 42440823,42440825, 42433573, 42440829, 4143859873, 3788379733, 42439550, 42440838, 4142105813, 4215665530, 42426089, 42426060, 42424630, 42423514 ],"startIndex" : 0,"startPercentage" : 0.28,"endIndex" : 48,"endPercentage" : 0.93}, {"cost" : 4216.8,"linkIds" : [ 238135, 69834, 69856, 69857, 69858, 69859, 162438, 162439, 190987, 65527, 158770, 268162, 268163, 268164, 120254, 18865, 18866, 18867, 189084, 189085, 189086, 189087, 142716, 142717,142718, 142719, 142720, 193362, 193363, 54743, 54744, 54745, 54746, 166527, 164507, 71481, 44960, 54569, 71466, 71479, 56333, 56334, 56335, 61737, 61738, 61739, 65013, 73453, 164349, 44933, 222847,262049, 60078, 261315 ],"nodeIds" : [ 42427254, 42427256, 42440356, 3350498747, 42433218, 42433243, 42438476, 278609760, 42444108, 205025778, 587988061, 3884569931, 3884569924, 278609934, 42422283, 42433229, 3815141536,42444271, 42440270, 42440271, 673008453, 42440278, 42440280, 42440282, 42440284, 42440287, 42428385, 42440290, 42453943, 42453952, 42454401, 272194254, 42459493, 42453398, 4207143415, 42429570,4215665527, 42449613, 42431626, 42453417, 4207143418, 42436316, 42440918, 4207143421, 42438060, 42436069, 42436340, 42436014, 4629486879, 4142105813, 4215665530, 42426089, 42426060, 42424630, 42423514 ],"startIndex" : 0,"startPercentage" : 0.28,"endIndex" : 53,"endPercentage" : 0.93}, {"cost" : 5675.7,"linkIds" : [ 238135, 69834, 69856, 69857, 69858, 69859, 162438, 162439, 162440, 162441, 162442, 162443, 162444, 162445, 239706, 239707, 239708, 239709, 140872, 140873, 140874, 140875, 214174, 108407,205268, 205269, 205259, 205260, 236593, 236594, 137109, 137110, 224638, 224639, 224640, 224641, 224642, 224643, 224644, 191256, 191239, 129946, 129947, 129948, 172145, 20690, 172143, 172119, 172144,274972, 274973, 274974, 274975, 274976, 65038, 226384, 226385, 226386, 226387, 226388, 226389, 163530, 163531, 44841, 44957, 44958, 44959, 44956, 267065, 44933, 222847, 262049, 60078, 261315 ],"nodeIds" : [ 42427254, 42427256, 42440356, 3350498747, 42433218, 42433243, 42438476, 278609760, 42444108, 1538237325, 42437135, 588455857, 42444116, 42444123, 42444129, 42443928, 42443937, 4581870335,42440449, 479847982, 42437503, 42437770, 42435928, 42433551, 42440408, 42432094, 3630249566, 42435534, 42427340, 42427345, 42427346, 42437067, 42437071, 42437074, 42437078, 42437082, 42437084, 42437096,42437106, 42437108, 42437109, 486868873, 42429645, 42429756, 4202930753, 4539951609, 486869282, 4202930754, 1773076511, 42429752, 42430030, 42430034, 42430038, 42430041, 42430044, 42432165, 42432161,42428438, 42432156, 42432152, 42432148, 42432142, 42436770, 42430143, 42423456, 4602414021, 42452015, 4215665529, 42440838, 4142105813, 4215665530, 42426089, 42426060, 42424630, 42423514 ],"startIndex" : 0,"startPercentage" : 0.28,"endIndex" : 73,"endPercentage" : 0.93} ]},"unit" : "meter"}

The following example shows the contents of the response body in JSON format of secondary cost request.

{"secondaryCostResponse" : {"secondaryCost" : [ {"cost" : 108.2,"unit" : "second"} ]}}
Back to Top