Online Maps v3
Loading...
Searching...
No Matches
OnlineMapsGoogleRoads Class Reference

The Google Maps Roads API identifies the roads a vehicle was traveling along and provides additional metadata about those roads, such as speed limits.
https://developers.google.com/maps/documentation/roads/intro?hl=en. More...

Inheritance diagram for OnlineMapsGoogleRoads:
OnlineMapsTextWebService OnlineMapsWebServiceAPI

Classes

class  Location
 Latitude and longitude value. More...
 
class  SnapToRoadResult
 Snap to road result. More...
 
class  SpeedLimitResult
 Speed limit result. More...
 

Public Types

enum  Units { KPH , MPH }
 Speed limits in kilometers or miles per hour. More...
 

Static Public Member Functions

static SnapToRoadResult[] GetSnapToRoadResults (string response)
 Convert response string into an array of SnapToRoadResult.
 
static SpeedLimitResult[] GetSpeedLimitResults (string response)
 Convert response string into an array of SpeedLimitResult.
 
static OnlineMapsGoogleRoads SnapToRoads (string key, IEnumerable path, bool interpolate=false)
 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.
https://developers.google.com/maps/documentation/roads/snap.
 
static OnlineMapsGoogleRoads SpeedLimits (string key, IEnumerable path, Units units=Units.KPH)
 This service returns the posted speed limit for a road segment.
The Speed Limit service is only available to Google Maps APIs Premium Plan customers.
https://developers.google.com/maps/documentation/roads/speed-limits?hl=en.
 

Additional Inherited Members

- Public Member Functions inherited from OnlineMapsWebServiceAPI
void Destroy ()
 Destroys the current request to webservice.
 
OnlineMapsWWW GetWWW ()
 Get request instance.
 
- Public Attributes inherited from OnlineMapsTextWebService
Action< string > OnComplete
 Event that occurs when a response is received from webservice.
 
new Action< OnlineMapsTextWebServiceOnFailed
 Event that occurs when an error response is received from webservice.
 
new Action< OnlineMapsTextWebServiceOnFinish
 This event is occurs after other events, before disposing the request.
 
new Action< OnlineMapsTextWebServiceOnSuccess
 Event that occurs when a success response is received from webservice.
 
- Public Attributes inherited from OnlineMapsWebServiceAPI
Action< OnlineMapsWebServiceAPIOnFailed
 Event that occurs when an error response is received from webservice.
 
Action< OnlineMapsWebServiceAPIOnFinish
 Event that occurs after OnComplete, when the response from webservice processed.
 
Action< OnlineMapsWebServiceAPIOnDispose
 Event that occurs when the current request instance is disposed.
 
Action< OnlineMapsWebServiceAPIOnSuccess
 Event that occurs when a success response is received from webservice.
 
object customData
 In this variable you can put any data that you need to work with requests.
 
- Protected Member Functions inherited from OnlineMapsTextWebService
void OnRequestComplete (OnlineMapsWWW www)
 Checks whether the response from webservice.
 
- Protected Attributes inherited from OnlineMapsTextWebService
string _response
 Response string.
 
- Properties inherited from OnlineMapsTextWebService
string response [get]
 Gets a response from webservice.
 
- Properties inherited from OnlineMapsWebServiceAPI
OnlineMapsQueryStatus status [get]
 Gets the current status of the request to webservice.
 

Detailed Description

The Google Maps Roads API identifies the roads a vehicle was traveling along and provides additional metadata about those roads, such as speed limits.
https://developers.google.com/maps/documentation/roads/intro?hl=en.

Member Enumeration Documentation

◆ Units

Speed limits in kilometers or miles per hour.

Enumerator
KPH 

Kilometers per hour.

MPH 

Miles per hour.

Member Function Documentation

◆ GetSnapToRoadResults()

static SnapToRoadResult[] OnlineMapsGoogleRoads.GetSnapToRoadResults ( string response)
static

Convert response string into an array of SnapToRoadResult.

Parameters
responseResponse string from Google Roads API
Returns
Array of SnapToRoadResult

◆ GetSpeedLimitResults()

static SpeedLimitResult[] OnlineMapsGoogleRoads.GetSpeedLimitResults ( string response)
static

Convert response string into an array of SpeedLimitResult.

Parameters
responseResponse string from Google Roads API
Returns
Array of SpeedLimitResult

◆ SnapToRoads()

static OnlineMapsGoogleRoads OnlineMapsGoogleRoads.SnapToRoads ( string key,
IEnumerable path,
bool interpolate = false )
static

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.
https://developers.google.com/maps/documentation/roads/snap.

Parameters
keyYour application's API key. Your application must identify itself every time it sends a request to the Google Maps Roads API by including an API key with each request.
pathThe path to be snapped.
IEnumerable values can be float, double or Vector2.
interpolateWhether to interpolate a path to include all points forming the full road-geometry.
When true, additional interpolated points will also be returned, resulting in a path that smoothly follows the geometry of the road, even around corners and through tunnels.
Interpolated paths will most likely contain more points than the original path.
Returns
Instance of request.

◆ SpeedLimits()

static OnlineMapsGoogleRoads OnlineMapsGoogleRoads.SpeedLimits ( string key,
IEnumerable path,
Units units = Units::KPH )
static

This service returns the posted speed limit for a road segment.
The Speed Limit service is only available to Google Maps APIs Premium Plan customers.
https://developers.google.com/maps/documentation/roads/speed-limits?hl=en.

Parameters
keyYour application's API key. Your application must identify itself every time it sends a request to the Google Maps Roads API by including an API key with each request.
pathIEnumerable values can be float, double, Vector2 or string.
If values is string, it must contain placeId.
If values is float, double or Vector2, it must contain coordinates.
unitsWhether to return speed limits in kilometers or miles per hour. This can be set to either KPH or MPH.
Returns
Instance of request.