Table of Contents

Class SnapToRoadsRequest

Namespace
GoogleMapsApi.Entities.Roads.Request
Assembly
GoogleMapsApi.dll

Request for the Roads API Snap to Roads endpoint (GET https://roads.googleapis.com/v1/snapToRoads). Snaps up to MaxPathPoints GPS points to the most likely road segments they were traveling along.

public sealed class SnapToRoadsRequest : MapsBaseRequest
Inheritance
SnapToRoadsRequest
Inherited Members

Remarks

For best results, consecutive points should be within 300m of each other. See https://developers.google.com/maps/documentation/roads/snap.

Fields

MaxPathPoints

Maximum number of points accepted in a single request.

public const int MaxPathPoints = 100

Field Value

int

Properties

Interpolate

When true, the response is interpolated to include additional points so the returned path smoothly follows road geometry. Interpolated points have no OriginalIndex. Defaults to false.

public bool Interpolate { get; set; }

Property Value

bool

Path

The path to snap, as an ordered sequence of points. Required; 1 to MaxPathPoints points.

public IEnumerable<Location>? Path { get; set; }

Property Value

IEnumerable<Location>

Methods

GetUri()

Builds the absolute request URI, including scheme, base URL, and serialized query-string parameters.

public override Uri GetUri()

Returns

Uri

The fully composed URI to send to the Google Maps API.