How to Trace the Longest Straight Line Paths on Earth

A recurring computational geography question asks which straight path over the globe crosses the most uninterrupted ocean, and which crosses the most.

A recurring computational geography question asks which straight path over the globe crosses the most uninterrupted ocean, and which crosses the most uninterrupted land. Both are answerable with public elevation data and a search over great-circle routes.

Key takeaways

  • The “longest straight line” problem asks for the great-circle path segment that crosses only water, or only land, without touching the other.
  • A straight line on a sphere means a great circle, the shortest path between two points across the surface, not a straight line on a flat map.
  • Answering the question requires a global land-water mask and a systematic search over candidate paths, both of which are achievable with open data and ordinary computing hardware.
  • Results depend heavily on the resolution of the coastline data used, so different datasets can produce different winning routes.
  • Anyone can reproduce this type of analysis, but the exact endpoints and distances quoted in popular write-ups should be treated as dataset-specific rather than absolute.

What is the longest straight line problem?

The problem has two symmetrical halves. The first asks: what is the longest segment of a great circle that can be drawn on the Earth’s surface without crossing any land? The second asks the same question for a path that never touches water. In both cases “straight” is defined geodesically. On a sphere, the analogue of a straight line is a great circle, a circle whose centre coincides with the centre of the sphere. Any two points on the surface define such a circle, and the shorter arc between them is the geodesic path.

This definition matters because it changes the answer completely compared with a straight line drawn on a printed map. Common map projections distort direction and distance, so a route that appears to bend dramatically on a rectangular world map may be perfectly straight in the geodesic sense. Conversely, a ruler laid across an atlas does not describe a real straight-line path over the globe.

The task is therefore a search problem. Given a description of where land and water are, find the pair of endpoints whose connecting great-circle arc satisfies the constraint and maximises arc length.

Why does this keep resurfacing?

The topic circulates periodically on technical forums and link-aggregation sites, typically when someone publishes or rediscovers a computational treatment of it. The appeal is that it sits at the intersection of a simple, intuitive question and a non-trivial implementation. A reader can understand the question in a sentence, then discover that solving it properly requires spatial data handling, coordinate mathematics and a search strategy that does not take an impractical amount of time.

There is also a longer folklore history. Claimed answers circulated informally for years before anyone published a systematic method, and those informal claims were often illustrated with distorted map images. The arrival of reproducible computational treatments gave the question a verifiable footing, which is part of why it retains attention. The precise details of who published what, and when, vary between accounts and are not something a reader should assume from a summary.

What background does a newcomer need?

Three ideas are enough to follow the work.

First, coordinate systems. Positions are given as latitude and longitude on an ellipsoid or sphere. Converting between angular coordinates and three-dimensional Cartesian coordinates makes many of the geometric operations simpler, because a great circle becomes the intersection of a plane through the origin with the sphere.

Second, land-water masks. Global datasets describe coastlines as polygons or as raster grids marking each cell as land or water. Resolution varies. A coarse grid may miss small islands, narrow channels or reefs entirely; a fine grid captures them but increases the computational cost and raises questions about what counts as land at all. Tidal flats, ice shelves and ephemeral sandbars have no single correct classification.

Third, search strategy. Testing every possible pair of points at fine resolution is prohibitively expensive, because the number of candidate paths grows rapidly with the density of sampled points. Practical approaches reduce the search space, for example by ruling out large families of candidate paths that cannot possibly beat the best result found so far, or by refining a coarse search progressively.

Who is affected and how?

This is not a problem with direct commercial or policy stakes. Its practical audience is people learning geospatial computation, students working through a bounded project, and developers who want a concrete exercise in optimisation over spherical geometry.

For that audience the value is transferable. The same components appear in real navigation, routing and coverage problems: reading raster or vector geographic data, working in a defined coordinate reference system, sampling along geodesics, and bounding a search so it completes in reasonable time. The land-water version of the problem in particular is a compact introduction to branch-and-bound style reasoning, where the difficulty lies in proving that entire regions of the search space can be discarded.

Cartographers and geography educators also use the problem to illustrate projection distortion, because the visual mismatch between the true path and its appearance on a rectangular map is unusually stark.

Where do informed people disagree?

The main disagreements are about definitions rather than mathematics.

One is what counts as land. Whether to include permanent ice, seasonal ice, inland water bodies, artificial islands or exposed reefs changes the answer. A path across a frozen sea is straight and unobstructed by land under one definition and blocked under another.

