I have a lat-lng of a location. I want to create a geofence (min radius) around that lat-lng such that the radius of geofence should be just big enough to the nearest road. Say for ex: I am inside a huge apartment. From my current location (inside apartment) the nearest road is at around 60 ft. so now I want to set geofence with radius of 70 ft. how can I get distance from given location to the nearest road?
Asked
Active
Viewed 90 times
0
-
You will probably need the directions service to find a location on the nearest road. What does your existing code look like? What language/OS? – geocodezip Nov 07 '21 at 15:24
-
I want to write in java. but i have not written anything as of now. – Keerthi Prasad Nov 08 '21 at 06:26
-
possible duplicate of [Maps API - Marker on the street](https://stackoverflow.com/questions/35989949/maps-api-marker-on-the-street) – geocodezip Nov 08 '21 at 13:11
-
possible duplicate of [Google maps api - snap marker to nearest road](https://stackoverflow.com/questions/16696502/google-maps-api-snap-marker-to-nearest-road) – geocodezip Nov 08 '21 at 13:11
-
thanks for input. but i want execute code finding the nearest road to a lat-lng at server (backend) which is running java code. – Keerthi Prasad Nov 08 '21 at 14:27
-
Use the same idea, just code it in java, using the web services. – geocodezip Nov 08 '21 at 16:44
-
Please provide enough code so others can better understand or reproduce the problem. – Community Nov 10 '21 at 09:32