Test to offset a point perpendicalar to a line
Kaufmann, 2024.
[1]:
import geopandas as gpd
[2]:
from shapely.geometry import LineString
a = (0, 0)
b = (15, 7)
cd_length = 6
ab = LineString([a, b])
left = ab.parallel_offset(cd_length / 2, 'left')
right = ab.parallel_offset(cd_length / 2, 'right')
c = left.boundary.geoms[1]
d = right.boundary.geoms[1]
cd = LineString([c, d])
[3]:
d = {0:{'geometry': ab}, 1:{'geometry': cd}}
[4]:
gdf = gpd.GeoDataFrame.from_dict(d, orient='index')
[5]:
gdf.plot()
[5]:
<Axes: >

[6]:
l = LineString([[0., 4.], [6.,8.], [9., 11.], [11., 14.], [21.,25.], [26., 33.],])
[7]:
l
[7]:
[8]:
d = 13.
[9]:
l.interpolate?
[ ]: