Why Do Map Distances Follow Curved Paths? Understanding Geodesic Lines
This article explains why the shortest distance between two points on a map appears as a curve rather than a straight line, covering the concept of geodesic lines, map projection distortion, and how modern map APIs implement accurate distance rendering.
Distance measurement is a basic map feature; in Baidu Maps PC you can enable it via the toolbox‑>Measure tool.
When zooming out and measuring the distance from Beijing to Paris, the shortest path appears as a curved line instead of a straight segment.
Geodesic (Great‑Circle) Line
The true shortest distance between two points on the Earth’s ellipsoid (approximated as a sphere) is a geodesic line, also called a great‑circle line. Flat maps are projections of the sphere, and the farther a region is from the equator, the more distortion occurs, making straight‑line distances appear longer.
For example, a Mercator projection makes Greenland look larger than the whole of North America, while on the globe Greenland is much smaller; similarly, geodesic lines curve more the farther they are from the equator.
Viewing the Beijing‑Paris line on a globe shows it as the true shortest path.
Implementing Geodesic Lines
When adding a line via a map API, you normally provide only the start and end coordinates. An additional configuration option can enable geodesic rendering; the engine then automatically calculates intermediate points along the geodesic.
The engine first decides whether the line is long enough to require geodesic calculation and determines how many intermediate points are needed, avoiding unnecessary performance cost for short lines.
It then computes each point’s coordinates and draws the curved line. A reference implementation is available at https://www.movable-type.co.uk/scripts/latlong.html .
Geodesic lines may need to be split when crossing the ±180° meridian because the map repeats horizontally; the engine renders separate copies in adjacent world copies to ensure correct display.
Baidu Maps Tech Team
Want to see the Baidu Maps team's technical insights, learn how top engineers tackle tough problems, or join the team? Follow the Baidu Maps Tech Team to get the answers you need.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
