Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Geocoder doesn't detect highways / interstates?

I'm using getThoroughwayfare() to get street names but when on a highway / interstate the method returns null. I couldn't find another method that could detect interstates. Has anyone been able to successfully detected interstates?

Thanks

like image 500
user1347026 Avatar asked May 20 '26 15:05

user1347026


1 Answers

Ok, Its quite old question, but i think i answer for somebody else.

I too need to get information whether i was on interstate or not and Geocoder was of no help. So i came across Google geocode api which gives plenty of information.

e.g

LatLng: 39.249121,-122.182131

And Url would be:

https://maps.googleapis.com/maps/api/geocode/json?latlng=39.249121,-122.182131&sensor=false

sensor is true in case you sending from mobile and false if using browser.

Now you can open the link and check the detailed reply for yourself, in those json objects, you will get a type = route and you will get I-5 as the short_name of road you are on.

like image 98
Farhan Avatar answered May 23 '26 19:05

Farhan