Replace the wrong GPS Coordinate recorded
2 visualizzazioni (ultimi 30 giorni)
Jaynik il 6 Ott 2023
I understand that you want to replace the gps coordinates to the nearest one on a road. I assume that you have the road data in the form of coordinates. For a given latitude and longitude, you can obtain the nearest coordinates with the help of the "knnsearch" function from the "Statistics and Machine Learning Toolbox".
% roadPoints is the coordinates of roads & gpsCoordinate is the inaccurate GPS coordinate input
nearestIdx = knnsearch(roadPoints, gpsCoordinate);
matchedCoordinate = roadPoints(nearestIdx, :);
Refer the following link to learn more about "knnsearch":
Hope this helps!