Skip to content

ORS parse_direction_json on empty summary ORS responseΒ #158

@Mutlaq10

Description

@Mutlaq10

when two -too close- source and destination points (edge case: The Source and Destination points are the same point) are called in directions function in the ORS it returns an empty summary field. This raises an exception in the parse_direction_json when trying to get route["properties"]["summary"]["duration"]: https://github.com/mthh/routingpy/blob/master/routingpy/routers/openrouteservice.py#L335

The following code could reproduce the error:

from routingpy import ORS
ors_client = ORS(api_key="", base_url="http://openrouteservice:8082/ors")
ors_client.directions(locations=[(35.032508, 32.426874), (35.032508, 32.426874)], profile="driving-car", format="json")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions