0

I was trying to draw a poly line on the road but it gets deviate from the road and the poly line draws over the building near by the road.After a long search I got this link ("snap to road").where I need to send the set of latitude and longitude with pipe line separator along with the road api and it will return the accurate lat long which near to the road points.But I just want to draw on live which mean every single lat long should be accurate.

  HashMap<String, String> map = new HashMap<String, String>();
  map.put(Constants.URL,"https://roads.googleapis.com/v1/snapToRoads?path="
      +d + "," +e+"&key=API KEY");

What I did is I'll call the road api whenever the lat long get changes on my android mobile so it will return the accurate lat long to me but there is a limitation in google that I can only request the api up to 2500/day requests. So is there any alternate way to achieve my requirement?.

Community
  • 1
  • 1
Asif Sb
  • 785
  • 9
  • 38
  • SnapToRoad simply find the nearest road coordinates and return. Is this what you need? What are you trying to achieve? – Muhammad Babar Dec 23 '15 at 06:49
  • yes it returns me the nearest road co ordinates..it is working perfect my question ,is there any way to get the perfect co ordinates without calling the road api,why google is not giving the perfect co ordinates internally?like any specific jar or any lib? – Asif Sb Dec 23 '15 at 08:27
  • Could you please specify what are you exactly trying to achieve? – Muhammad Babar Dec 23 '15 at 10:23
  • ya sure...I am getting latitude and longitude from location manager which is not accurate so my poly line went off from the road.Now my poly lines are perfect when i pass the current lat long to the snap to road api which returns the perfect road co-ordinates and then I will draw poly line accordingly.Here I don't want to call the road api to get the perfect co ordinates.Is there any alternate solution to achieve nearest road co-ordinates? – Asif Sb Dec 23 '15 at 11:03
  • Does your location manager getting location fix from GPS only? – Muhammad Babar Dec 23 '15 at 12:50
  • yes..poly line are not perfectly drawn.. – Asif Sb Dec 23 '15 at 12:52
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/98813/discussion-between-muhammad-babar-and-asif-sb). – Muhammad Babar Dec 23 '15 at 12:54

1 Answers1

1

This might help you, I wrote an extensive answer for someone who had the similar issue with. Check it out, hope it would help you too

https://stackoverflow.com/a/11357351/975959

Community
  • 1
  • 1
La bla bla
  • 8,558
  • 13
  • 60
  • 109
  • I think your url is almost close to my requirement..but my question there is no api required to call to get the nearest road co-ordinates? – Asif Sb Dec 23 '15 at 09:46