gis-ops / valhalla-qgis-plugin

QGIS plugin to use Valhalla for routing, isochrones and matrices.
GNU General Public License v3.0
12 stars 3 forks source link

Server reply: Unprocessable Entity #6

Open magerlin opened 2 years ago

magerlin commented 2 years ago

I have a Geopackage with 177 multipoint features each describing a set of points for which I want a route (see attached zip file)

I can get routes for bicycle but for Auto I can only get routes for 143 of the 177 set of points.

For the rest I get errors like:

Feature ID 154 caused a ApiError: 422 (Error transferring https://api.mapbox.com/valhalla/v1/route?access_token=pk.eyJ1IjoibWFnZXJsaW4iLCJhIjoiY2t1ODA4cXk2NXBheTJvbXBxNTk3N2w5dyJ9.OsD0TJx-waSb81Ex7A36Uw - server replied: Unprocessable Entity)

I am using Mapbox as my server, choosing fastest route and all options are kept to default values.

Points are in central Copenhagen with ample of roads so it should not be because you actually cannot drive from A to B.

The Valhalla log window looks like this:

2021-12-29T13:23:35 INFO url: https://api.mapbox.com/valhalla/v1/route?access_token=pk.eyJ1IjoibWFnZXJsaW4iLCJh Problems in Valhalla.zip IjoiY2t1ODA4cXk2NXBheTJvbXBxNTk3N2w5dyJ9.OsD0TJx-waSb81Ex7A36Uw Parameters: { "costing": "auto", "show_locations": true, "locations": [ { "lon": 12.258046, "lat": 55.587734 }, { "lon": 12.58501, "lat": 55.614917 }, { "lon": 12.586164, "lat": 55.612761 }, { "lon": 12.593839, "lat": 55.613472 }, { "lon": 12.594376, "lat": 55.612224 }, { "lon": 12.598146, "lat": 55.612626 }, { "lon": 12.598031, "lat": 55.613277 }, { "lon": 12.604173, "lat": 55.615461 }, { "lon": 12.599321, "lat": 55.606908 }, { "lon": 12.580203, "lat": 55.598971 }, { "lon": 12.577184, "lat": 55.597207 }, { "lon": 12.666496, "lat": 55.592768 }, { "lon": 12.572831, "lat": 55.589161 }, { "lon": 12.618164, "lat": 55.572301 }, { "lon": 12.63911, "lat": 55.586661 }, { "lon": 12.638359, "lat": 55.589183 }, { "lon": 12.625637, "lat": 55.622669 }, { "lon": 12.641691, "lat": 55.588643 }, { "lon": 12.655719, "lat": 55.582929 }, { "lon": 12.655989, "lat": 55.5947 }, { "lon": 12.659183, "lat": 55.59626 }, { "lon": 12.660657, "lat": 55.600145 }, { "lon": 12.660705, "lat": 55.604748 }, { "lon": 12.660705, "lat": 55.604748 }, { "lon": 12.660852, "lat": 55.60343 }, { "lon": 12.659996, "lat": 55.602251 }, { "lon": 12.663766, "lat": 55.603163 }, { "lon": 12.664018, "lat": 55.60348 }, { "lon": 12.663766, "lat": 55.603163 }, { "lon": 12.66246, "lat": 55.605001 }, { "lon": 12.657912, "lat": 55.629829 }, { "lon": 12.64362, "lat": 55.644678 }, { "lon": 12.648874, "lat": 55.637238 }, { "lon": 12.63082, "lat": 55.642271 }, { "lon": 12.63082, "lat": 55.642271 }, { "lon": 12.636178, "lat": 55.635755 }, { "lon": 12.636675, "lat": 55.634598 }, { "lon": 12.636675, "lat": 55.634598 }, { "lon": 12.640841, "lat": 55.633251 }, { "lon": 12.644305, "lat": 55.632546 }, { "lon": 12.647249, "lat": 55.634122 }, { "lon": 12.626065, "lat": 55.632808 }, { "lon": 12.622258, "lat": 55.632714 }, { "lon": 12.593337, "lat": 55.638178 }, { "lon": 12.600735, "lat": 55.633402 }, { "lon": 12.596259, "lat": 55.631385 }, { "lon": 12.593195, "lat": 55.627788 }, { "lon": 12.593143, "lat": 55.625307 }, { "lon": 12.593143, "lat": 55.625307 }, { "lon": 12.595596, "lat": 55.623293 }, { "lon": 12.607154, "lat": 55.625939 }, { "lon": 12.616217, "lat": 55.622713 }, { "lon": 12.616795, "lat": 55.622427 }, { "lon": 12.616859, "lat": 55.621229 }, { "lon": 12.625035, "lat": 55.622866 }, { "lon": 12.625904, "lat": 55.620404 }, { "lon": 12.62419, "lat": 55.6163 }, { "lon": 12.622036, "lat": 55.614826 }, { "lon": 12.622036, "lat": 55.614826 }, { "lon": 12.622036, "lat": 55.614826 }, { "lon": 12.620061, "lat": 55.616494 }, { "lon": 12.620061, "lat": 55.616494 }, { "lon": 12.620061, "lat": 55.616494 }, { "lon": 12.618936, "lat": 55.616869 }, { "lon": 12.617965, "lat": 55.616673 }, { "lon": 12.619089, "lat": 55.614221 }, { "lon": 12.613486, "lat": 55.613415 }, { "lon": 12.614357, "lat": 55.611834 }, { "lon": 12.613023, "lat": 55.609427 }, { "lon": 12.258046, "lat": 55.587734 } ], "id": 41 } 2021-12-29T13:23:35 INFO Feature ID 41 caused a ApiError: Error transferring https://api.mapbox.com/valhalla/v1/route?access_token=pk.eyJ1IjoibWFnZXJsaW4iLCJhIjoiY2t1ODA4cXk2NXBheTJvbXBxNTk3N2w5dyJ9.OsD0TJx-waSb81Ex7A36Uw - server replied: Unprocessable Entity 2021-12-29T13:23:35 INFO Feature ID 41 caused a ApiError: 422 (Error transferring https://api.mapbox.com/valhalla/v1/route?access_token=pk.eyJ1IjoibWFnZXJsaW4iLCJhIjoiY2t1ODA4cXk2NXBheTJvbXBxNTk3N2w5dyJ9.OsD0TJx-waSb81Ex7A36Uw - server replied: Unprocessable Entity)

nilsnolde commented 2 years ago

hm weird.. thanks for giving enough info to easily debug. that sounds like a connectivity error, but you're right, shouldn't be in dense areas like copenhagen. can you try the same request but not from qgis but from curl or postman or so? then you'll get a nice error message from mapbox/valhalla letting you know what the problem is.

we should also build in the option to skip api errors for the batch jobs. you're trying the processing algorithm from the toolbox right?

magerlin commented 2 years ago

Hi Nils

I do unfortunately not known anything about curl or postman so I cannot test this.

Since I can get routes for bicycle some kind of accessibility is there - perhaps the problem is in some of the attributes used for filtering access for auto?

And I actually think I previously in other cases have seen a specific error code stating that there is no route available

Kind regards Morten Agerlin Petersen Senior Transport Planner, GIS and Data Analysis Specialist M +45 51613615 @.**@.> Rambøll Danmark A/S, CVR NR. 35128417 Hjemsted: Hannemanns Allé 53, 2300 København S

From: Nils @.> Sent: onsdag den 29. december 2021 13:51 To: gis-ops/valhalla-qgis-plugin @.> Cc: Morten Agerlin Petersen @.>; Author @.> Subject: Re: [gis-ops/valhalla-qgis-plugin] Server reply: Unprocessable Entity (Issue #6)

hm weird.. thanks for giving enough info to easily debug. that sounds like a connectivity error, but you're right, shouldn't be in dense areas like copenhagen. can you try the same request but not from qgis but from curl or postman or so? then you'll get a nice error message from mapbox/valhalla letting you know what the problem is.

we should also build in the option to skip api errors for the batch jobs. you're trying the processing algorithm from the toolbox right?

- Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fgis-ops%2Fvalhalla-qgis-plugin%2Fissues%2F6%23issuecomment-1002579253&data=04%7C01%7Cmap%40ramboll.dk%7C2ba9c4abcca240ce65e608d9cac9dab1%7Cc8823c91be814f89b0246c3dd789c106%7C0%7C0%7C637763790573294590%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=84wmKXChjDj88QY47tBfW%2FFb2aPOtu5pFat30IilXN0%3D&reserved=0, or unsubscribehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAOM2K6RMTYRXEH6TXA6DKLUTL725ANCNFSM5K54CPQQ&data=04%7C01%7Cmap%40ramboll.dk%7C2ba9c4abcca240ce65e608d9cac9dab1%7Cc8823c91be814f89b0246c3dd789c106%7C0%7C0%7C637763790573294590%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=aOpfUZLuReAb3ql40SJIpFxxNlipVRgZ37FC9jIiDL0%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7Cmap%40ramboll.dk%7C2ba9c4abcca240ce65e608d9cac9dab1%7Cc8823c91be814f89b0246c3dd789c106%7C0%7C0%7C637763790573294590%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=WfotOG92%2BOCFjLf0QOZ%2BEa8GkHJxbRRcQhSUG39EKIc%3D&reserved=0 or Androidhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7Cmap%40ramboll.dk%7C2ba9c4abcca240ce65e608d9cac9dab1%7Cc8823c91be814f89b0246c3dd789c106%7C0%7C0%7C637763790573294590%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=M2EKTksS7378hNP03XbVU5C3WLIM6NocvJrf6H9RqVc%3D&reserved=0. You are receiving this because you authored the thread.Message ID: @.**@.>>

magerlin commented 2 years ago

Having investigated a bit more I can conclude it is not a network problem.

If I take one of the problematic multipoints and split it into single parts I can make the "Directions From Points 2 Layers Auto" step calculate routes between all the points (by using the single parts layer twice in the calculation).

So routes are available between all single points in the problematic multipoint.

Diving even deeper at least for the one multipoint example looked at I could make the "Directions From Point Layer Auto" run by deleting one of two singlepoints being that close that you actually would/could not drive car in-between these:

image

Using the "Directions From Points 2 Layers Auto" returns a distance of zero in-between these two points.....

And when "Directions From Point Layer Bicycle" can run it looks like being because the bike can get closer than a car to each of the two nearby addresses and really make a route.

So I think the conclusion must be that it is the call of the api using a multipoint with (very) nearby single points which is problematic?

Updated project and data here: Problems.in.Valhalla (2).zip

nilsnolde commented 2 years ago

thanks for more details. not sure what valhalla does on non-routes (the example in the pic snaps to the same road segment, which we call trivial route).

I'll have a quick look after new year's. should be a trivial change. do note, we're working on a much improved plugin which can leverage both valhalla & osrm for more advanced algorithms like proper network analysis (locate/allocate, vehicle routing problems etc), but that'll take a few more months to complete and roll out. meaning this plugin is on its last leg (and it's a little off an abomination, it used to be a pure debugging internal tool for us to develop valhalla further)