get_road_previous_marker_from_point(_road_code text, _point geometry, _use_cache boolean DEFAULT false)


Description

Get the closest upstream marker for the given road from a given point. This function can use roads cached objects generated beforehand via function build_road_cached_objects. Or use a full SQL query with no use of temporary tables, depending of the paramter _use_cache

Illustration |m0—-m1—-| |-m2-m2b—-m3—-| p3 m4 |——–m5—| p0 p1 p2 p0 -> marker is m1 p1 -> marker is m2b (virtual marker with a non-null abscissa) p2 -> marker is m3 p3 -> marker is m4, since it is the start marker of the first next edge and p3 is not on a real previous edge.

The function also returns: * the simple linestring (no gaps) made by merging all edges linestrings from the marker to the point * the simple linestring (no gaps) made by merging all edges linestrings from the start to the point * the multilinestring made by collecting all connectors between end and start points, which will help to remove them from linestrings to create the definitive geometry (with gaps) * if the found marker is the start marker of the next edge (for p3-like cases when the point is between two edges)

Parameters

Name Type Mode
_road_code text IN
_point geometry IN
_use_cache boolean IN
id integer TABLE
road_code text TABLE
code integer TABLE
abscissa real TABLE
geom geometry TABLE
road_linestring_from_marker_to_point geometry TABLE
road_linestring_from_start_to_point geometry TABLE
closing_multilinestring geometry TABLE
is_next_edge_start_marker boolean TABLE
cumulative real TABLE

Definition