Bird
Raised Fist0
Drone Programmingprogramming~20 mins

Surveying and mapping with photogrammetry in Drone Programming - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Photogrammetry Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate
2:00remaining
Calculate Ground Sampling Distance (GSD)

What is the output of this code that calculates the Ground Sampling Distance (GSD) in centimeters?

Drone Programming
def calculate_gsd(sensor_width_mm, image_width_px, flight_height_m, focal_length_mm):
    # GSD formula: (sensor_width * flight_height * 100) / (focal_length * image_width)
    return (sensor_width_mm * flight_height_m * 100) / (focal_length_mm * image_width_px)

sensor_width = 36  # mm
image_width = 6000  # pixels
flight_height = 120  # meters
focal_length = 50  # mm

gsd = calculate_gsd(sensor_width, image_width, flight_height, focal_length)
print(round(gsd, 2))
A14.4
B1.44
C0.144
D144.0
Attempts:
2 left
💡 Hint

Remember to convert flight height to centimeters by multiplying by 100.

🧠 Conceptual
intermediate
1:30remaining
Understanding Overlap in Photogrammetry Flights

Which option correctly describes the purpose of frontlap and sidelap in drone photogrammetry flights?

AThey ensure images overlap enough to create 3D models and avoid gaps in data.
BThey reduce the flight time by minimizing the number of images taken.
CThey control the drone's altitude to maintain a constant speed.
DThey adjust the camera's focus to improve image sharpness.
Attempts:
2 left
💡 Hint

Think about why multiple images need to cover the same ground area.

🔧 Debug
advanced
2:00remaining
Fix the Flight Path Calculation Bug

What error does this code raise when calculating the number of flight lines needed for a survey?

Drone Programming
def calculate_flight_lines(area_width_m, swath_width_m):
    # Calculate number of flight lines needed
    lines = area_width_m / swath_width_m
    return int(lines)

area_width = 250
swath_width = 60

print(calculate_flight_lines(area_width, swath_width))
ARaises a TypeError
BRaises a ZeroDivisionError
CReturns 5 correctly
DReturns 4, but should be 5 to cover entire area
Attempts:
2 left
💡 Hint

Check how integer division truncates decimals.

📝 Syntax
advanced
1:30remaining
Identify the Syntax Error in Image Geotagging Code

Which option contains the syntax error in this snippet that assigns GPS coordinates to images?

Drone Programming
images = ['img1.jpg', 'img2.jpg', 'img3.jpg']
gps_coords = [(40.7128, -74.0060), (40.7130, -74.0055), (40.7132, -74.0050)]

for i in range(len(images)):
    print(f"Assigning {gps_coords[i]} to {images[i]}")
AMissing colon after for loop declaration
BIncorrect variable name gps_coords misspelled as gps_coord
CUsing parentheses instead of square brackets for list indexing
DMissing quotation marks around image filenames
Attempts:
2 left
💡 Hint

Check the syntax of the for loop line.

🚀 Application
expert
3:00remaining
Determine the Number of Images for Full Coverage

A drone camera has a sensor width of 24 mm and takes images 4000 pixels wide. The flight height is 100 meters, and the focal length is 35 mm. The survey area is 500 meters wide. The swath width is calculated using the formula: swath_width = (sensor_width * flight_height) / focal_length. If the sidelap is 70%, how many images are needed along the width to cover the area fully?

Choose the correct number of images.

A20
B30
C25
D35
Attempts:
2 left
💡 Hint

Calculate swath width first, then adjust for sidelap, then divide area width by effective swath width and round up.

Practice

(1/5)
1. What is the main purpose of using photogrammetry in drone surveying?
easy
A. To create maps and 3D models from overlapping photos
B. To control the drone's battery life
C. To improve the drone's flight speed
D. To reduce the number of photos taken

Solution

  1. Step 1: Understand photogrammetry basics

    Photogrammetry uses many overlapping photos to build maps and 3D models.
  2. Step 2: Identify the main goal in drone surveying

    The goal is to create accurate maps and 3D models from the photos taken by the drone.
  3. Final Answer:

    To create maps and 3D models from overlapping photos -> Option A
  4. Quick Check:

    Photogrammetry = maps and 3D models [OK]
Hint: Photogrammetry means building maps from photos [OK]
Common Mistakes:
  • Confusing photogrammetry with drone battery management
  • Thinking photogrammetry speeds up flight
  • Assuming photogrammetry reduces photo count
2. Which of the following is the correct syntax to define a flight path list in Python for drone photogrammetry?
easy
A. flight_path = {"point1", "point2", "point3"}
B. flight_path = ("point1", "point2", "point3")
C. flight_path = ["point1", "point2", "point3"]
D. flight_path = "point1", "point2", "point3"

Solution

  1. Step 1: Identify list syntax in Python

    Lists use square brackets [] with items separated by commas.
  2. Step 2: Check each option

    flight_path = ["point1", "point2", "point3"] uses square brackets and quotes correctly for strings.
  3. Final Answer:

    flight_path = ["point1", "point2", "point3"] -> Option C
  4. Quick Check:

    List syntax = square brackets [OK]
Hint: Lists use square brackets [] in Python [OK]
Common Mistakes:
  • Using parentheses instead of square brackets for lists
  • Using curly braces which create sets, not lists
  • Leaving out brackets and just separating by commas
3. What will be the output of this Python code snippet used in photogrammetry data processing?
photos = ["img1.jpg", "img2.jpg", "img3.jpg"]
processed = [photo.replace('.jpg', '.tif') for photo in photos]
print(processed)
medium
A. ["img1.tif", "img2.tif", "img3.tif"]
B. ["img1.jpg", "img2.jpg", "img3.jpg"]
C. ["img1.tif.jpg", "img2.tif.jpg", "img3.tif.jpg"]
D. SyntaxError

Solution

  1. Step 1: Understand list comprehension with string replace

    Each photo filename has '.jpg' replaced by '.tif'.
  2. Step 2: Apply replace to each item

    "img1.jpg" becomes "img1.tif", similarly for others.
  3. Final Answer:

    ["img1.tif", "img2.tif", "img3.tif"] -> Option A
  4. Quick Check:

    Replace '.jpg' with '.tif' = changed list [OK]
Hint: String replace in list comprehension changes extensions [OK]
Common Mistakes:
  • Expecting original list without changes
  • Thinking replace adds text instead of replacing
  • Confusing syntax causing errors
4. Identify the error in this Python code snippet for planning drone photo overlap:
overlap = 0.7
if overlap > 1:
    print("Overlap too high")
else
    print("Overlap acceptable")
medium
A. Incorrect comparison operator in if statement
B. Missing colon after else statement
C. Variable overlap should be an integer
D. Print statements must be outside if-else

Solution

  1. Step 1: Check syntax of if-else statements

    Python requires a colon ':' after else keyword.
  2. Step 2: Identify missing colon

    Code has 'else' without a colon, causing syntax error.
  3. Final Answer:

    Missing colon after else statement -> Option B
  4. Quick Check:

    else: needs colon [OK]
Hint: Always put colon after else in Python [OK]
Common Mistakes:
  • Forgetting colon after else
  • Thinking overlap must be integer
  • Misreading comparison operator
5. You want to generate a dictionary mapping photo filenames to their GPS coordinates after a drone flight. Which Python code correctly creates this dictionary from two lists: photos = ["img1.jpg", "img2.jpg", "img3.jpg"] and coords = [(34.5, -117.2), (34.6, -117.3), (34.7, -117.4)]?
hard
A. photo_coords = [photos, coords]
B. photo_coords = dict(zip(coords, photos))
C. photo_coords = {coords[i]: photos[i] for i in range(len(coords))}
D. photo_coords = {photos[i]: coords[i] for i in range(len(photos))}

Solution

  1. Step 1: Understand dictionary creation from two lists

    We want keys as photo names and values as coordinates.
  2. Step 2: Check each option

    photo_coords = {photos[i]: coords[i] for i in range(len(photos))} uses dictionary comprehension with matching indexes correctly.
  3. Final Answer:

    photo_coords = {photos[i]: coords[i] for i in range(len(photos))} -> Option D
  4. Quick Check:

    Dict keys=photos, values=coords [OK]
Hint: Use dict comprehension with index to pair lists [OK]
Common Mistakes:
  • Swapping keys and values in dict
  • Using zip with wrong order
  • Creating list instead of dict
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard