bcgov / ols-router

BC Advanced Route Planner
https://bcgov.github.io/ols-router/
Apache License 2.0
23 stars 11 forks source link

Error handling for KML format - Route not found #377

Open BK01 opened 4 months ago

BK01 commented 4 months ago

Issue description: Within the BC Route Planner test environment (v 2.2.1), the following examples generate a 500 error when a route is not found and requesting KML format (JSON and HTML are ok). This behaviour also occurs in production.

To reproduce: Append an API key to the following URL and run the tests.

Expected behavior: Response - HTTP 200 "routeFound": false, "distance": -1, "time": -1, "timeText": "-1 seconds",

Test URLs:

Test 228: https://routertst.api.gov.bc.ca/truck/directions.kml?points=5988508.0%2C687388.0%2C5988757.0%2C686616.0%2C5988607.0%2C686698.0%2C5988497.0%2C686902.0%2C5988665.0%2C687000.0%2C5988688.0%2C686724.0&outputSRS=4326&criteria=fastest&distanceUnit=km&roundTrip=false&routeDescription=/truck/directions%2520-%2520outputSRS%3D26908%2520%28json%29&enable=gdf%2Cldf%2Ctr%2Cxc%2Ctc&disable=td%2Cev%2Csc%2Ctf%2Ctl&gdf=&xc=3.0%2C10.0%2C7.0%2C1.2&tc=3.0%2C1.0%2C10.0%2C5.0&partition=istruckroute%2Cisferry%2Clocality%2Cownership&departure=&correctSide=false&followTruckRoute=true&truckRouteMultiplier=9&height=4.5&width=3&length=8.2&weight=35000&simplifyDirections=false&simplifyThreshold=250&snapDistance=1000&listRestrictions=FALSE&restrictionSource=ITN&excludeRestrictions=&restrictionValues=VERTICAL:4.5,HORIZONTAL:3,LENGTH:8.2,WEIGHT-GVW:35000

Test 229: https://routertst.api.gov.bc.ca/truck/directions.kml?points=5618755.0%2C606583.0%2C5620518.0%2C605925.0%2C5620255.0%2C605316.0%2C5619831.0%2C606072.0%2C5620284.0%2C606074.0&outputSRS=4326&criteria=fastest&distanceUnit=km&roundTrip=false&routeDescription=/truck/directions%2520-%2520outputSRS%3D26909%2520%28json%29&enable=gdf%2Cldf%2Ctr%2Cxc%2Ctc&disable=td%2Cev%2Csc%2Ctf%2Ctl&gdf=&xc=3.0%2C10.0%2C7.0%2C1.2&tc=3.0%2C1.0%2C10.0%2C5.0&partition=istruckroute%2Cisferry%2Clocality%2Cownership&departure=&correctSide=false&followTruckRoute=true&truckRouteMultiplier=9&height=4.5&width=3&length=8.2&weight=35000&simplifyDirections=false&simplifyThreshold=250&snapDistance=1000&listRestrictions=FALSE&restrictionSource=ITN&excludeRestrictions=&restrictionValues=VERTICAL:4.5,HORIZONTAL:3,LENGTH:8.2,WEIGHT-GVW:35000

Test 230: https://routertst.api.gov.bc.ca/truck/directions.kml?points=5617157.0%2C688334.0%2C5616952.0%2C688335.0%2C5617061.0%2C688507.0%2C5617257.0%2C688667.0%2C5617069.0%2C688675.0%2C5616960.0%2C688510.0&outputSRS=4326&criteria=fastest&distanceUnit=km&roundTrip=false&routeDescription=/truck/directions%2520-%2520outputSRS%3D26910%2520%28json%29&enable=gdf%2Cldf%2Ctr%2Cxc%2Ctc&disable=td%2Cev%2Csc%2Ctf%2Ctl&gdf=&xc=3.0%2C10.0%2C7.0%2C1.2&tc=3.0%2C1.0%2C10.0%2C5.0&partition=istruckroute%2Cisferry%2Clocality%2Cownership&departure=&correctSide=false&followTruckRoute=true&truckRouteMultiplier=9&height=4.5&width=3&length=8.2&weight=35000&simplifyDirections=false&simplifyThreshold=250&snapDistance=1000&listRestrictions=FALSE&restrictionSource=ITN&excludeRestrictions=&restrictionValues=VERTICAL:4.5,HORIZONTAL:3,LENGTH:8.2,WEIGHT-GVW:35000

Test 231: https://routertst.api.gov.bc.ca/truck/directions.kml?points=5485135.0%2C589921.0%2C5485118.0%2C589601.0%2C5483756.0%2C588123.0%2C5484871.0%2C590362.0%2C5485591.0%2C590217.0&outputSRS=4326&criteria=fastest&distanceUnit=km&roundTrip=false&routeDescription=/truck/directions%2520-%2520outputSRS%3D26911%2520%28json%29&enable=gdf%2Cldf%2Ctr%2Cxc%2Ctc&disable=td%2Cev%2Csc%2Ctf%2Ctl&gdf=&xc=3.0%2C10.0%2C7.0%2C1.2&tc=3.0%2C1.0%2C10.0%2C5.0&partition=istruckroute%2Cisferry%2Clocality%2Cownership&departure=&correctSide=false&followTruckRoute=true&truckRouteMultiplier=9&height=4.5&width=3&length=8.2&weight=35000&simplifyDirections=false&simplifyThreshold=250&snapDistance=1000&listRestrictions=FALSE&restrictionSource=ITN&excludeRestrictions=&restrictionValues=VERTICAL:4.5,HORIZONTAL:3,LENGTH:8.2,WEIGHT-GVW:35000

Test 232: https://routertst.api.gov.bc.ca/truck/directions.kml?points=382794.0062641986%2C1195314.1426902039%2C382221.9536746476%2C1195150.6994617758%2C382820.4150264029%2C1195110.7054440875&outputSRS=4326&criteria=fastest&distanceUnit=km&roundTrip=false&routeDescription=/truck/directions%2520-%2520outputSRS%3D3005%2520%28json%29&enable=gdf%2Cldf%2Ctr%2Cxc%2Ctc&disable=td%2Cev%2Csc%2Ctf%2Ctl&gdf=&xc=3.0%2C10.0%2C7.0%2C1.2&tc=3.0%2C1.0%2C10.0%2C5.0&partition=istruckroute%2Cisferry%2Clocality%2Cownership&departure=&correctSide=false&followTruckRoute=true&truckRouteMultiplier=9&height=4.5&width=3&length=8.2&weight=35000&simplifyDirections=false&simplifyThreshold=250&snapDistance=1000&listRestrictions=FALSE&restrictionSource=ITN&excludeRestrictions=&restrictionValues=VERTICAL:4.5,HORIZONTAL:3,LENGTH:8.2,WEIGHT-GVW:35000

Test 246: https://routertst.api.gov.bc.ca/truck/directions.kml?points=-123.44829%2C48.76864%2C-123.45074%2C48.76935&outputSRS=4326&criteria=fastest&distanceUnit=km&roundTrip=false&routeDescription=/truck/directions%2520-%2520restrictionValues%3DNCV%3A1%2520%28json%29&enable=gdf%2Cldf%2Ctr%2Cxc%2Ctc&disable=td%2Cev%2Csc%2Ctf%2Ctl&gdf=&xc=3.0%2C10.0%2C7.0%2C1.2&tc=3.0%2C1.0%2C10.0%2C5.0&partition=istruckroute%2Cisferry%2Clocality%2Cownership&departure=&correctSide=false&followTruckRoute=true&truckRouteMultiplier=9&height=4.5&width=3&length=8.2&weight=35000&simplifyDirections=false&simplifyThreshold=250&snapDistance=1000&listRestrictions=FALSE&restrictionSource=RDM&excludeRestrictions=&restrictionValues=NCV:1