NREL / routee-compass

The RouteE-Compass energy-aware routing engine
https://nrel.github.io/routee-compass/
BSD 3-Clause "New" or "Revised" License
9 stars 4 forks source link

Missing edge field error #68

Closed nreinicke closed 6 months ago

nreinicke commented 6 months ago

When running the national beer run over the latest compass code, I get back an error:

{"error":"missing field origin_edge","request":{"destination_name":"Jack's Abby Craft Lagers","destination_vertex":20659444,"destination_vertex_uuid":"0000554d-4100-2800-ffff-ffffd044a62d","destination_x":-71.4133386,"destination_y":42.2803461,"energy_cost_coefficient":0.0,"model_name":"2016_TOYOTA_Camry_4cyl_2WD","origin_name":"NREL","origin_vertex":188668,"origin_vertex_uuid":"00004358-3100-2800-ffff-ffffd02850f1","origin_x":-105.1710052,"origin_y":39.7402804,"query_weight_estimate":2827.912636598859}}

The vertex rtree plugin is enabled and it's correctly adding the origin and destination vertex ids and so it shouldn't be attempting an edge based search.

nreinicke commented 6 months ago

I think the problem is that we run the edge oriented search if the vertex search returns an error. But, in this case the error gets overridden by a new error that gets returned by the edge oriented search not having the right input field.

Perhaps we should make the vertex/edge search decision more explicit in the config.

robfitzgerald commented 6 months ago

Perhaps we should make the vertex/edge search decision more explicit in the config

definitely, this fallback behavior was a sloppy choice. maybe SearchApp has a search_orientation: SearchOrientation enum which can be Vertex or Edge and we pick the search logic from that.