def _get_raster_value(self, layer, ref, lon, lat): if ref in self._rasters: raster = self._rasters[ref] elif "type" not in layer or layer["type"] == "shp_index": raster = GeoRaster(layer["file"]) self._rasters[ref] = raster else: raise HTTPInternalServerError( 'Bad raster type "%s" for raster layer "%s"' % (layer["type"], ref)) # pragma: no cover result = raster.get_value(lon, lat) if "round" in layer: result = self._round(result, layer["round"]) elif result is not None: result = Decimal(str(result)) return result
def _get_raster_value(self, layer, ref, lon, lat): if ref in self._rasters: raster = self._rasters[ref] elif 'type' not in layer or layer['type'] == 'shp_index': raster = GeoRaster(layer['file']) self._rasters[ref] = raster else: raise HTTPInternalServerError( "Bad raster type '%s' for raster layer '%s'" % (layer['type'], ref)) # pragma: no cover result = raster.get_value(lon, lat) if 'round' in layer: result = self._round(result, layer['round']) elif result is not None: result = Decimal(str(result)) return result