summaryrefslogtreecommitdiffstats
path: root/gps.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-31 14:09:16 +1100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-31 14:29:02 +1100
commit635c28923d28335bb7d39f95c17c2edbf16ee2ac (patch)
tree0ae1566c791a505cd8233928c0258629057e83c9 /gps.c
parent8843ee61560fb3c6a66b7ae9f10367f57eddb109 (diff)
downloadsubsurface-635c28923d28335bb7d39f95c17c2edbf16ee2ac.tar.gz
Better algorithm to merge gps locations & locations names from webservice
This no longer abuses the dive merging code (which would leave stray "dives" behind if a gps fix couldn't be merged with any of the dives) and instead parses the gps fixes into a second table and then walks that table and tries to find matching dives. The code tries to be reasonably smart about this. If we have auto-generated GPS fixes at regular intervals, we look for a fix that is during a dive (that's likely when the boat where the phone is staying dry is more or less above the diver having fun). And if we have named entries (so the user typed in a location name) we try to match them in order to the dives that happened "that day" (where "that day" is about 6h before and after the timestamp of the gps fix). This commit also renames dive_has_location() to dive_has_gps_location() as the difference between if(!dive->location) and if(dives_has_location) is a bit too subtle... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'gps.c')
-rw-r--r--gps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gps.c b/gps.c
index 31be2bbc5..15ee65830 100644
--- a/gps.c
+++ b/gps.c
@@ -242,7 +242,7 @@ void show_gps_locations()
map = init_map();
for_each_dive(idx, dive) {
- if (dive_has_location(dive)) {
+ if (dive_has_gps_location(dive)) {
add_gps_point(map, dive->latitude.udeg / 1000000.0,
dive->longitude.udeg / 1000000.0);
}