calculate_managed_object_references()


Description

Trigger function allowing to update the references of an inserted or update managed object feature.

The references are calculated on the road of the feature, if its road code is not empty. Otherwise, the road is the closest one to the point, or to the middle of the line: the start of a line is often on an intersection, unlike its middle.

When the geometry is updated but not the road code, for example when the road code is a read-only field of the form, the road code is replaced by the closest road if the feature has drifted away from its road: the point, or the middle of the line, is closer to another road, and more than 50 m away from its road, or farther from it than before by more than a tolerance. The tolerance is 10 m by default, and can be changed with the session variable road.graph.road.code.drift.tolerance. A road code changed by the update is always kept.

For a line, the start and end references follow the road direction (start before end), even if the line is digitized in the opposite direction of the road. The offset and the side of a line are calculated at its middle.

Parameters

Name Type Mode
IN

Definition