pyufunc.proj_point_to_line#

pyufunc.proj_point_to_line(point, line)#

Project a point to a line and return the projected point on the line.

Parameters:
  • point (shapely.geometry.Point) – the point to be projected

  • line (shapely.geometry.LineString) – the line to be projected to

Returns:

the projected point on the line

Return type:

shapely.geometry.Point

Example

>>> from shapely.geometry import Point, LineString
>>> point = Point(0, 0)
>>> line = LineString([(1, 1), (2, 2)])
>>> projected_point = project_point_to_line(point, line)
>>> projected_point
POINT (0.5 0.5)