The spherical distortion of the map is unlikely the cause, the conversion from WGS 84 GPS coordinates to Spherical Mercator has a small amount of error. Here are the most likely causes of error:
- GPS accuracy, this is usually the main cause as GPS devices typically have an error of +/- 15 to 30 meters.
- Position of the roads in the maps. Maps show roads as a line, but in reality, roads have widths. Azure Maps and Open Street Maps can show the same road in two different places and technically both be correct as the lines would be within the width of the roadway.
Generally, GPS coordinates will rarely show up exactly on a road unless using a specialized high precision GPS device. This is why "Snap to Road" type services exist. Snap to road is the process of calculating the nearest road line to a given coordinate (GPS point). There are a few different ways to do this depending on your needs.
If you want to keep the snapped information in a database for future use (i.e. as a replacement for the GPS coordinate), then you would likely want to snap the coordinate on the server side using a REST service. The Azure Maps routing service can be used for this. Note that calling this service generates costs. Here are some examples:
https://azuremapscodesamples.azurewebsites.net/?sample=Snap%20drawn%20line%20to%20roads
https://azuremapscodesamples.azurewebsites.net/?sample=Snap%20points%20to%20logical%20route%20path
If you only want to snap the GPS coordinate to roads when visualizing the data, and you are using the Azure Maps Web SDK, you can leverage the underlying vector tiles to do this snapping at no additional cost.
https://azuremapscodesamples.azurewebsites.net/?sample=Basic%20snap%20to%20road%20logic