HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
GIS: Coordinates, Projections and Map Layers
  1. 1Latitude, longitude and the shape of the Earth
  2. 2Map projections and grids
  3. 3Vector layers and raster layers
  1. Earth and Environmental Science
  2. /GIS: Coordinates, Projections and Map Layers
  3. /Latitude, longitude and the shape of the Earth

Course 12.2·Lesson 1 of 3

Latitude, longitude and the shape of the Earth

Latitude and longitude give every place an address, and the address depends on the datum. The Earth is an ellipsoid, the surface of the sea is the geoid, and GPS gives heights above the ellipsoid. The shortest way between two places is a great circle, found with the haversine formula.

about 30 min1 simulation2 practice questions
Lesson 1 of 3Show all lessonsHide
GIS: Coordinates, Projections and Map Layers
  1. 1Latitude, longitude and the shape of the Earth
  2. 2Map projections and grids
  3. 3Vector layers and raster layers

Try the code and the simulations beside the lesson.

An address on a curved Earth

Two phone apps give the position of the same temple. The coordinates differ in the fourth decimal place, and the dots on the map are 12 m12\ \text{m}12 m apart. Which one is right? To answer, we must ask what the numbers measure, and from what surface. This lesson gives the address system of the globe and its shape.

Latitude and longitude

Latitude, φ\varphiφ, is the angle between the vertical of a place and the plane of the equator. It is positive to the north and negative to the south, and it runs from −90∘-90^\circ−90∘ to +90∘+90^\circ+90∘. Longitude, λ\lambdaλ, is the angle east of the prime meridian, the meridian of Greenwich. It runs from −180∘-180^\circ−180∘ to +180∘+180^\circ+180∘. West is negative.

Old maps write degrees, minutes and seconds. There are 60′60'60′ in 1∘1^\circ1∘ and 60′′60''60′′ in 1′1'1′. For example, 28∘36′36′′28^\circ 36' 36''28∘36′36′′ is 28.61∘28.61^\circ28.61∘, because 28+36/60+36/3600=28.6128 + 36/60 + 36/3600 = 28.6128+36/60+36/3600=28.61. Software uses the decimal form.

Watch the order. Spoken, we say latitude first. A GIS, and the GeoJSON file format, put longitude first, as (x,y)(x, y)(x,y). Swapping them puts Delhi in Antarctica.

Longitude is also time. The Earth turns 360∘360^\circ360∘ in 24 h24\ \text{h}24 h, so 15∘15^\circ15∘ is one hour and 1∘1^\circ1∘ is 444 minutes. The mean solar time of a place is ahead of Greenwich by λ/15\lambda/15λ/15 hours.

The shape of the Earth

A sphere of radius 6371 km6371\ \text{km}6371 km is good enough for many sums. The real Earth is flattened by its spin. Its best-fitting smooth surface is an ellipsoid, a sphere squashed along the axis. The one that GPS uses is WGS84:

QuantityValue
Equatorial radius aaa6378.137 km
Flattening fff1/298.257223563
Polar radius b=a(1−f)b = a(1 - f)b=a(1−f)6356.752 km

The polar radius is 21.4 km21.4\ \text{km}21.4 km shorter than the equatorial radius. That is a flattening of only 0.34 %0.34\ \%0.34 %.

A datum fixes an ellipsoid to the Earth. WGS84 is a global datum, built for the whole Earth. Older national datums, fitted to one country, used other ellipsoids. A coordinate in one datum and a coordinate in another differ for the same spot, by tens to hundreds of metres. Mixing them is a common cause of a layer that sits in the wrong place. A map must say which datum its coordinates use. The code for WGS84 latitude and longitude is EPSG:4326.

Heights have their own trap. The geoid is the surface of the sea at rest, extended under the land. It is a bumpy surface that lies within about 100 m100\ \text{m}100 m of the ellipsoid. A GPS receiver gives the height hhh above the ellipsoid. A height above sea level, HHH, is measured from the geoid. They differ by the geoid height NNN at that place:

H=h−N\displaystyle H = h - NH=h−N

Distances on the globe

On a sphere of radius RRR, the arc between two latitudes that differ by 1∘1^\circ1∘ is 111.19 km111.19\ \text{km}111.19 km for R=6371 kmR = 6371\ \text{km}R=6371 km. A degree of longitude is shorter away from the equator: 111.19cos⁡φ km111.19\cos\varphi\ \text{km}111.19cosφ km. On the real ellipsoid a degree of latitude is 110.57 km110.57\ \text{km}110.57 km at the equator and 111.69 km111.69\ \text{km}111.69 km at the poles.

The shortest path between two places on a sphere is an arc of a great circle, a circle whose centre is the centre of the sphere. If the angle between the two directions from the centre is θ\thetaθ, the distance is d=Rθd = R\thetad=Rθ. The haversine formula gives θ\thetaθ from the coordinates. Work out the two parts aaa and bbb first:

a=sin⁡2φ2−φ12\displaystyle a = \sin^2\dfrac{\varphi_2 - \varphi_1}{2}a=sin22φ2​−φ1​​
b=cos⁡φ1cos⁡φ2sin⁡2λ2−λ12\displaystyle b = \cos\varphi_1\cos\varphi_2\sin^2\dfrac{\lambda_2 - \lambda_1}{2}b=cosφ1​cosφ2​sin22λ2​−λ1​​
θ=2arcsin⁡a+b\displaystyle \theta = 2\arcsin\sqrt{a + b}θ=2arcsina+b​

The initial direction, the bearing clockwise from north, comes from the other formula in the program below. A route that holds the compass bearing steady is a rhumb line. It crosses every meridian at the same angle, and it is longer than the great circle, except along a meridian or the equator.

A chord, the straight line through the Earth between two places, is shorter again: 2Rsin⁡(θ/2)2R\sin(\theta/2)2Rsin(θ/2).

Worked example: Mumbai to Nairobi

Mumbai is at 19.08∘19.08^\circ19.08∘ N, 72.88∘72.88^\circ72.88∘ E. Nairobi is at 1.29∘1.29^\circ1.29∘ S, 36.82∘36.82^\circ36.82∘ E. Find the great-circle distance and the bearing at the start.

  1. The differences. Δφ=−20.37∘\Delta\varphi = -20.37^\circΔφ=−20.37∘ and Δλ=−36.06∘\Delta\lambda = -36.06^\circΔλ=−36.06∘.
  2. The haversine. The formula is h=a+bh = a + bh=a+b.
    • a=sin⁡2(10.185∘)a = \sin^2(10.185^\circ)a=sin2(10.185∘) is 0.03130.03130.0313.
    • cos⁡19.08∘\cos 19.08^\circcos19.08∘ is 0.94510.94510.9451.
    • cos⁡1.29∘\cos 1.29^\circcos1.29∘ is 0.99970.99970.9997.
    • sin⁡2(18.03∘)\sin^2(18.03^\circ)sin2(18.03∘) is 0.09580.09580.0958.
    • So b=0.9451×0.9997×0.0958b = 0.9451 \times 0.9997 \times 0.0958b=0.9451×0.9997×0.0958 is 0.09050.09050.0905.
    • Then h=0.0313+0.0905h = 0.0313 + 0.0905h=0.0313+0.0905, which is 0.12180.12180.1218.
  3. The angle. θ=2arcsin⁡0.1218=40.85∘\theta = 2\arcsin\sqrt{0.1218} = 40.85^\circθ=2arcsin0.1218​=40.85∘.
  4. The distance. d=6371 km×0.7129 rad=4542 kmd = 6371\ \text{km} \times 0.7129\ \text{rad} = 4542\ \text{km}d=6371 km×0.7129 rad=4542 km.
  5. The bearing. The formula gives 244.1∘244.1^\circ244.1∘, a little south of west.
  6. Check. If a student treated degrees as equal lengths, she would get 20.372+36.062×111.19=4605 km\sqrt{20.37^2 + 36.06^2} \times 111.19 = 4605\ \text{km}20.372+36.062​×111.19=4605 km. That is 1.4 %1.4\ \%1.4 % too long, and the error grows far from the equator.

