Closed MBARIMike closed 2 years ago
Jupyter Notebook that adds up all the MBARI Mission track_lengths:
https://github.com/mbari-org/SeafloorMappingDB/blob/main/smdb/notebooks/1.0-mpm-track_lengths.ipynb
It turns out that this simplistic method of computing length:
# Convert to web mercator and get length in km
# https://gis.stackexchange.com/a/181251/62207
nav_track_wm = nav_track
nav_track_wm.transform(3857)
track_length = round(nav_track_wm.length / 1000.0, 4)
works only at the equator and will give erroneously large values away from the equator, hence the PR above.
The track length metadata is available via the .inf files in the Mission directories. https://github.com/mbari-org/SeafloorMappingDB/pull/164 adds up these track lengths and compares them to the one computed with haversine() on the simplified LineString geometry. We'd expect the latter to be slightly less than former as the simplify() process removes wide turns and jaggies in the actual track. In fact, the haversine() computed track length is generally around 97% of the .inf file summed track lengths. This special log file has all the details: https://901101-smdb-media.s3.amazonaws.com/media/logs/dist_sums.txt
Changing haversine() to .inf file values increased slightly the total track_length in the Notebook from 26672.7 to 27079.9.
Closing this.
Per a request to have simple to generate reports of distance traversed by seafloor surveys add a nav_track_length field to the Mission table and calculate the length in meters during the load using a method similar to what's outlined here:
https://gis.stackexchange.com/a/181251/62207