def METHOD_NAME(
    self, layer: dict[str, Any], name: str, lon: float, lat: float
) -> Optional[decimal.Decimal]:
    data = self._get_data(layer, name)
    type_ = layer.get("type", "shp_index")
    if type_ == "shp_index":
        tiles = list(data.filter(mask={"type": "Point", "coordinates": [lon, lat]}))
        if not tiles:
            return None
        path = os.path.join(os.path.dirname(layer["file"]), tiles[0]["properties"]["location"])
        # Avoid loading if not needed
        import rasterio  # pylint: disable=import-outside-toplevel
        with rasterio.open(path) as dataset:
            result = self._get_value(layer, name, dataset, lon, lat)
    elif type_ == "gdal":
        result = self._get_value(layer, name, data, lon, lat)
    else:
        raise ValueError("Unsupported type " + type_)
    result_d = None
    if "round" in layer and result is not None:
        result_d = self._round(result, layer["round"])
    elif result is not None:
        result_d = decimal.Decimal(str(result))
    return result_d