searoute-py icon indicating copy to clipboard operation
searoute-py copied to clipboard

return_passages option returns incorrect passages

Open LuciaCam opened this issue 8 months ago • 10 comments

Hello,

I have tried to use the return_passages new feature, but it is returning passages that aren't crossed by the maritime path. Here is an example:

import searoute as sr
import geopandas as gpd
import folium

traj = sr.searoute([52.99, 25.01], [-61.87, 17.15], append_orig_dest=True, restrictions=['northwest', 'chili'], return_passages=True)
print(traj['properties']['traversed_passages'])

gdf = gpd.GeoDataFrame.from_features([traj])
gdf = gdf.set_crs("EPSG:4326")
m = folium.Map(location=[0, 0], zoom_start=2)
folium.GeoJson(gdf).add_to(m)
m

The resulting traversed passages are:

['gibraltar', 'panama', 'sunda', 'malacca', 'ormuz', 'chili', 'suez', 'bosporus', 'babalmandab', 'south_africa']

When they should only be:

['gibraltar', 'suez', 'babalmandab', 'ormuz']

Here is a picture of the trajectory: image

Thank you for your help!

LuciaCam avatar Jun 12 '24 15:06 LuciaCam