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

Incorrect routes through the Northwest Pacific #20

Closed pjwilliams11 closed 3 weeks ago

pjwilliams11 commented 10 months ago

This is an awesome and powerful package! One thing I've found: Routes through the Northwest Pacific are erroneous. It seems the base graph lacks sufficient points in the Northwest pacific to properly calculate a minimal distance route, leading to some weird routing. See the image below for a route between Shanghai and Vancouver - this should go north of Japan and generally follow a great circle route across the rest of the Pacific.

Screenshot 2023-08-29 at 2 13 23 PM

genthalili commented 10 months ago

Hi @pjwilliams11, You're right, looks like the network is not dense enough to propose the shortest path as expected: image

When I find some free time, I'll look closely to this case and see how to fix it as there must be connection secured between west and east properly with the "segment" file.

Anyways, meanwhile feel free to contribute/send pull request.

pjwilliams11 commented 10 months ago

Can you provide a bit broader of a screenshot? I'm surprised that the upper routes aren't being followed for this case, as it looks like the shortest route is probably available by going north of Japan.

Maybe there is a calculation error for shortest route. It seems like the alteration in route (from tracking horizontally to going north) in the original screenshot happens right at the 180th meridian.

pjwilliams11 commented 10 months ago

Ah, just looked at the geojson. Yes, it looks like there are no segment connections further north. Screenshot 2023-08-29 at 4 11 41 PM

vinisalazar commented 8 months ago

Hi @genthalili, I am experiencing a similar problem. I have these two points:

p0, p1 = array([-154.9234, 71.9052], dtype=object), array([-72.46, 72.23], dtype=object)

I am setting restrictions=None to allow routes through the Northwestern passages:

dist_ = sr.searoute(p0, p1, restrictions=None)

This is my resulting route:

plot_world_map_with_lines([dist_["geometry"]["coordinates"],])

searoute

I would like instead to have a shorter distance through the Northwestern passages. This superestimation of the distance seems to happen with many of my data points around the poles. Is there a way to maybe obtain a denser network?

Thank you for your assistance and for providing Searoute!

pjwilliams11 commented 5 months ago

@genthalili would the update be to segment.geojson or marnet_searoute.geojson?

genthalili commented 5 months ago

Just released version 1.3.1 which should cover both issues. Try it and let me know.

genthalili commented 3 weeks ago

closing this as no activity, feel free to re-open this issue if needed