Background
I'm trying to create parallel lines that go through each parallel points. In this points arrangement, it's North-South lines:
I use Python and the libraries: pygeos
, geopandas
, and shapely
Difficulties
My current approach is to create Delaunay lines, then filter it based on its azimuth. I keep the deviation around +- 10 degree from 0 and 180 (0 & 180 based on minimum_rotated_rectagle orientation)
Here I see there're two things that should be done.
- Connect the lines
- Connect points that are not in any lines
To solve both of this problem, I'm thinking to create a connecting line for each line/point to nearby lines (filtered by threshold distance (x and y); ex: line 8 has nearby lines -> 6, 7, 9). When connecting the lines the connecting line created must be either at the start or end of the line.
Using the created connecting lines, then I filter it again using the azimuth.
Questions
- What line should I use, is it hausdorff lines? (if it's, is there library that create the line? not only calculate the distance).
- Is there any better approach for this problem?
I've tried to use voronoi and buffer to simulate neighboring points, however it's not possible because there could be deviation in points position, therefore not creating a straight line.
Desired Output
Here's the desired output. The lines connected to points in its parallel.
- For point in green circle, it will be combined to neighboring line based on the shortest distance.