grandline

Ports Nearest

Returns the N nearest ports to a given coordinate, sorted by great-circle distance ascending.

Useful as the first link in the MCP tool chain — resolve an arbitrary AIS ping / dropped pin / customer-supplied coordinate into the nearest cataloged ports, then feed any of them into /routes/find.

Distance ordering: the SQL uses simple degree-distance for selection (PostGIS-independent and cheap to scan), and the result is then re-sorted in Python by the accurate haversine distance — important near the poles and across the antimeridian, where degree-distance diverges from great-circle ordering.

get/api/v1/ports/nearest

Request

  • Base URL: https://grandline.luzomi.com
  • URL: https://grandline.luzomi.com/api/v1/ports/nearest
  • Auth: none declared

Query parameters

latnumber required

Latitude in WGS84 degrees

lonnumber required

Longitude in WGS84 degrees

ninteger

Number of ports to return (1-20)

Response

Successful Response

port_idinteger required
port_namestring required
country_iso2string required
distance_nmnumber required
latnumber required
lonnumber required

Changes

No recorded changes to this operation across all 1 revision of this API.