cityImage.line_at_centroid#
- cityImage.line_at_centroid(line_geometry, offset)[source]#
Given a LineString, it creates a perpendicular LineString that intersects the given geometry at its centroid. The offset determines the distance from the original line. This fictional line can be used to count precisely the number of trajectories/features intersecting a segment. This function should be executed per row by means of the df.apply(lambda row : ..) function.
- Parameters:
line_geometry (LineString) – A street segment geometry.
offset (float) – The offset from the geometry.
- Returns:
The perpendicular line intersecting the given one.
- Return type:
LineString