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
  1. Python Labs
  2. /Degrees, distances and zones
Earth and Environmental ScienceHardHigh School (11–12)Remote Sensing, GIS and Earth Data

Degrees, distances and zones

A survey crew writes its positions as degrees, minutes and seconds with a letter for the hemisphere. The GIS wants signed decimal degrees. In this lab you convert them, measure a great-circle distance, and find the UTM zone of a point.

The idea. D=d+m/60+s/3600D = d + m/60 + s/3600D=d+m/60+s/3600, with a minus sign for S and W. The haversine formula gives the distance on a sphere of radius 6371 km6371\ \text{km}6371 km. The UTM zone number is ⌊(λ+180)/6⌋+1\lfloor(\lambda + 180)/6\rfloor + 1⌊(λ+180)/6⌋+1.

Your tasks.

  1. In dms_to_decimal, return the signed decimal degrees for a degrees, minutes, seconds and hemisphere letter.
  2. In distance_km, return the great-circle distance between two points given in decimal degrees.
  3. In utm_zone, return the UTM zone number of a longitude in decimal degrees.

Run it first, just as it is. The checker at the end prints FAIL for each task. Then do the tasks one at a time, and run the program again after each one. A Hint appears under every check that still fails.

When every line says PASS, find the zone of your own town, and the distance from it to a city on another continent.

StemPy LabContributed by StemPy Lab
python
Loading Python runtime…

A worked solution

Run your code once to unlock the worked solution.

Have you tried it?

Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.

Log in to save
← All Labs
← How often does the satellite pass?A raster calculation: slope and flooding →
More onRemote Sensing, GIS and Earth Data

Discussion (0)

Log in to join the discussion.

Loading…

Learn it in

  1. Latitude, longitude and the shape of the EarthGIS: Coordinates, Projections and Map Layers

More labs on this topic

  1. Anomalies, a running mean and a trendHard
  2. A carbon dioxide record: trend and cycleHard
  3. A raster calculation: slope and floodingHard
  4. How often does the satellite pass?Hard
  • From digital numbers to a map of greenHard
  • All labs on this topic →