-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting a path along a river on a LineLayer with multiple rivers? #88
Comments
Looks like it was just a matter of changing the tolerance to 1e-3! Though it does simplify the line a little so it doesn't hug the original line when zoomed in unfortunately. I guess there's no way around this? |
If the original lines' vertices snap it should work without adjusting the tolerance |
I'm honestly not sure, i'm quite certain that the points have snapped as when viewing them visually on maximum zoom, they are dead centre on the line. But without adjusting the tolerance i just get back an undefined value. Maybe its the lineString itself... I'm a little lost. :) |
It is not enough that the vertex of one line snaps to the somewhere on another line between two vertices on that line. They need to meet on a vertex. This is not enough...
Needs to be...
|
I think I understand, i'm required to increase the tolerance because the line data i'm using from the url has minute gaps between each segment of the line, or at least do not share vertices? |
Yes, to get accuracy the lines need to have the same vertices. Increasing tolerance expands the radius so two vertices close to each other is considered equal but this the reduces accuracy. |
I've been working on it and have been preprocessing the data, it turns out there are no overlapping lines and i cannot see any gaps at all. Could this issue be the start/end points being too far away from the lines? |
The coordinate of start and endpoints should also be a vertex on the line. This is good (notice they meet at (0.1))
this is not good (they cross but do not have the same identical coordinate where they meet which is needed to for the path-finder to join them)
I expect that your data i suffering from this. The start/end-point is on the line but there is no vertex where they meet on the line |
Hiya, I am using this geojson data source which supplied canals in the UK.
https://data-canalrivertrust.opendata.arcgis.com/datasets/CanalRiverTrust::canals-km-view-public/explore
I was hoping to be able to use this library to be able to highlight a section of one of the rivers to show for example a "cruise" between two locations. However when trying to run the function I receive
undefined
from the return value of findPath().Am i doing something wrong, or is there a way to achieve this? Thanks so much for any and all advice!
Code:
The text was updated successfully, but these errors were encountered: