This is the fifth part of an 8 part series called ‘User Journey on an On-Demand Business Platform’
Every on-demand platform needs integrated location based services in order to determine service locations, customer locations, track service providers and help them navigate from their location to service location. Many Google Maps APIs are used along with the Google Maps SDK for iOS apps or the Android API to build location relevant apps. We commonly use following APIs in building location based functionalities.
Purpose – Accurate determination of locations and user friendly presentation of geographical information.
- Converts an address into geographic coordinates (geocoding i.e. latitude/longitude lookup)
- Converts geographic coordinates into a human-readable address (reverse geocoding i.e. address lookup)
- Finds address for a given place ID, i.e. a unique identifier of a place on Google Maps.
User’s coordinates (latitude/longitude) are determined by user’s phone GPS. Reverse Geocoding is an extension of Google Maps Geocoding API that matches these coordinates in a database of geospatial information and returns user’s physical address on the map.
Caveat – Google API returns the nearest address available in its database corresponding to input coordinates. Hence in some cases, the address returned might not be user’s exact location but a location close-by. However in USA, European countries and other places where the back end data is generally good, such issues are rarely seen.
Purpose – Retrieve information (including name, address, type of location, phone number, reviews, website link and more) about places.
- Returns information about Places — defined within this API as establishments, geographic locations, or prominent points of interest.
- Place finder with Autocomplete – Assist users by automatically completing the name and address of a place as they type. The country, city or distance (in meters) or the radius – within which place-results will be returned – can be set in order to only return results from your application’s service area.
- Simple implementation of a Place Picker – A Place picker UI widget on the app, so users can choose from a set of nearby places displayed on a map.
This API provides access to information of about more than 100 million places around the world.
Place API requests specify locations as latitude/longitude coordinates. Geocoding API returns the physical address (like a string) corresponding to a set of geographical coordinates. Place API identifies and breaks this address string down to different components of the Address in its response JSON, such as –
– Street Number
– Administrative Area Levels i.e. city, state etc
– Post Code etc.
Your application will be able to extract required fields from the response.
The Google Places API for iOS is packaged with the Google Maps SDK for iOS.
Purpose – Navigation. Calculates directions and outputs detailed route information between locations using an HTTP request. The API has the ability to return information corresponding to multiple routes between two points such as shortest route, fastest route etc. The functionality to deliver a particular type of route output (example – fastest route) can be built into application logic by setting required parameters in API queries.
- Can be used to find directions for several modes of transportation – including transit, driving, walking or cycling.
- Directions may specify origins, destinations and waypoints either as text strings (e.g. “Chicago, IL” or “Darwin, NT, Australia”) or as latitude/longitude coordinates
Note: We can provide a work-around by creating a deep-link from your app to Google Maps App and that can be used to obtain turn by turn directions.
Purpose – Tracking. Computes travel distance and time (ETA) between a number of points using the Google Maps API. Takes into account traffic information while calculating the ETA.
- Provides travel distance and time for a matrix of origins and destinations.
- The information returned is based on the recommended route between start and end points, as calculated by the Google Maps API.
- For the calculation of distances, one may specify the transportation mode to use such as Driving (default), Walking, Bicycling, Transit (via public transit routes).
Note: For use cases, where we need displacement (straight line distance) between two points, required calculation is done within the app using coordinates of the two points and a call to Distance Matrix API is NOT made.
Purpose – Define geographical boundaries to mark service areas.
A library of Google Maps called Geometry Library can be used to draw a polygon on the map and it returns coordinates (latitude/longitude) of points on the polygon to mark a geographical area. This can be used for multiple purposes within the app such as:
- Find out whether an address lies within the service area of the application
- In case application logic requires to choose which service center will serve requests coming from a particular location
- Define service areas of different service providers
As per latest update from Google (effective September 2015), anyone using Google Maps Geocoding API, Directions API or Distance Matrix API, gets 2,500 free requests per API per day and beyond that, they are charged $0.50 USD per 1,000 additional requests up to 100,000 requests per API per day. If you have larger requirements, then you need to contact Google Maps team for a license.
Google Places API serves 1,000 free requests per day and that can be increased to 150,000 free requests per day after credit card validation. For more that 150,000 requests in a day, app owner will need to contact Google for a quota uplift.
All Google Maps API applications require authentication using an API key for the purpose of quota management. Including a key in your request also allows you to monitor your application’s API usage in the Google Developers Console; enables per-key instead of per-IP-address quota limits; and ensures that Google can contact you about your application if necessary.
The results returned by these APIs are in JSON format.
Get in Touch with us if you are looking to create the next big disruption with your on-demand business idea! We have got your tech covered. no worries. To know more about Juggernaut, go to the homepage .