genthalili / searoute-py

A python package to calculate the shortest sea route between two points on Earth.
Apache License 2.0
63 stars 14 forks source link

Bug? #10

Closed bluefish007 closed 1 year ago

bluefish007 commented 1 year ago

Why this strange route?

origin = [2.650544, 39.571625] # Palma destination = [2.1734, 41.3850] # Barcelona

Bildschirm­foto 2023-02-08 um 20 52 32
genthalili commented 1 year ago

Hi @bluefish007 ,

The issue is coming from the network which is not in the most perfect shape, I'm updating time to time but it's quite difficult to detect all missing connections like this, as it's quite time consuming...

Thanks for reporting this, I'll improve it for the next release v1.0.10

In red highlighted the missing connection in the network geojson:

image
bluefish007 commented 1 year ago

Thank you for your answer and explanation!

From Palermo to Palma it also looks awkward:

Bildschirm­foto 2023-02-08 um 21 54 04
genthalili commented 1 year ago

Same issue, the maritime network is really a mess, it requires a real fondamental clean. https://github.com/genthalili/searoute-py/blob/main/searoute/data/marnet_densified_v2.geojson

PS: It was taken from the eurostat/searoute initially, but some of the crossing lines are not correctly connected with each other and especially some ports not represented correctly.

Feel free to collaborate and help me improve the network : https://github.com/genthalili/searoute-py/blob/main/searoute/data/marnet_densified_v2.geojson :) .

bluefish007 commented 1 year ago

How can I help to improve the network?

genthalili commented 1 year ago

Not sure how familiar you are with geojson format... but what you can do is check if you can develop a function which will detect all crossing lines(LineStrings) that are not touching each other, like in the above example (screenshot) I showed. Then as a second step is to add common "points" in both LineStrings, as this is causing most of issues.

The other option is do this manually, but it's lot of time consuming.

Anyways, this will not fix everything (however at least 80-90% of issues will be), the rest need to be fixed manually, like missing direct connections etc.., I usually do it here : https://vector.rocks/

bluefish007 commented 1 year ago

I think I can develop a function to detect and fix the geojson.

But at the moment I am not yet familiar with geojson and have not yet fully understood the problem. Can you please explain this again. How can I identify that there is no connection at the crossing at the example? (How did you find this crossing? At least visually it looks like a crossing...)

genthalili commented 1 year ago

Fixed in the merge and latest version 1.1.0 :

image