Put the first place at Delhi and the second at Quito, in Ecuador. By how many percent does the degree rule miss? Now put both places on the equator. Does the rule work there?

Practise with new numbers

Try it in Python

The program finds the great-circle distance from Delhi to three other cities and the direction to set out in.

Predict first. Which city is closest to Delhi? Then run it. Check with Show the answer.

1. Add Singapore, at (1.35, 103.82). How far is it?

2. Swap the order of one pair, latitude and longitude, by mistake. What does the distance become?

Common mistakes

  • Treating a degree of longitude as a fixed length. It shrinks with cos⁡φ\cos\varphicosφ.
  • Reading hhh from a GPS as the height above sea level. It is above the ellipsoid. Subtract the geoid height NNN.
  • Mixing the order of latitude and longitude. A GIS wants longitude first.
  • Forgetting that West and South are negative. A positive longitude for Lima puts it in China.

Remember these

  • φ\varphiφ from −90∘-90^\circ−90∘ to 90∘90^\circ90∘, λ\lambdaλ from −180∘-180^\circ−180∘ to 180∘180^\circ180∘. 15∘15^\circ15∘ of longitude is 1 h1\ \text{h}1 h.
  • WGS84: a=6378.137 kma = 6378.137\ \text{km}a=6378.137 km, 1/f=298.2572235631/f = 298.2572235631/f=298.257223563, b=6356.752 kmb = 6356.752\ \text{km}b=6356.752 km.
  • H=h−NH = h - NH=h−N. A datum must be named.
  • Great circle: haversine, d=Rθd = R\thetad=Rθ. One degree of latitude is about 111.2 km111.2\ \text{km}111.2 km, and of longitude 111.2cos⁡φ km111.2\cos\varphi\ \text{km}111.2cosφ km.

Check yourself

Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.

  1. How long is one degree of longitude at latitude 60∘60^\circ60∘?
  1. A GPS gives an ellipsoid height of 245 m245\ \text{m}245 m at a place where the geoid height is −31 m-31\ \text{m}−31 m. What is the height above sea level?
  1. Why is a great circle shorter than the line of constant compass bearing between two places at the same latitude?
  1. A coordinate pair from a GIS reads (77.2,28.6)(77.2, 28.6)(77.2,28.6). Which is the longitude?

References

  • J. P. Snyder, Map Projections: A Working Manual (USGS Professional Paper 1395, 1987), Chapter 3 Map Projection Properties, and the formulas for the sphere.
  • P. A. Longley, M. F. Goodchild, D. J. Maguire and D. W. Rhind, Geographic Information Science and Systems (4th edition, Wiley, 2015), Chapter 4 Georeferencing.

Enroll free in GIS: Coordinates, Projections and Map Layers

Every lesson is open to read. Enrolling also lets you:

  • Mark lessons done and carry on where you stopped.
  • Take the tests of this lesson and its course.
  • Count the course towards the certificate for its chapter.
No payment. You can leave at any time.

Problems (3)

Treat the Earth as a sphere of radius 6371 km…Hard · High School (11–12) · by StemPy Lab
The WGS84 ellipsoid has the equatorial radius a = 6378.137 km and the eccentricity squared e² =…Advanced · High School (11–12) · by StemPy Lab
A town is at 26.2° N, 91.75° E. The clocks of its country keep the time of the meridian at 82.5° E…Hard · High School (11–12) · by StemPy Lab
Next: lesson 2Map projections and grids
← GIS: Coordinates, Projections and Map Layers
← PreviousMap projections and grids →

Discussion (0)

Log in to join the discussion.

Loading…

1 Python program
5 questions to check yourself

This lesson is free to read. Enroll free to keep your place and take the tests.

Python Labs (1)

Degrees, distances and zonesPython Lab · by StemPy Lab