A second is data resolution. Because coastlines are fractal in character, the measured extent of a route depends on the scale at which the coast is described. Two teams using different datasets can each be internally consistent and still disagree on which route wins.

A third is what “straight” should mean. Great-circle geodesics are the standard interpretation, but the Earth is an oblate spheroid rather than a sphere, so geodesics on an ellipsoid differ slightly from great circles on a sphere. Whether that difference is material depends on the precision claimed.

Finally, there is disagreement about how much precision the answer deserves. Because the result is sensitive to all of the above, quoting a distance to the metre implies a confidence the underlying data may not support.

What are the practical implications for someone attempting it?

A workable approach looks roughly like this.

Start by obtaining a global land-water mask at a resolution you can handle, and inspect it directly before trusting it. Confirm how it classifies edge cases in a region you know well.

Convert your problem into three-dimensional Cartesian coordinates on a unit sphere. This makes it straightforward to define a great circle from two points, and to step along that circle at a fixed angular interval.

Sample along each candidate path and test the mask at each sample point. Choose the step size relative to your mask resolution: sampling more coarsely than the mask means you can step over an island entirely and record a false result.

Reduce the search space before scaling up. Run a deliberately coarse version end to end first, so you have a complete pipeline and a baseline answer. Then refine. Verify any candidate result by plotting it on a globe rather than a flat projection, since a flat plot will not look wrong in the way an error actually is.

Finally, state your assumptions alongside your answer: which dataset, which resolution, which definition of land, and whether you used a spherical or ellipsoidal model.

What should you watch next?

Two things are likely to shift results over time. Higher-resolution global coastline and bathymetry datasets continue to become publicly available, and each improvement can change which fine details, such as a small islet, interrupt a candidate path. Separately, changing coastlines, from erosion, sea level change and ice extent, mean the answer is not fixed in principle even if the method is stable.

For a reader wanting to act on this, the reproducible step is the one worth taking: implement the search yourself against a stated dataset and see whether you recover a published route. Where you do not, the discrepancy is usually traceable to resolution or definition rather than to an error in the mathematics.

Frequently asked questions

What does “straight line” mean on a globe?

It means a great-circle arc: the path traced by the intersection of the Earth’s surface with a plane passing through the planet’s centre. This is the shortest surface route between two points on a sphere and is the standard geodesic definition. It is not the same as a straight line drawn on a flat map, because map projections distort direction and distance, sometimes severely at high latitudes.

Why does the path look curved on a world map?

Most familiar world maps use projections that stretch and shear the globe onto a rectangle. A true great-circle route generally appears as a curve on such maps, and the apparent curvature increases the further the route strays from the equator or from a projection’s line of least distortion. Plotting the same route on a three-dimensional globe shows it as straight.

What data do you need to solve it?

At minimum, a global land-water mask that tells you whether a given latitude and longitude is land or water. This can be a raster grid or a set of coastline polygons. The resolution of that dataset largely determines the quality of your answer, because small islands and narrow channels either appear or do not. Public datasets of this kind are available from national and international mapping bodies.

Why do published answers differ from each other?

Because they rest on different definitions and different data. Choices about whether ice counts as land, whether inland lakes interrupt a land path, and what coastline resolution to use all change the outcome. Two analyses can be individually correct under their own stated assumptions and still name different endpoints. This is a reason to read the assumptions alongside any quoted route.

Is this computationally hard?

The naive approach is expensive, because the number of candidate point pairs grows quickly as you sample the surface more finely. It becomes tractable with a search strategy that discards large groups of candidates that cannot beat the current best result, or that refines a coarse solution progressively. Modest hardware is sufficient once the search space is reduced sensibly.

Can I reproduce this myself?

Yes. The problem is a common self-contained project for anyone learning geospatial programming. The required pieces are an open land-water dataset, a way to convert between angular and Cartesian coordinates, a sampling routine along great circles, and a search loop. Starting with a deliberately coarse resolution and refining is the practical route, since it gives a working pipeline early.

Sources and further reading

  • National and international mapping agencies, which publish open global coastline and land-water datasets at a range of resolutions.
  • Academic literature on geodesy, for the distinction between spherical great circles and geodesics on an ellipsoid.
  • Standard references on map projections, for why great-circle routes appear curved on common flat maps.
  • Technical link-aggregation communities, where computational treatments of this problem and discussion of their assumptions circulate.

Surfaced from the hackernews signal “computational geography problem”. AI-assisted draft, editorially reviewed.

Visited 1 times, 1 visit(s) today
share this recipe:
Facebook
X
WhatsApp
Telegram
Email
Reddit