Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8795241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:21:38+00:00 2026-06-13T23:21:38+00:00

I need to make a check in my application that determines whether the given

  • 0

I need to make a check in my application that determines whether the given coordinates lie on road or not in Google Maps.

Is there any function in Google Maps API that can aid me with that?

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:21:39+00:00Added an answer on June 13, 2026 at 11:21 pm

    As far as I know this can’t be done using the Google Maps API.

    I think your best bet is to use a crowd-sourced dataset such as OpenStreetMap (OSM).

    You’d need to set up your own spatial database (e.g., PostGIS) and import OSM data into the database.

    Then, you’d create a server-side API (hosted in a web server such as Tomcat or Glassfish) to receive the mobile phone’s current location, buffer the location with a certain radius to give you a circular polygon, and do a spatial query via PostGIS to determine if the buffer intersects any roads (e.g., ways with labels of “highway=primary” or “highway=secondary”, depending on what road types you want to include – see this site), and return the true or false response to the phone.

    EDIT Aug 2015

    There is now a method in the android-maps-utils library called PolyUtil.isLocationOnPath() that would allow you to do this type of calculation within your Android app itself, assuming you have the set of points that make up the road (or any other line).

    Here’s what the code looks like in the library:

       /**
         * Computes whether the given point lies on or near a polyline, within a specified
         * tolerance in meters. The polyline is composed of great circle segments if geodesic
         * is true, and of Rhumb segments otherwise. The polyline is not closed -- the closing
         * segment between the first point and the last point is not included.
         */
        public static boolean isLocationOnPath(LatLng point, List<LatLng> polyline,
                                               boolean geodesic, double tolerance) {
            return isLocationOnEdgeOrPath(point, polyline, false, geodesic, tolerance);
        }
    

    To use this library, you’ll need to add the library to your build.gradle:

    dependencies {
        compile 'com.google.maps.android:android-maps-utils:0.4+'
    }
    

    Then, when you have your point and your path, you’d need to convert your lat/longs to LatLng objects (specifically, a LatLng point and List<LatLng> line, respectively), and then in your code call:

    double tolerance = 10; // meters
    boolean isLocationOnPath = PolyUtil.isLocationOnPath(point, line, true, tolerance);
    

    …to see if your point is within 10 meters of your line.

    See the Getting Started Guide for this library for more info on how to use it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to make a console application that uses Kinect, with Kinect SDK and
I need to make something(i call it a scheduler) that checks the time of
I have an Eclipse RCP application that I'd like to make available to end
I need to make sure that the connection to a POS printer is successful
I have a mission critical Perl-CGI server-side application that I need to extend or
Here's the deal. I'm trying to make a chat-like application that works with MySQL.
I have an application that I need to automate where at a certain time
I need to create a web application that prints checks. Because of the nature
I need to be able to make an event such that every time a
Possible Duplicate: How can I make my application check if Adobe flash player is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.