External function for looking up interpolated data from a specified source
| 145 | |
| 146 | // External function for looking up interpolated data from a specified source |
| 147 | RasterDatum |
| 148 | RasterContainer::GetRasterInterpolateFromSource(unsigned int source_id, double lon, double lat) |
| 149 | { |
| 150 | if (RasterCache::getInstance().getLoadedSources().size() < source_id + 1) |
| 151 | { |
| 152 | throw util::exception("Attempted to access source " + std::to_string(source_id) + |
| 153 | ", but there are only " + |
| 154 | std::to_string(RasterCache::getInstance().getLoadedSources().size()) + |
| 155 | " loaded" + SOURCE_REF); |
| 156 | } |
| 157 | |
| 158 | BOOST_ASSERT(lat < 90); |
| 159 | BOOST_ASSERT(lat > -90); |
| 160 | BOOST_ASSERT(lon < 180); |
| 161 | BOOST_ASSERT(lon > -180); |
| 162 | |
| 163 | const auto &found = RasterCache::getInstance().getLoadedSources()[source_id]; |
| 164 | return found.GetRasterInterpolate( |
| 165 | static_cast<std::int32_t>(util::toFixed(util::FloatLongitude{lon})), |
| 166 | static_cast<std::int32_t>(util::toFixed(util::FloatLatitude{lat}))); |
| 167 | } |
| 168 | |
| 169 | RasterCache *RasterCache::g_instance = NULL; |
| 170 | } // namespace osrm::extractor |
nothing calls this directly
no test coverage detected