Skip to content

Commit

Permalink
Elevation API - Added Resolution (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximn authored Oct 9, 2024
1 parent 89e6386 commit 8ab0880
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
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; }
}
}

0 comments on commit 8ab0880

Please sign in to comment.