MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / GetRasterData

Method GetRasterData

src/extractor/raster_source.cpp:36–47  ·  view source on GitHub ↗

Query raster source for nearest data point

Source from the content-addressed store, hash-verified

34
35// Query raster source for nearest data point
36RasterDatum RasterSource::GetRasterData(const int lon, const int lat) const
37{
38 if (lon < xmin || lon > xmax || lat < ymin || lat > ymax)
39 {
40 return {};
41 }
42
43 const std::size_t xth = static_cast<std::size_t>(std::round((lon - xmin) / xstep));
44 const std::size_t yth = static_cast<std::size_t>(std::round((ymax - lat) / ystep));
45
46 return {raster_data(xth, yth)};
47}
48
49// Query raster source using bilinear interpolation
50RasterDatum RasterSource::GetRasterInterpolate(const int lon, const int lat) const

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected