Note that there are some explanatory texts on larger screens.

plurals
  1. POPython, numpy, scipy: How to exclude a location error from GPS coordinates? (averaging lon, lat)
    primarykey
    data
    text
    <p>I use Python: </p> <p>I have 2 arrays of GPS points - lon and lat (more than 500 000 points).</p> <p>I have 1 array of date-time.</p> <pre><code>lon = numpy.array(lon) lat = numpy.array(lat) dt = numpy.array(dt) </code></pre> <p>I have a location error (GPS sensor error). For example 15 meters.</p> <pre><code>GPS_sensor_error = 0.015 </code></pre> <p><strong>I need to exclude a GPS_sensor_error from coordinates</strong> that there were no asterisks on a track. </p> <p><img src="https://i.stack.imgur.com/HZYXQ.gif" alt="enter image description here"></p> <p>(I don't draw a point with identical coordinates)</p> <p><img src="https://i.stack.imgur.com/moWKI.gif" alt="enter image description here"></p> <p><strong>How I am able to do it?</strong></p> <p>Now:</p> <ol> <li><p>I calculate distance between points. </p></li> <li><p>I find the minimum distance, if it less GPS_sensor_error, then I average lon, lat. </p></li> <li><p>repeat 1.</p></li> <li><p>repeat 2.</p></li> <li><p>repeat until all distances won't be more GPS_sensor_error</p></li> </ol> <p><strong>Update:</strong></p> <pre><code> lon = numpy.array() lat = numpy.array() flag = True while flag: lon1 = lon[:-1] lon2 = lon[1:] lat1 = lat[:-1] lat2 = lat[1:] '''distance''' x = (lon2 - lon1) y = (lat2 - lat1) d = numpy.sqrt(x * x + y * y) min = numpy.min(d) if min &lt; GPS_sensor_error: j = numpy.where(d == min)[0][0] lon[j] = (lon[j] + lon[j + 1]) / 2 lat[j] = (lat[j] + lat[j + 1]) / 2 lon = numpy.delete(lon, j + 1) lat = numpy.delete(lat, j + 1) else: flag = False </code></pre> <p>Bypass on all points works at a pure python very long... <strong>Prompt please, how to implement it using scipy, numpy?</strong></p> <p><br>Thanks</p> <p><strong>P.s. probably already there is a GPS filter in scipy, numpy?</strong></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload