I have this:
public class LatLon
{
public double lat {get;set;}
public double lon {get;set;}
}
in a List<LatLon>
. It contains of
p1 { lat = 49.9429989, lon = 3.9542134 }
p2 { lat = 49.9429989, lon = 3.9542133 }
p3 { lat = 49.9429989, lon = 3.9542136 }
etc..
My goal is to remove coordinates from this list whose difference to other coordinates is lower than the boundaries of lat_bound and lon_bound, so even though the person recording stood at a place for a long time, it means there is only one coordinate left. What would be the LINQ command?
Example:
p1 { lat = 4.555, lon = 6.555 }
p2 { lat = 4.556, lon = 6.556 }
.
Then Math.Abs(p1.lat - p2.lat) = 0.001
and Math.Abs(p1.lon - p2.lon) = 0.001
. p1.lon - p2.lon
is the lon difference to one other coordinate's lon-value. Let's say lon_bound
equals 0.0005 then this very coordinate is being removed if lat_bound
is also 0.0005, as 0.001 > 0.0005.
EDIT: I decided to pipe to http://www.gpsbabel.org instead.