Module google_maps::roads

source ·
Expand description

Roads API - Identify the roads a vehicle is traveling along, and get metadata about those roads.

§Overview

  • Before you begin: Before you start using the Places API, you need a project with a billing account and the Places API enabled. We recommend creating multiple Project Owners and Billing Administrators, so that you’ll always have someone with these roles available to your team. To learn more, see Set up in Cloud Console.

The Roads API identifies the roads a vehicle was traveling along and provides additional metadata about those roads, such as speed limits.

Before you start developing with the Roads API, review the authentication requirements (you need an API key) and the API usage and billing information.

§Introduction

Watch this video for some examples of the kinds of apps that will find the Roads API useful.

The Roads API allows you to map GPS coordinates to the geometry of the road, and to determine the speed limit along those road segments. The API is available via a simple HTTPS interface, and exposes the following services:

  • Snap to roads This service returns the best-fit road geometry for a given set of GPS coordinates. This service takes up to 100 GPS points collected along a route, and returns a similar set of data with the points snapped to the most likely roads the vehicle was traveling along. Optionally, you can request that the points be interpolated, resulting in a path that smoothly follows the geometry of the road.

  • Nearest roads This service returns individual road segments for a given set of GPS coordinates. This services takes up to 100 GPS points and returns the closest road segment for each point. The points passed do not need to be part of a continuous path.

  • Speed limits (Not yet implemented in this client.) This service returns the posted speed limit for a road segment. The Speed Limit service is available to all customers with an Asset Tracking license. For Google Maps Platform Premium Plan customers who transitioned to pay-as-you-go pricing, the feature remains active.

§Client library

The Roads API is available with the Java Client, Python Client, Go Client and Node.js Client for Google Maps Services. Client libraries make developing with the Roads API easier by providing simple, native implementations of common tasks, such as authentication, request throttling and automatic retry.

Re-exports§

  • pub use crate::roads::error::Error as RoadsError;
  • pub use crate::roads::error_response::ErrorResponse as RoadsErrorResponse;
  • pub use crate::roads::snapped_point::SnappedPoint;
  • pub use crate::roads::status::Status as RoadsStatus;
  • pub use crate::roads::snap_to_roads::request::Request as SnapToRoadsRequest;
  • pub use crate::roads::snap_to_roads::response::Response as SnapToRoadsResponse;
  • pub use crate::roads::nearest_roads::request::Request as NearestRoadsRequest;
  • pub use crate::roads::nearest_roads::response::Response as NearestRoadsResponse;

Modules§

  • Roads API error types and error messages.
  • In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error statu
  • The Roads API Nearest Roads service returns individual road segments for a given set of GPS coordinates. This services takes up to 100 GPS points and returns the closest road segment for each point. The points passed do not need to be part of a continuous path.
  • The Roads API Snap To Roads service takes up to 100 GPS points collected along a route, and returns a similar set of data, with the points snapped to the most likely roads the vehicle was traveling along. Optionally, you can request that the points be interpolated, resulting in a path that smoothly follows the geometry of the road.
  • Resources (enums, structs) for processing the Snap To Roads response from the Google Maps Platform. Look in here for more information about the data returned from Google’s server and how to parse it with your program.
  • The "status" field within the Roads API response object contains the status of the request, and may contain debugging information to help you track down why the Roads API is not working.