Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elevation API - Added Resolution #165

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions GoogleMapsApi.Test/IntegrationTests/ElevationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public async Task Elevation_ReturnsCorrectElevation()
AssertInconclusive.NotExceedQuota(result);
Assert.That(result.Status, Is.EqualTo(Entities.Elevation.Response.Status.OK));
Assert.That(result.Results.First().Elevation, Is.EqualTo(16.92).Within(1.0));
Assert.That(result.Results.First().Resolution, Is.EqualTo(75.0).Within(10.0));
}

[Test]
Expand All @@ -40,6 +41,7 @@ public void ElevationAsync_ReturnsCorrectElevation()
AssertInconclusive.NotExceedQuota(result);
Assert.That(result.Status, Is.EqualTo(Entities.Elevation.Response.Status.OK));
Assert.That(result.Results.First().Elevation, Is.EqualTo(16.92).Within(1.0));
Assert.That(result.Results.First().Resolution, Is.EqualTo(75.0).Within(10.0));
}
}
}
9 changes: 9 additions & 0 deletions GoogleMapsApi/Entities/Elevation/Response/Result.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,14 @@ public class Result
/// </summary>
[DataMember(Name = "elevation")]
public double Elevation { get; set; }

/// <summary>
/// The value indicating the maximum distance between data points from which the elevation was interpolated, in meters.
/// This property will be missing if the resolution is not known.
/// Note that elevation data becomes more coarse (larger resolution values) when multiple points are passed.
/// To obtain the most accurate elevation value for a point, it should be queried independently.
/// </summary>
[DataMember(Name = "resolution")]
public double Resolution { get; set; }
}
}