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

why the route is a polygon【bug】 #45

Open xiaxichen opened 1 month ago

xiaxichen commented 1 month ago

the test code

import searoute as sr

#Define origin and destination points:
# origin = [21.1545, 55.6526]
# destination = [-118.2629, 33.7276]
origin = [56.0, 26.0]
destination = [56.4, 25.1]

route = sr.searoute(origin, destination, append_orig_dest=True, restrictions=['northwest'], include_ports=True, port_params={'only_terminals':True, 'country_pol': '', 'country_pod' :'', 'country_restricted': False})
# > Returns a GeoJSON LineString Feature
# show route distance with unit
print("{:.1f} {}".format(route.properties['length'], route.properties['units']))

print(route)

# Optionally, define the units for the length calculation included in the properties object.
# Defaults to km, can be can be 'm' = meters 'mi = miles 'ft' = feets 'in' = inches 'deg' = degrees
# 'cen' = centimeters 'rad' = radians 'naut' = nauticals 'yd' = yards
routeMiles = sr.searoute(origin, destination, units="mi")

the route picture

image