Test to offset a point perpendicalar to a line

  1. 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: >
../../_images/examples_geophysics_test_perpendicular_offset_from_line_5_1.png
[6]:
l = LineString([[0., 4.], [6.,8.], [9., 11.], [11., 14.], [21.,25.], [26., 33.],])
[7]:
l
[7]:
../../_images/examples_geophysics_test_perpendicular_offset_from_line_7_0.svg
[8]:
d = 13.
[9]:
l.interpolate?
[ ]: