Skip to content

Commit

Permalink
rename GPS fields
Browse files Browse the repository at this point in the history
  • Loading branch information
ptpt committed Jan 13, 2025
1 parent f065471 commit 1b2b70a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
8 changes: 4 additions & 4 deletions mapillary_tools/exiftool_read_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ def _aggregate_float_values_same_length(
lat=lat,
alt=alt,
angle=direction,
gps_fix=None,
gps_precision=None,
gps_ground_speed=ground_speed,
fix=None,
precision=None,
ground_speed=ground_speed,
)
)

Expand Down Expand Up @@ -281,7 +281,7 @@ def _aggregate_gps_track_by_sample_time(
for idx, point in enumerate(points):
point.time = sample_time + idx * avg_timedelta
track.extend(
dataclasses.replace(point, gps_fix=gps_fix, gps_precision=gps_precision)
dataclasses.replace(point, fix=gps_fix, precision=gps_precision)
for point in points
)

Expand Down
8 changes: 3 additions & 5 deletions mapillary_tools/geotag/gpmf_gps_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ def remove_outliers(
"Split to %d sequences with max distance %f", len(sequences), max_distance
)

ground_speeds = [
p.gps_ground_speed for p in sequence if p.gps_ground_speed is not None
]
ground_speeds = [p.ground_speed for p in sequence if p.ground_speed is not None]
if len(ground_speeds) < 2:
return sequence

Expand All @@ -64,7 +62,7 @@ def remove_noisy_points(
p
for p in sequence
# include points **without** GPS fix
if p.gps_fix is None or p.gps_fix.value in constants.GOPRO_GPS_FIXES
if p.fix is None or p.fix.value in constants.GOPRO_GPS_FIXES
]
if len(sequence) < num_points:
LOG.debug(
Expand All @@ -78,7 +76,7 @@ def remove_noisy_points(
p
for p in sequence
# include points **without** precision
if p.gps_precision is None or p.gps_precision <= constants.GOPRO_MAX_DOP100
if p.precision is None or p.precision <= constants.GOPRO_MAX_DOP100
]
if len(sequence) < num_points:
LOG.debug(
Expand Down
12 changes: 6 additions & 6 deletions mapillary_tools/geotag/gpmf_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ def gps5_from_stream(
lat=lat,
lon=lon,
alt=alt,
gps_fix=gpsf_value,
gps_precision=gpsp_value,
gps_ground_speed=ground_speed,
fix=gpsf_value,
precision=gpsp_value,
ground_speed=ground_speed,
angle=None,
)

Expand Down Expand Up @@ -271,9 +271,9 @@ def gps9_from_stream(
lat=lat,
lon=lon,
alt=alt,
gps_fix=GPSFix(gps_fix),
gps_precision=dop * 100,
gps_ground_speed=speed_2d,
fix=GPSFix(gps_fix),
precision=dop * 100,
ground_speed=speed_2d,
angle=None,
)

Expand Down
2 changes: 1 addition & 1 deletion tests/cli/gpmf_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import gpxpy
import gpxpy.gpx
import mapillary_tools.geo as geo
import mapillary_tools.telemetry as telemetry

import mapillary_tools.geotag.gpmf_parser as gpmf_parser
import mapillary_tools.geotag.gps_filter as gps_filter
import mapillary_tools.telemetry as telemetry
import mapillary_tools.utils as utils
from mapillary_tools.mp4 import mp4_sample_parser

Expand Down

0 comments on commit 1b2b70a

Please sign in to comment.