genthalili / searoute-py

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

Routes in North Russia gets stuck #3

Closed siggemannen closed 1 year ago

siggemannen commented 2 years ago

Hello again. I noticed that the routes east of the russian horn aren't properly generated, for example this route between Dikson and Tiksi

FromLatitude | ToLatitude | FromLongitude | ToLongitude -- | -- | -- | -- 69.680791392377 | 71.762329776877 | 170.213397039944 | 129.200203648516

tiksi - dikson

becomes rerouted through China:

china

Do you think its safe to add a new string so these routes get picked up? The downside is that perhaps vessels going from Norway to China mind end up rounding the russian side instead of going through the normal south route.

== A bit unrelated thing is that there's a straight line through the Russian right side which probably lead to land route:

image

Perhaps it's not needed since there's a real sea route between Russia and Alaska

genthalili commented 2 years ago

Hi @siggemannen,

I updated the network to covert that north part as well, though not yet updated the package. image

Network updated : image

However, for the 2nd part, are you trying to make a connection between China and north part of Russia (like Tiksi) via Bering Sea?

siggemannen commented 1 year ago

Hi and sorry for long reply. About your second question, yeah, there are some ports on the east part of russia which route to Magadan through the Bering:

image

Right now it works, but looks a bit funny cause it makes a straight cut through the land

genthalili commented 1 year ago

Hi @siggemannen, can you provide some examples (lon,lat) where we see the straight line?

siggemannen commented 1 year ago

Try this one:

numFromLatitude numToLatitude numFromLongitude numToLongitude
69.680791392377 56.22473809809 170.213397039944 162.500281063544

It's also a bit funky cause it generates longitude values that are out of regular -180 - 180 range:

{"geometry": {"coordinates": [[-180, 70], [-180, 60], [-180, 50], [-180, 50], [-180, 40], [-183.061, 46.3721], [-187.1, 52.6], [-196.9, 54.7]], "type": "LineString"}, "properties": {"duration_hours": 124.27357140834076, "length": 5523.71170195793, "units": "km"}, "type": "Feature"}

Oh btw, another question, how is the "duration_hours" calculated? Since you don't know the vessel speed

genthalili commented 1 year ago

Hi @siggemannen,

I released version 1.0.9: https://github.com/genthalili/searoute-py/releases/tag/1.0.9, you have now restrictions parameter:

route = sr.searoute(origin, destination, append_orig_dest=True, restrictions=[]) # if you want no restirictions and accept to use the northwest sea (which is not used a lot as a comercial route, at least not yet)
route = sr.searoute(origin, destination, append_orig_dest=True, restrictions=['suez', 'northwest']) # if you want restrictions on suez canal + northwest sea

For more info whenever to use or not the specific canal and potential expansions in the future: https://www.itf-oecd.org/sites/default/files/docs/decarbonising-maritime-transport.pdf

Let me know if version 1.0.9 fixes this issue as well.

genthalili commented 1 year ago

Regarding your question on duration_hours: It's calculated based on param input speed_knot which by default is 24 corresponing to an average: https://github.com/genthalili/searoute-py/blob/main/README.md#parameters Feel free to change the speed_knot based on the boat type or size, or even the route you take.