It would be great to see the details of your particular call so that we will be sure what’s going on with the response which you are getting.
It is possible that your request is using the expandCluster parameter and the cluster itself, which you get from the response, can be located near to the bounding box borders. After expanding it, some of the incidents can appear outside of the bounding box which might be the case in your scenario.
Thanks a lot for sharing the call. Unfortunately, it’s empty now as the incidents are changing quite often. It would be great to see the call together with a response in which we’ll be able to see the problem. We will try to perform some tests on our side also.
The investigation showed that described problem is not a bug.
First part of a problem: “incident appears to be outside of the requested bounding box”. In fact incident consists of two things, POI and tube (whole geometry). Coordinates given in the response (fields “p” and “op”) are in fact the coordinates of the POI, which is the beginning coordinate of the incident. The tube is coded within “v” field. When a particular incident is checked if it belongs to the requested bbox, the whole incident bbox is checked if it intersects with requested bounding box, not only if its POI belong to it.
Second part of a problem: “cluster appears to be outside requested bounding box”. Cluster is considered as belonging to the requested bbox if at least part of at least one of its incidents belongs to the requested bounding box (take a look at above explanation of first part). The borders of the cluster are described by “ctr” and “cbl” fields. However, the cluster area is computed based on the incidents POI location, not based on the whole incident geometry. As a result cluster area appears to be smaller comparing to the actual length of its incidents.
The API documentation on the portal will be updated with more details.
A traffic incident consists of a beginning point and a “tube” - an incident geometry encoded within the ‘v’ field using the Polyline Algorithm.
Given above - if any part of the incident “tube” is lying inside the given bounding box, the incident is included in the API response even if the beginning of that incident is lying outside of the bounding box. Similar applies to the clusters.